14 #ifndef LLVM_CODEGEN_LIVEREGUNITS_H 15 #define LLVM_CODEGEN_LIVEREGUNITS_H 27 class MachineBasicBlock;
64 ModifiedRegUnits.
addReg(Reg);
66 assert(
O->isUse() &&
"Reg operand not a def and not a use");
97 if (UnitMask.
none() || (UnitMask &
Mask).any())
98 Units.
set((*Unit).first);
119 if (Units.
test(*Unit))
150 Units.
reset(RegUnits);
168 std::function<bool(const MachineOperand &)> Pred =
170 return MOP.isRegMask() || (MOP.isReg() && !MOP.isDebug() &&
178 #endif // LLVM_CODEGEN_LIVEREGUNITS_H void resize(unsigned N, bool t=false)
resize - Grow or shrink the bitvector.
A common definition of LaneBitmask for use in TableGen and CodeGen.
bool empty() const
Returns true if the set is empty.
This class represents lattice values for constants.
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 i...
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
bool test(unsigned Idx) const
unsigned getNumRegUnits() const
Return the number of (native) register units in the target.
void removeUnits(const BitVector &RegUnits)
Removes all register units marked in the bitvector RegUnits.
const BitVector & getBitVector() const
Return the internal bitvector representation of the set.
bool isValid() const
Returns true if this iterator is not yet at the end.
MCRegUnitMaskIterator enumerates a list of register units and their associated lane masks for Reg...
void addLiveOuts(const MachineBasicBlock &MBB)
Adds registers living out of block MBB.
iterator_range< ConstMIBundleOperands > const_mi_bundle_ops(const MachineInstr &MI)
void addRegsInMask(const uint32_t *RegMask)
Adds register units not preserved by the regmask RegMask.
void addLiveIns(const MachineBasicBlock &MBB)
Adds registers living into block MBB.
bool available(MCPhysReg Reg) const
Returns true if no part of physical register Reg is live.
bool isPhysical() const
Return true if the specified register number is in the physical register namespace.
void addRegMasked(MCPhysReg Reg, LaneBitmask Mask)
Adds register units covered by physical register Reg that are part of the lanemask Mask...
void removeReg(MCPhysReg Reg)
Removes all register units covered by physical register Reg.
void init(const TargetRegisterInfo &TRI)
Initialize and clear the set.
constexpr bool none() const
void stepBackward(const MachineInstr &MI)
Updates liveness when stepping backwards over the instruction MI.
void addUnits(const BitVector &RegUnits)
Adds all register units marked in the bitvector RegUnits.
virtual bool isConstantPhysReg(unsigned PhysReg) const
Returns true if PhysReg is unallocatable and constant throughout the function.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
ConstMIBundleOperands - Iterate over all operands in a const bundle of machine instructions.
MachineOperand class - Representation of each machine instruction operand.
void accumulate(const MachineInstr &MI)
Adds all register units used, defined or clobbered in MI.
A range adaptor for a pair of iterators.
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
bool none() const
none - Returns true if none of the bits are set.
Representation of each machine instruction.
void addReg(MCPhysReg Reg)
Adds register units covered by physical register Reg.
LiveRegUnits()=default
Constructs a new empty LiveRegUnits set.
void clear()
Clears the set.
A set of register units used to track register liveness.
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)
Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void removeRegsNotPreserved(const uint32_t *RegMask)
Removes register units not preserved by the regmask RegMask.
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
Specialization of filter_iterator_base for forward iteration only.
LiveRegUnits(const TargetRegisterInfo &TRI)
Constructs and initialize an empty LiveRegUnits set.
iterator_range< filter_iterator< ConstMIBundleOperands, std::function< bool(const MachineOperand &)> > > phys_regs_and_masks(const MachineInstr &MI)
Returns an iterator range over all physical register and mask operands for MI and bundled instruction...
Wrapper class representing virtual and physical registers.