36 RegInfo &RI = RegInfos[R];
37 if (RI.RegClass !=
nullptr && !BadRC[R]) {
38 if (RC->LaneMask != RI.RegClass->LaneMask) {
40 RI.RegClass =
nullptr;
50 if (UnitInfos[U].
Reg != 0)
61 std::pair<uint32_t,LaneBitmask>
P = *
I;
62 UnitInfo &UI = UnitInfos[P.first];
68 UI.Mask = RC->LaneMask;
84 MaskInfos.resize(RegMasks.
size()+1);
85 for (
uint32_t M = 1, NM = RegMasks.
size(); M <= NM; ++M) {
88 for (
unsigned i = 1, e = TRI.
getNumRegs(); i != e; ++i) {
89 if (!(MB[i/32] & (1u << (i%32))))
94 MaskInfos[M].Units = PU.flip();
104 std::set<RegisterId> AS;
109 for (
unsigned i = 1, e = TRI.
getNumRegs(); i != e; ++i) {
110 if (MB[i/32] & (1u << (i%32)))
141 std::pair<RegisterId,LaneBitmask> PA = *UMA;
142 if (PA.second.any() && (PA.second & RA.
Mask).none()) {
147 std::pair<RegisterId,LaneBitmask> PB = *UMB;
148 if (PB.second.any() && (PB.second & RB.
Mask).none()) {
153 if (PA.first == PB.first)
155 if (PA.first < PB.first)
157 else if (PB.first < PA.first)
166 bool Preserved = MB[RR.
Reg/32] & (1u << (RR.
Reg%32));
184 if ((SM & RR.
Mask).none())
186 unsigned SR =
SI.getSubReg();
187 if (!(MB[SR/32] & (1u << (SR%32))))
204 for (
unsigned w = 0, nw = NumRegs/32; w != nw; ++w) {
215 unsigned TailRegs = NumRegs % 32;
218 unsigned TW = NumRegs / 32;
219 uint32_t TailMask = (1u << TailRegs) - 1;
220 if (~BM[TW] & ~BN[TW] & TailMask)
232 const RegInfo &RI = RegInfos[R];
233 LaneBitmask RCM = RI.RegClass ? RI.RegClass->LaneMask
243 return Units.anyCommon(PRI.getMaskUnits(RR.
Reg));
246 std::pair<uint32_t,LaneBitmask>
P = *U;
247 if (P.second.none() || (P.second & RR.
Mask).any())
248 if (Units.test(P.first))
257 return T.reset(Units).none();
261 std::pair<uint32_t,LaneBitmask>
P = *U;
262 if (P.second.none() || (P.second & RR.
Mask).any())
263 if (!Units.test(P.first))
271 Units |= PRI.getMaskUnits(RR.
Reg);
276 std::pair<uint32_t,LaneBitmask>
P = *U;
277 if (P.second.none() || (P.second & RR.
Mask).any())
302 Units.reset(RG.Units);
321 int U = Units.find_first();
335 BitVector Regs(PRI.getTRI().getNumRegs());
336 AliasedRegs(U, Regs);
337 U = Units.find_next(U);
345 U = Units.find_next(U);
352 int F = Regs.find_first();
358 std::pair<uint32_t,LaneBitmask>
P = *
I;
359 if (Units.test(P.first))
367 for (
int U = Units.find_first(); U >= 0; U = Units.find_next(U))
379 Pos = End ? Masks.end() : Masks.begin();
380 Index = End ? Masks.size() : 0;
bool hasCoverOf(RegisterRef RR) const
A common definition of LaneBitmask for use in TableGen and CodeGen.
LaneBitmask reverseComposeSubRegIndexLaneMask(unsigned IdxA, LaneBitmask LaneMask) const
Transform a lanemask given for a virtual register to the corresponding lanemask before using subregis...
This class represents lattice values for constants.
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 ...
bool hasAliasOf(RegisterRef RR) const
unsigned const TargetRegisterInfo * TRI
RegisterRef intersectWith(RegisterRef RR) const
unsigned getNumRegUnits() const
Return the number of (native) register units in the target.
RegisterRef clearIn(RegisterRef RR) const
SI optimize exec mask operations pre RA
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...
MCSuperRegIterator enumerates all super-registers of Reg.
int find_first() const
find_first - Returns the index of the first set bit, -1 if none of the bits are set.
int find_next(unsigned Prev) const
find_next - Returns the index of the next set bit following the "Prev" bit.
static constexpr LaneBitmask getAll()
iterator_range< regclass_iterator > regclasses() const
Printable printRegUnit(unsigned Unit, const TargetRegisterInfo *TRI)
Create Printable object to print register units on a raw_ostream.
void print(raw_ostream &OS) const
MCRegUnitRootIterator enumerates the root registers of a register unit.
std::set< RegisterId > getAliasSet(RegisterId Reg) 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)
unsigned getNumRegs() const
Return the number of registers this target has (useful for sizing arrays holding per register informa...
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Iterator that enumerates the sub-registers of a Reg and the associated sub-register indices...
RegisterRef normalize(RegisterRef RR) const
MCRegAliasIterator enumerates all registers aliasing Reg.
RegisterRef makeRegRef() const
constexpr bool none() const
RegisterRef getRefForUnit(uint32_t U) const
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
RegisterAggr & insert(RegisterRef RR)
MachineOperand class - Representation of each machine instruction operand.
LaneBitmask getSubRegIndexLaneMask(unsigned SubIdx) const
Return a bitmask representing the parts of a register that are covered by SubIdx. ...
LaneBitmask composeSubRegIndexLaneMask(unsigned IdxA, LaneBitmask Mask) const
Transforms a LaneMask computed for one subregister to the lanemask that would have been computed when...
rr_iterator(const RegisterAggr &RG, bool End)
bool isValid() const
isValid - returns true if this iterator is not yet at the end.
static void clear(coro::Shape &Shape)
Representation of each machine instruction.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
T get(uint32_t Idx) const
static ValueLatticeElement intersect(const ValueLatticeElement &A, const ValueLatticeElement &B)
Combine two sets of facts about the same value into a single set of facts.
virtual ArrayRef< const uint32_t * > getRegMasks() const =0
Return all the call-preserved register masks defined for this target.
RegisterId getRegMaskId(const uint32_t *RM) const
RegisterRef mapTo(RegisterRef RR, unsigned R) const
const LaneBitmask LaneMask
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool isRegMaskId(RegisterId R)
const uint32_t * getRegMaskBits(RegisterId R) const
This class implements an extremely fast bulk output stream that can only output to a stream...
bool isValid() const
Check if the iterator is at the end of the list.
RegisterAggr & intersect(RegisterRef RR)