25 RegInfo &RI = RegInfos[R];
26 if (RI.RegClass !=
nullptr && !BadRC[R]) {
27 if (RC->LaneMask != RI.RegClass->LaneMask) {
29 RI.RegClass =
nullptr;
39 if (UnitInfos[U].
Reg != 0)
50 std::pair<uint32_t,LaneBitmask>
P = *
I;
51 UnitInfo &UI = UnitInfos[P.first];
57 UI.Mask = RC->LaneMask;
73 MaskInfos.resize(RegMasks.
size()+1);
74 for (
uint32_t M = 1, NM = RegMasks.
size(); M <= NM; ++M) {
77 for (
unsigned i = 1, e = TRI.
getNumRegs(); i != e; ++i) {
78 if (!(MB[i/32] & (1u << (i%32))))
83 MaskInfos[M].Units = PU.flip();
93 std::set<RegisterId> AS;
98 for (
unsigned i = 1, e = TRI.
getNumRegs(); i != e; ++i) {
99 if (MB[i/32] & (1u << (i%32)))
128 while (UMA.isValid() && UMB.isValid()) {
130 std::pair<RegisterId,LaneBitmask> PA = *UMA;
131 if (PA.second.any() && (PA.second & RA.
Mask).none()) {
136 std::pair<RegisterId,LaneBitmask> PB = *UMB;
137 if (PB.second.any() && (PB.second & RB.
Mask).none()) {
142 if (PA.first == PB.first)
144 if (PA.first < PB.first)
146 else if (PB.first < PA.first)
155 bool Preserved = MB[RR.
Reg/32] & (1u << (RR.
Reg%32));
173 if ((SM & RR.
Mask).none())
175 unsigned SR =
SI.getSubReg();
176 if (!(MB[SR/32] & (1u << (SR%32))))
193 for (
unsigned w = 0, nw = NumRegs/32; w != nw; ++w) {
204 unsigned TailRegs = NumRegs % 32;
207 unsigned TW = NumRegs / 32;
208 uint32_t TailMask = (1u << TailRegs) - 1;
209 if (~BM[TW] & ~BN[TW] & TailMask)
221 const RegInfo &RI = RegInfos[R];
222 LaneBitmask RCM = RI.RegClass ? RI.RegClass->LaneMask
236 std::pair<uint32_t,LaneBitmask>
P = *U;
237 if (P.second.none() || (P.second & RR.
Mask).any())
238 if (Units.
test(P.first))
247 return T.reset(Units).none();
251 std::pair<uint32_t,LaneBitmask>
P = *U;
252 if (P.second.none() || (P.second & RR.
Mask).any())
253 if (!Units.
test(P.first))
266 std::pair<uint32_t,LaneBitmask>
P = *U;
267 if (P.second.none() || (P.second & RR.
Mask).any())
292 Units.
reset(RG.Units);
307 return RegisterAggr(PRI).insert(RR).clear(*this).makeRegRef();
326 AliasedRegs(U,
Regs);
342 int F =
Regs.find_first();
348 std::pair<uint32_t,LaneBitmask>
P = *
I;
349 if (Units.
test(P.first))
369 Pos = End ? Masks.end() : Masks.begin();
370 Index = End ? Masks.size() : 0;
std::set< RegisterId > getAliasSet(RegisterId Reg) const
bool isValid() const
Check if the iterator is at the end of the list.
int find_first() const
find_first - Returns the index of the first set bit, -1 if none of the bits are set.
bool isValid() const
Returns true if this iterator is not yet at the end.
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
bool anyCommon(const BitVector &RHS) const
Test if any common bits are set.
int find_next(unsigned Prev) const
find_next - Returns the index of the next set bit following the "Prev" bit.
static LaneBitmask getAll()
RegisterId getRegMaskId(const uint32_t *RM) const
LaneBitmask getSubRegIndexLaneMask(unsigned SubIdx) const
Return a bitmask representing the parts of a register that are covered by SubIdx. ...
unsigned getSubRegIndex(unsigned RegNo, unsigned SubRegNo) const
For a given register pair, return the sub-register index if the second register is a sub-register of ...
iterator_range< regclass_iterator > regclasses() const
MCRegUnitMaskIterator enumerates a list of register units and their associated lane masks for Reg...
MCSuperRegIterator enumerates all super-registers of Reg.
Reg
All possible values of the reg field in the ModR/M byte.
RegisterRef mapTo(RegisterRef RR, unsigned R) const
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
RegisterRef makeRegRef() const
MCRegUnitRootIterator enumerates the root registers of a register unit.
T get(uint32_t Idx) const
void print(raw_ostream &OS) const
PhysicalRegisterInfo(const TargetRegisterInfo &tri, const MachineFunction &mf)
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
RegisterAggr & clear(RegisterRef RR)
const TargetRegisterInfo & getTRI() const
LaneBitmask composeSubRegIndexLaneMask(unsigned IdxA, LaneBitmask Mask) const
Transforms a LaneMask computed for one subregister to the lanemask that would have been computed when...
bool hasCoverOf(RegisterRef RR) const
constexpr bool none() const
Iterator that enumerates the sub-registers of a Reg and the associated sub-register indices...
MCRegAliasIterator enumerates all registers aliasing Reg.
static const unsigned End
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
const BitVector & getMaskUnits(RegisterId MaskId) const
RegisterRef intersectWith(RegisterRef RR) const
RegisterAggr & insert(RegisterRef RR)
Printable PrintRegUnit(unsigned Unit, const TargetRegisterInfo *TRI)
Create Printable object to print register units on a raw_ostream.
RegisterRef normalize(RegisterRef RR) const
RegisterAggr(const PhysicalRegisterInfo &pri)
MachineOperand class - Representation of each machine instruction operand.
bool test(unsigned Idx) const
LaneBitmask reverseComposeSubRegIndexLaneMask(unsigned IdxA, LaneBitmask LaneMask) const
Transform a lanemask given for a virtual register to the corresponding lanemask before using subregis...
rr_iterator(const RegisterAggr &RG, bool End)
unsigned getNumRegUnits() const
Return the number of (native) register units in the target.
llvm_unreachable("Unknown RegBank!")
const uint32_t * getRegMaskBits(RegisterId R) const
RegisterRef getRefForUnit(uint32_t U) const
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
RegisterRef clearIn(RegisterRef RR) const
virtual ArrayRef< const uint32_t * > getRegMasks() const =0
Return all the call-preserved register masks defined for this target.
const LaneBitmask LaneMask
std::vector< uint8_t > Unit
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isRegMaskId(RegisterId R)
This class implements an extremely fast bulk output stream that can only output to a stream...
bool hasAliasOf(RegisterRef RR) const
RegisterAggr & intersect(RegisterRef RR)