Go to the documentation of this file.
14 #ifndef LLVM_CODEGEN_LIVEREGUNITS_H
15 #define LLVM_CODEGEN_LIVEREGUNITS_H
27 class MachineBasicBlock;
57 if (!
Reg.isPhysical())
63 if (!
TRI->isConstantPhysReg(
Reg))
66 assert(
O->isUse() &&
"Reg operand not a def and not a use");
96 if (UnitMask.
none() || (UnitMask &
Mask).any())
97 Units.
set((*Unit).first);
118 if (Units.
test(*Unit))
149 Units.
reset(RegUnits);
165 ConstMIBundleOperands,
std::function<bool(
const MachineOperand &)>>>
169 return MOP.isRegMask() || (MOP.isReg() && !MOP.isDebug() &&
177 #endif // LLVM_CODEGEN_LIVEREGUNITS_H
This is an optimization pass for GlobalISel generic memory operations.
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...
bool none() const
none - Returns true if none of the bits are set.
Reg
All possible values of the reg field in the ModR/M byte.
bool available(MCPhysReg Reg) const
Returns true if no part of physical register Reg is live.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
void addReg(MCPhysReg Reg)
Adds register units covered by physical register Reg.
LiveRegUnits()=default
Constructs a new empty LiveRegUnits set.
void resize(unsigned N, bool t=false)
resize - Grow or shrink the bitvector.
void addUnits(const BitVector &RegUnits)
Adds all register units marked in the bitvector RegUnits.
void addLiveIns(const MachineBasicBlock &MBB)
Adds registers living into block MBB.
void addRegMasked(MCPhysReg Reg, LaneBitmask Mask)
Adds register units covered by physical register Reg that are part of the lanemask Mask.
bool empty() const
Returns true if the set is empty.
unsigned const TargetRegisterInfo * TRI
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
void addLiveOuts(const MachineBasicBlock &MBB)
Adds registers living out of block MBB.
void accumulate(const MachineInstr &MI)
Adds all register units used, defined or clobbered in MI.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
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...
MachineOperand class - Representation of each machine instruction operand.
A set of register units used to track register liveness.
void removeReg(MCPhysReg Reg)
Removes all register units covered by physical register Reg.
void stepBackward(const MachineInstr &MI)
Updates liveness when stepping backwards over the instruction MI.
iterator_range< ConstMIBundleOperands > const_mi_bundle_ops(const MachineInstr &MI)
Representation of each machine instruction.
MCRegUnitMaskIterator enumerates a list of register units and their associated lane masks for Reg.
void removeUnits(const BitVector &RegUnits)
Removes all register units marked in the bitvector RegUnits.
filter_iterator_impl< WrappedIteratorT, PredicateT, typename detail::fwd_or_bidi_tag< WrappedIteratorT >::type > filter_iterator
Defines filter_iterator to a suitable specialization of filter_iterator_impl, based on the underlying...
LiveRegUnits(const TargetRegisterInfo &TRI)
Constructs and initialize an empty LiveRegUnits set.
void init(const TargetRegisterInfo &TRI)
Initialize and clear the set.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
print Print MemDeps of function
constexpr bool none() const
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...
Wrapper class representing virtual and physical registers.
bool test(unsigned Idx) const
ConstMIBundleOperands - Iterate over all operands in a const bundle of machine instructions.
void removeRegsNotPreserved(const uint32_t *RegMask)
Removes register units not preserved by the regmask RegMask.
const BitVector & getBitVector() const
Return the internal bitvector representation of the set.
void addRegsInMask(const uint32_t *RegMask)
Adds register units not preserved by the regmask RegMask.
void clear()
Clears the set.