35 RegInfo &RI = RegInfos[R];
36 if (RI.RegClass !=
nullptr && !BadRC[R]) {
37 if (RC->LaneMask != RI.RegClass->LaneMask) {
39 RI.RegClass =
nullptr;
49 if (UnitInfos[U].
Reg != 0)
60 std::pair<uint32_t,LaneBitmask>
P = *
I;
61 UnitInfo &UI = UnitInfos[P.first];
67 UI.Mask = RC->LaneMask;
83 MaskInfos.resize(RegMasks.
size()+1);
84 for (
uint32_t M = 1, NM = RegMasks.
size(); M <= NM; ++M) {
87 for (
unsigned i = 1,
e = TRI.
getNumRegs(); i !=
e; ++i) {
88 if (!(MB[i/32] & (1u << (i%32))))
93 MaskInfos[M].Units = PU.flip();
103 std::set<RegisterId> AS;
108 for (
unsigned i = 1,
e = TRI.
getNumRegs(); i !=
e; ++i) {
109 if (MB[i/32] & (1u << (i%32)))
140 std::pair<RegisterId,LaneBitmask> PA = *UMA;
141 if (PA.second.any() && (PA.second & RA.
Mask).none()) {
146 std::pair<RegisterId,LaneBitmask> PB = *UMB;
147 if (PB.second.any() && (PB.second & RB.
Mask).none()) {
152 if (PA.first == PB.first)
154 if (PA.first < PB.first)
156 else if (PB.first < PA.first)
165 bool Preserved = MB[RR.
Reg/32] & (1u << (RR.
Reg%32));
183 if ((SM & RR.
Mask).none())
185 unsigned SR =
SI.getSubReg();
186 if (!(MB[SR/32] & (1u << (SR%32))))
203 for (
unsigned w = 0, nw = NumRegs/32; w != nw; ++w) {
214 unsigned TailRegs = NumRegs % 32;
217 unsigned TW = NumRegs / 32;
218 uint32_t TailMask = (1u << TailRegs) - 1;
219 if (~BM[TW] & ~BN[TW] & TailMask)
231 const RegInfo &RI = RegInfos[R];
232 LaneBitmask RCM = RI.RegClass ? RI.RegClass->LaneMask
242 return Units.anyCommon(PRI.getMaskUnits(RR.
Reg));
245 std::pair<uint32_t,LaneBitmask>
P = *U;
246 if (P.second.none() || (P.second & RR.
Mask).any())
247 if (Units.test(P.first))
256 return T.reset(Units).none();
260 std::pair<uint32_t,LaneBitmask>
P = *U;
261 if (P.second.none() || (P.second & RR.
Mask).any())
262 if (!Units.test(P.first))
270 Units |= PRI.getMaskUnits(RR.
Reg);
275 std::pair<uint32_t,LaneBitmask>
P = *U;
276 if (P.second.none() || (P.second & RR.
Mask).any())
301 Units.reset(RG.Units);
320 int U = Units.find_first();
334 BitVector Regs(PRI.getTRI().getNumRegs());
335 AliasedRegs(U, Regs);
336 U = Units.find_next(U);
344 U = Units.find_next(U);
351 int F = Regs.find_first();
357 std::pair<uint32_t,LaneBitmask>
P = *
I;
358 if (Units.test(P.first))
366 for (
int U = Units.find_first(); U >= 0; U = Units.find_next(U))
378 Pos = End ? Masks.end() : Masks.begin();
379 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.
static bool isPhysicalRegister(unsigned Reg)
Return true if the specified register number is in the physical register namespace.
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.
unsigned getSubRegIndex(MCRegister RegNo, MCRegister SubRegNo) const
For a given register pair, return the sub-register index if the second register is a sub-register of ...
std::set< RegisterId > getAliasSet(RegisterId Reg) const
PhysicalRegisterInfo(const TargetRegisterInfo &tri, const MachineFunction &mf)
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.
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)