25 const char *
const *SRINames,
26 const unsigned *SRILaneMasks,
27 unsigned SRICoveringLanes)
28 : InfoDesc(ID), SubRegIndexNames(SRINames),
29 SubRegIndexLaneMasks(SRILaneMasks),
30 RegClassBegin(RCB), RegClassEnd(RCE),
31 CoveringLanes(SRICoveringLanes) {
46 OS <<
"%physreg" <<
Reg;
51 OS <<
":sub(" << SubIdx <<
')';
58 OS <<
"Unit~" <<
Unit;
64 OS <<
"BadUnit~" <<
Unit;
70 assert(Roots.
isValid() &&
"Unit has no roots.");
72 for (++Roots; Roots.
isValid(); ++Roots)
93 Base < BaseE; Base += 32) {
95 for (
unsigned Mask = *SubClass++; Mask; Mask >>= 1) {
124 assert(BestRC &&
"Couldn't find the register class");
132 assert(RC->
isAllocatable() &&
"invalid for nonallocatable sets");
134 for (
unsigned i = 0; i != Order.size(); ++i)
149 if ((*I)->isAllocatable())
155 Allocatable &= Reserved.
flip();
165 if (
unsigned Common = *A++ & *B++)
187 unsigned Idx)
const {
188 assert(A && B &&
"Missing register class");
189 assert(Idx &&
"Bad sub-register index");
193 if (RCI.getSubReg() == Idx)
203 unsigned &PreA,
unsigned &PreB)
const {
204 assert(RCA && SubA && RCB && SubB &&
"Invalid arguments");
219 unsigned *BestPreA = &PreA;
220 unsigned *BestPreB = &PreB;
229 unsigned MinSize = RCA->
getSize();
237 if (!RC || RC->
getSize() < MinSize)
242 if (FinalA != FinalB)
251 *BestPreA = IA.getSubReg();
252 *BestPreB = IB.getSubReg();
255 if (BestRC->
getSize() == MinSize)
275 assert(Hint.first == 0 &&
"Target must implement TRI::getRegAllocationHints");
278 unsigned Phys = Hint.second;
290 if (std::find(Order.
begin(), Order.
end(), Phys) == Order.
end())
void push_back(const T &Elt)
bool isValid() const
Check if the iterator is at the end of the list.
TargetRegisterInfo(const TargetRegisterInfoDesc *ID, regclass_iterator RegClassBegin, regclass_iterator RegClassEnd, const char *const *SRINames, const unsigned *SRILaneMasks, unsigned CoveringLanes)
const TargetRegisterClass * getMinimalPhysRegClass(unsigned Reg, EVT VT=MVT::Other) const
void print(raw_ostream &) const
static unsigned virtReg2Index(unsigned Reg)
virtual ~TargetRegisterInfo()
static bool isVirtualRegister(unsigned Reg)
void print(raw_ostream &) const
regclass_iterator regclass_end() const
const TargetRegisterClass * getCommonSubClass(const TargetRegisterClass *A, const TargetRegisterClass *B) const
static int stackSlot2Index(unsigned Reg)
unsigned getNumRegClasses() const
std::pair< unsigned, unsigned > getRegAllocationHint(unsigned Reg) const
const TargetRegisterClass * getRegClass(unsigned i) const
ArrayRef< MCPhysReg > getRawAllocationOrder(const MachineFunction &MF) const
ID
LLVM Calling Convention Representation.
virtual void getRegAllocationHints(unsigned VirtReg, ArrayRef< MCPhysReg > Order, SmallVectorImpl< MCPhysReg > &Hints, const MachineFunction &MF, const VirtRegMap *VRM=0) const
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
MCRegUnitRootIterator enumerates the root registers of a register unit.
enable_if_c< std::numeric_limits< T >::is_integer &&!std::numeric_limits< T >::is_signed, std::size_t >::type countTrailingZeros(T Val, ZeroBehavior ZB=ZB_Width)
Count number of 0's from the least significant bit to the most stopping at the first 1...
virtual const TargetRegisterClass * getMatchingSuperRegClass(const TargetRegisterClass *A, const TargetRegisterClass *B, unsigned Idx) const
MCRegisterClass - Base class of TargetRegisterClass.
const TargetRegisterClass * getCommonSuperRegClass(const TargetRegisterClass *RCA, unsigned SubA, const TargetRegisterClass *RCB, unsigned SubB, unsigned &PreA, unsigned &PreB) const
regclass_iterator regclass_begin() const
bool isReserved(unsigned PhysReg) const
BitVector getAllocatableSet(const MachineFunction &MF, const TargetRegisterClass *RC=NULL) const
const TargetRegisterClass * getAllocatableClass(const TargetRegisterClass *RC) const
bool hasSubClass(const TargetRegisterClass *RC) const
void print(raw_ostream &) const
static bool isStackSlot(unsigned Reg)
bool isValid() const
Returns true if this iterator is still pointing at a valid entry.
static void getAllocatableSetForRC(const MachineFunction &MF, const TargetRegisterClass *RC, BitVector &R)
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
virtual BitVector getReservedRegs(const MachineFunction &MF) const =0
const char * getSubRegIndexName(unsigned SubIdx) const
unsigned getNumRegUnits() const
Return the number of (native) register units in the target. Register units are numbered from 0 to get...
static bool isPhysicalRegister(unsigned Reg)
MachineRegisterInfo & getRegInfo()
bool isAllocatable() const
bool hasType(EVT vt) const
const char * getName(unsigned RegNo) const
Return the human-readable symbolic target-specific name for the specified physical register...
static const TargetRegisterClass * firstCommonClass(const uint32_t *A, const uint32_t *B, const TargetRegisterInfo *TRI)
unsigned getPhys(unsigned virtReg) const
returns the physical register mapped to the specified virtual register
unsigned composeSubRegIndices(unsigned a, unsigned b) const
const MCRegisterInfo & MRI
const TargetRegisterInfo * TRI
const uint32_t * getSubClassMask() const
const TargetRegisterClass *const * regclass_iterator
bool contains(unsigned Reg) const