|
LLVM
5.0.0
|
A set of register units used to track register liveness. More...
#include "llvm/CodeGen/LiveRegUnits.h"
Public Member Functions | |
| LiveRegUnits ()=default | |
| Constructs a new empty LiveRegUnits set. More... | |
| LiveRegUnits (const TargetRegisterInfo &TRI) | |
| Constructs and initialize an empty LiveRegUnits set. More... | |
| void | init (const TargetRegisterInfo &TRI) |
| Initialize and clear the set. More... | |
| void | clear () |
| Clears the set. More... | |
| bool | empty () const |
| Returns true if the set is empty. More... | |
| void | addReg (unsigned Reg) |
Adds register units covered by physical register Reg. More... | |
| void | addRegMasked (unsigned Reg, LaneBitmask Mask) |
Adds register units covered by physical register Reg that are part of the lanemask Mask. More... | |
| void | removeReg (unsigned Reg) |
Removes all register units covered by physical register Reg. More... | |
| void | removeRegsNotPreserved (const uint32_t *RegMask) |
Removes register units not preserved by the regmask RegMask. More... | |
| void | addRegsInMask (const uint32_t *RegMask) |
Adds register units not preserved by the regmask RegMask. More... | |
| bool | available (unsigned Reg) const |
Returns true if no part of physical register Reg is live. More... | |
| void | stepBackward (const MachineInstr &MI) |
Updates liveness when stepping backwards over the instruction MI. More... | |
| void | accumulate (const MachineInstr &MI) |
Adds all register units used, defined or clobbered in MI. More... | |
| void | addLiveOuts (const MachineBasicBlock &MBB) |
Adds registers living out of block MBB. More... | |
| void | addLiveIns (const MachineBasicBlock &MBB) |
Adds registers living into block MBB. More... | |
| void | addUnits (const BitVector &RegUnits) |
Adds all register units marked in the bitvector RegUnits. More... | |
| void | removeUnits (const BitVector &RegUnits) |
Removes all register units marked in the bitvector RegUnits. More... | |
| const BitVector & | getBitVector () const |
| Return the internal bitvector representation of the set. More... | |
A set of register units used to track register liveness.
Definition at line 30 of file LiveRegUnits.h.
|
default |
Constructs a new empty LiveRegUnits set.
|
inline |
Constructs and initialize an empty LiveRegUnits set.
Definition at line 39 of file LiveRegUnits.h.
References init().
| void LiveRegUnits::accumulate | ( | const MachineInstr & | MI | ) |
Adds all register units used, defined or clobbered in MI.
This is useful when walking over a range of instruction to find registers unused over the whole range.
Definition at line 70 of file LiveRegUnits.cpp.
References addReg(), addRegsInMask(), llvm::TargetRegisterInfo::isPhysicalRegister(), and llvm::MachineOperandIteratorBase::isValid().
Referenced by findSurvivorBackwards().
| void LiveRegUnits::addLiveIns | ( | const MachineBasicBlock & | MBB | ) |
Adds registers living into block MBB.
Definition at line 128 of file LiveRegUnits.cpp.
References addBlockLiveIns(), addPristines(), and llvm::MachineBasicBlock::getParent().
Referenced by llvm::RegScavenger::enterBasicBlock().
| void LiveRegUnits::addLiveOuts | ( | const MachineBasicBlock & | MBB | ) |
Adds registers living out of block MBB.
Live out registers are the union of the live-in registers of the successor blocks and pristine registers. Live out registers of the end block are the callee saved registers.
Definition at line 113 of file LiveRegUnits.cpp.
References addBlockLiveIns(), addCalleeSavedRegs(), addPristines(), llvm::MachineFunction::getFrameInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFrameInfo::isCalleeSavedInfoValid(), llvm::MachineBasicBlock::isReturnBlock(), llvm::MachineBasicBlock::succ_empty(), and llvm::MachineBasicBlock::successors().
Referenced by llvm::RegScavenger::enterBasicBlockEnd().
|
inline |
Adds register units covered by physical register Reg.
Definition at line 57 of file LiveRegUnits.h.
References llvm::BitVector::set().
Referenced by accumulate(), addCalleeSavedRegs(), and stepBackward().
|
inline |
Adds register units covered by physical register Reg that are part of the lanemask Mask.
Definition at line 64 of file LiveRegUnits.h.
References llvm::BitmaskEnumDetail::Mask(), llvm::LaneBitmask::none(), and llvm::BitVector::set().
Referenced by addBlockLiveIns(), and llvm::RegScavenger::setRegUsed().
Adds register units not preserved by the regmask RegMask.
The regmask has the same format as the one in the RegMask machine operand.
Definition at line 36 of file LiveRegUnits.cpp.
References llvm::MachineOperand::clobbersPhysReg(), E, llvm::MCRegisterInfo::getNumRegUnits(), llvm::MCRegUnitRootIterator::isValid(), and llvm::BitVector::set().
Referenced by accumulate().
Adds all register units marked in the bitvector RegUnits.
Definition at line 115 of file LiveRegUnits.h.
Returns true if no part of physical register Reg is live.
Definition at line 87 of file LiveRegUnits.h.
References llvm::BitVector::test().
Referenced by findSurvivorBackwards(), and llvm::RegScavenger::isRegUsed().
|
inline |
|
inline |
Returns true if the set is empty.
Definition at line 54 of file LiveRegUnits.h.
References llvm::BitVector::empty().
Return the internal bitvector representation of the set.
Definition at line 123 of file LiveRegUnits.h.
|
inline |
Initialize and clear the set.
Definition at line 44 of file LiveRegUnits.h.
References llvm::MCRegisterInfo::getNumRegUnits(), llvm::BitVector::reset(), and llvm::BitVector::resize().
Referenced by LiveRegUnits().
|
inline |
Removes all register units covered by physical register Reg.
Definition at line 73 of file LiveRegUnits.h.
References llvm::BitVector::reset().
Referenced by addPristines(), llvm::RegScavenger::scavengeRegisterBackwards(), and stepBackward().
Removes register units not preserved by the regmask RegMask.
The regmask has the same format as the one in the RegMask machine operand.
Definition at line 27 of file LiveRegUnits.cpp.
References llvm::MachineOperand::clobbersPhysReg(), E, llvm::MCRegisterInfo::getNumRegUnits(), llvm::MCRegUnitRootIterator::isValid(), and llvm::BitVector::reset().
Referenced by stepBackward().
Removes all register units marked in the bitvector RegUnits.
Definition at line 119 of file LiveRegUnits.h.
References llvm::BitVector::reset().
| void LiveRegUnits::stepBackward | ( | const MachineInstr & | MI | ) |
Updates liveness when stepping backwards over the instruction MI.
This removes all register units defined or clobbered in MI and then adds the units used (as in use operands) in MI.
Definition at line 45 of file LiveRegUnits.cpp.
References addReg(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::MachineOperandIteratorBase::isValid(), removeReg(), and removeRegsNotPreserved().
Referenced by llvm::RegScavenger::backward().
1.8.6