LLVM API Documentation
#include <LiveRegUnits.h>
Public Member Functions | |
LiveRegUnits () | |
Constructs a new empty LiveRegUnits set. More... | |
void | init (const TargetRegisterInfo *TRI) |
void | clear () |
bool | empty () const |
void | addReg (unsigned Reg, const MCRegisterInfo &MCRI) |
Adds a register to the set. More... | |
void | removeReg (unsigned Reg, const MCRegisterInfo &MCRI) |
Removes a register from the set. More... | |
void | removeRegsInMask (const MachineOperand &Op, const MCRegisterInfo &MCRI) |
Removes registers clobbered by the regmask operand Op . More... | |
bool | contains (unsigned Reg, const MCRegisterInfo &MCRI) const |
Returns true if register Reg (or one of its super register) is contained in the set. More... | |
void | stepBackward (const MachineInstr &MI, const MCRegisterInfo &MCRI) |
Simulates liveness when stepping backwards over an instruction(bundle): Remove Defs, add uses. More... | |
void | stepForward (const MachineInstr &MI, const MCRegisterInfo &MCRI) |
Simulates liveness when stepping forward over an instruction(bundle): Remove killed-uses, add defs. More... | |
void | addLiveIns (const MachineBasicBlock *MBB, const MCRegisterInfo &MCRI) |
Adds all registers in the live-in list of block BB . More... | |
A set of live register units with functions to track liveness when walking backward/forward through a basic block.
Definition at line 31 of file LiveRegUnits.h.
|
inline |
Constructs a new empty LiveRegUnits set.
Definition at line 38 of file LiveRegUnits.h.
void LiveRegUnits::addLiveIns | ( | const MachineBasicBlock * | MBB, |
const MCRegisterInfo & | MCRI | ||
) |
Adds all registers in the live-in list of block BB
.
Definition at line 105 of file LiveRegUnits.cpp.
References addReg(), llvm::A64CC::LE, llvm::MachineBasicBlock::livein_begin(), and llvm::MachineBasicBlock::livein_end().
|
inline |
Adds a register to the set.
Definition at line 50 of file LiveRegUnits.h.
References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::insert(), and llvm::MCRegisterInfo::DiffListIterator::isValid().
Referenced by addLiveIns(), stepBackward(), stepForward(), and UpdatePredRedefs().
|
inline |
Definition at line 45 of file LiveRegUnits.h.
References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::clear().
|
inline |
Returns true if register Reg
(or one of its super register) is contained in the set.
Definition at line 66 of file LiveRegUnits.h.
References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::count(), and llvm::MCRegisterInfo::DiffListIterator::isValid().
Referenced by RemoveKills(), and UpdatePredRedefs().
|
inline |
Definition at line 47 of file LiveRegUnits.h.
References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::empty().
|
inline |
Definition at line 40 of file LiveRegUnits.h.
References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::clear(), llvm::MCRegisterInfo::getNumRegs(), and llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::setUniverse().
|
inline |
Removes a register from the set.
Definition at line 56 of file LiveRegUnits.h.
References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::erase(), and llvm::MCRegisterInfo::DiffListIterator::isValid().
Referenced by stepBackward(), stepForward(), and UpdatePredRedefs().
void LiveRegUnits::removeRegsInMask | ( | const MachineOperand & | Op, |
const MCRegisterInfo & | MCRI | ||
) |
Removes registers clobbered by the regmask operand Op
.
We assume the high bits of a physical super register are not preserved unless the instruction has an implicit-use operand reading the super-register or a register unit for the upper bits is available.
Definition at line 36 of file LiveRegUnits.cpp.
References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::begin(), llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::end(), llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::erase(), and operClobbersUnit().
Referenced by stepBackward(), and stepForward().
void LiveRegUnits::stepBackward | ( | const MachineInstr & | MI, |
const MCRegisterInfo & | MCRI | ||
) |
Simulates liveness when stepping backwards over an instruction(bundle): Remove Defs, add uses.
Definition at line 47 of file LiveRegUnits.cpp.
References addReg(), llvm::MachineOperandIteratorBase::isValid(), removeReg(), and removeRegsInMask().
void LiveRegUnits::stepForward | ( | const MachineInstr & | MI, |
const MCRegisterInfo & | MCRI | ||
) |
Simulates liveness when stepping forward over an instruction(bundle): Remove killed-uses, add defs.
Uses with kill flag get removed from the set, defs added. If possible use StepBackward() instead of this function because some kill flags may be missing.
Definition at line 76 of file LiveRegUnits.cpp.
References addReg(), llvm::MachineOperandIteratorBase::isValid(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), removeReg(), removeRegsInMask(), and llvm::SmallVectorTemplateCommon< T, typename >::size().