|
LLVM
10.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 (MCPhysReg Reg) |
Adds register units covered by physical register Reg. More... | |
| void | addRegMasked (MCPhysReg Reg, LaneBitmask Mask) |
Adds register units covered by physical register Reg that are part of the lanemask Mask. More... | |
| void | removeReg (MCPhysReg 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 (MCPhysReg 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... | |
Static Public Member Functions | |
| static void | accumulateUsedDefed (const MachineInstr &MI, LiveRegUnits &ModifiedRegUnits, LiveRegUnits &UsedRegUnits, const TargetRegisterInfo *TRI) |
For a machine instruction MI, adds all register units used in UsedRegUnits and defined or clobbered in ModifiedRegUnits. 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 64 of file LiveRegUnits.cpp.
References addReg(), addRegsInMask(), and llvm::phys_regs_and_masks().
Referenced by available(), canRenameUpToDef(), findSurvivorBackwards(), llvm::outliner::Candidate::initLRU(), false::Chain::str(), and tryToFindRegisterToRename().
|
inlinestatic |
For a machine instruction MI, adds all register units used in UsedRegUnits and defined or clobbered in ModifiedRegUnits.
This is useful when walking over a range of instructions to track registers used or defined seperately.
Definition at line 47 of file LiveRegUnits.h.
References addReg(), addRegsInMask(), assert(), llvm::TargetRegisterInfo::isConstantPhysReg(), llvm::Register::isPhysical(), llvm::RISCVFenceField::O, and Reg.
Referenced by getRegUnits(), INITIALIZE_PASS(), mayAlias(), and tryToFindRegisterToRename().
| void LiveRegUnits::addLiveIns | ( | const MachineBasicBlock & | MBB | ) |
Adds registers living into block MBB.
Definition at line 136 of file LiveRegUnits.cpp.
References addBlockLiveIns(), and llvm::MachineBasicBlock::getParent().
Referenced by available(), and 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 119 of file LiveRegUnits.cpp.
References addBlockLiveIns(), addCalleeSavedRegs(), llvm::MachineFunction::getFrameInfo(), llvm::MachineBasicBlock::getParent(), llvm::MachineFrameInfo::isCalleeSavedInfoValid(), llvm::MachineBasicBlock::isReturnBlock(), and llvm::MachineBasicBlock::successors().
Referenced by available(), llvm::RegScavenger::enterBasicBlockEnd(), getTag(), llvm::outliner::Candidate::initLRU(), and false::Chain::str().
|
inline |
Adds register units covered by physical register Reg.
Definition at line 87 of file LiveRegUnits.h.
References llvm::MCRegisterInfo::DiffListIterator::isValid(), and llvm::BitVector::set().
Referenced by accumulate(), accumulateUsedDefed(), addCalleeSavedRegs(), getTag(), stepBackward(), tryToFindRegisterToRename(), and updateDefinedRegisters().
|
inline |
Adds register units covered by physical register Reg that are part of the lanemask Mask.
Definition at line 94 of file LiveRegUnits.h.
References llvm::MCRegUnitMaskIterator::isValid(), 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 35 of file LiveRegUnits.cpp.
References llvm::MachineOperand::clobbersPhysReg(), E, llvm::MCRegisterInfo::getNumRegUnits(), llvm::MCRegUnitRootIterator::isValid(), and llvm::BitVector::set().
Referenced by accumulate(), accumulateUsedDefed(), and removeReg().
Adds all register units marked in the bitvector RegUnits.
Definition at line 145 of file LiveRegUnits.h.
Referenced by addCalleeSavedRegs(), and llvm::RegScavenger::scavengeRegister().
Returns true if no part of physical register Reg is live.
Definition at line 117 of file LiveRegUnits.h.
References accumulate(), addLiveIns(), addLiveOuts(), llvm::MCRegisterInfo::DiffListIterator::isValid(), MI, stepBackward(), and llvm::BitVector::test().
Referenced by clearKillFlags(), findSurvivorBackwards(), llvm::RISCVInstrInfo::getOutliningCandidateInfo(), llvm::AArch64InstrInfo::getOutliningCandidateInfo(), getTag(), hasRegisterDependency(), INITIALIZE_PASS(), llvm::RegScavenger::isRegUsed(), false::Chain::str(), and tryToFindRegisterToRename().
|
inline |
Clears the set.
Definition at line 81 of file LiveRegUnits.h.
References llvm::BitVector::reset().
Referenced by getTag(), and INITIALIZE_PASS().
|
inline |
Returns true if the set is empty.
Definition at line 84 of file LiveRegUnits.h.
References llvm::BitVector::none().
Referenced by addCalleeSavedRegs().
Return the internal bitvector representation of the set.
Definition at line 153 of file LiveRegUnits.h.
Referenced by addCalleeSavedRegs().
|
inline |
Initialize and clear the set.
Definition at line 74 of file LiveRegUnits.h.
References llvm::MCRegisterInfo::getNumRegUnits(), llvm::BitVector::reset(), and llvm::BitVector::resize().
Referenced by INITIALIZE_PASS(), llvm::outliner::Candidate::initLRU(), LiveRegUnits(), llvm::RegScavenger::setRegUsed(), and tryToFindRegisterToRename().
|
inline |
Removes all register units covered by physical register Reg.
Definition at line 103 of file LiveRegUnits.h.
References addRegsInMask(), llvm::MCRegisterInfo::DiffListIterator::isValid(), removeRegsNotPreserved(), and llvm::BitVector::reset().
Referenced by addCalleeSavedRegs(), llvm::RegScavenger::scavengeRegisterBackwards(), stepBackward(), and updateDefinedRegisters().
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 26 of file LiveRegUnits.cpp.
References llvm::MachineOperand::clobbersPhysReg(), E, llvm::MCRegisterInfo::getNumRegUnits(), llvm::MCRegUnitRootIterator::isValid(), and llvm::BitVector::reset().
Referenced by removeReg(), and stepBackward().
Removes all register units marked in the bitvector RegUnits.
Definition at line 149 of file LiveRegUnits.h.
References llvm::BitVector::reset().
Referenced by llvm::RegScavenger::scavengeRegister().
| 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 44 of file LiveRegUnits.cpp.
References addReg(), llvm::phys_regs_and_masks(), removeReg(), and removeRegsNotPreserved().
Referenced by available(), llvm::RegScavenger::backward(), getTag(), llvm::outliner::Candidate::initLRU(), and false::Chain::str().
1.8.13