@@ -101,13 +101,13 @@ bool PhysicalRegisterInfo::alias(RegisterRef RA, RegisterRef RB) const {
101101 return !disjoint (getUnits (RA), getUnits (RB));
102102}
103103
104- std::set<RegisterId> PhysicalRegisterInfo::getAliasSet (RegisterId Reg ) const {
104+ std::set<RegisterId> PhysicalRegisterInfo::getAliasSet (RegisterRef RR ) const {
105105 // Do not include Reg in the alias set.
106106 std::set<RegisterId> AS;
107- assert (!RegisterRef::isUnitId (Reg ) && " No units allowed" );
108- if (RegisterRef::isMaskId (Reg )) {
107+ assert (!RR. isUnit ( ) && " No units allowed" );
108+ if (RR. isMask ( )) {
109109 // XXX SLOW
110- const uint32_t *MB = getRegMaskBits (Reg );
110+ const uint32_t *MB = getRegMaskBits (RR );
111111 for (unsigned i = 1 , e = TRI.getNumRegs (); i != e; ++i) {
112112 if (MB[i / 32 ] & (1u << (i % 32 )))
113113 continue ;
@@ -116,8 +116,8 @@ std::set<RegisterId> PhysicalRegisterInfo::getAliasSet(RegisterId Reg) const {
116116 return AS;
117117 }
118118
119- assert (RegisterRef::isRegId (Reg ));
120- for (MCRegAliasIterator AI (Reg , &TRI, false ); AI.isValid (); ++AI)
119+ assert (RR. isReg ( ));
120+ for (MCRegAliasIterator AI (RR. asMCReg () , &TRI, false ); AI.isValid (); ++AI)
121121 AS.insert (*AI);
122122
123123 return AS;
@@ -139,7 +139,7 @@ std::set<RegisterId> PhysicalRegisterInfo::getUnits(RegisterRef RR) const {
139139
140140 assert (RR.isMask ());
141141 unsigned NumRegs = TRI.getNumRegs ();
142- const uint32_t *MB = getRegMaskBits (RR. Reg );
142+ const uint32_t *MB = getRegMaskBits (RR);
143143 for (unsigned I = 0 , E = (NumRegs + 31 ) / 32 ; I != E; ++I) {
144144 uint32_t C = ~MB[I]; // Clobbered regs
145145 if (I == 0 ) // Reg 0 should be ignored
@@ -160,7 +160,7 @@ std::set<RegisterId> PhysicalRegisterInfo::getUnits(RegisterRef RR) const {
160160}
161161
162162RegisterRef PhysicalRegisterInfo::mapTo (RegisterRef RR, RegisterId R) const {
163- if (RR.Reg == R)
163+ if (RR.Id == R)
164164 return RR;
165165 if (unsigned Idx = TRI.getSubRegIndex (RegisterRef (R).asMCReg (), RR.asMCReg ()))
166166 return RegisterRef (R, TRI.composeSubRegIndexLaneMask (Idx, RR.Mask ));
@@ -177,11 +177,11 @@ RegisterRef PhysicalRegisterInfo::mapTo(RegisterRef RR, RegisterId R) const {
177177
178178bool PhysicalRegisterInfo::equal_to (RegisterRef A, RegisterRef B) const {
179179 if (!A.isReg () || !B.isReg ()) {
180- // For non-regs, or comparing reg and non-reg, use only the Reg member.
181- return A.Reg == B.Reg ;
180+ // For non-regs, or comparing reg and non-reg, use only the Id member.
181+ return A.Id == B.Id ;
182182 }
183183
184- if (A.Reg == B.Reg )
184+ if (A.Id == B.Id )
185185 return A.Mask == B.Mask ;
186186
187187 // Compare reg units lexicographically.
@@ -213,14 +213,14 @@ bool PhysicalRegisterInfo::equal_to(RegisterRef A, RegisterRef B) const {
213213
214214bool PhysicalRegisterInfo::less (RegisterRef A, RegisterRef B) const {
215215 if (!A.isReg () || !B.isReg ()) {
216- // For non-regs, or comparing reg and non-reg, use only the Reg member.
217- return A.Reg < B.Reg ;
216+ // For non-regs, or comparing reg and non-reg, use only the Id member.
217+ return A.Id < B.Id ;
218218 }
219219
220- if (A.Reg == B.Reg )
220+ if (A.Id == B.Id )
221221 return A.Mask < B.Mask ;
222222 if (A.Mask == B.Mask )
223- return A.Reg < B.Reg ;
223+ return A.Id < B.Id ;
224224
225225 // Compare reg units lexicographically.
226226 llvm::MCRegUnitMaskIterator AI (A.asMCReg (), &getTRI ());
@@ -275,7 +275,7 @@ void PhysicalRegisterInfo::print(raw_ostream &OS, const RegisterAggr &A) const {
275275
276276bool RegisterAggr::hasAliasOf (RegisterRef RR) const {
277277 if (RR.isMask ())
278- return Units.anyCommon (PRI.getMaskUnits (RR. Reg ));
278+ return Units.anyCommon (PRI.getMaskUnits (RR));
279279
280280 for (MCRegUnitMaskIterator U (RR.asMCReg (), &PRI.getTRI ()); U.isValid (); ++U) {
281281 auto [Unit, LaneMask] = *U;
@@ -288,7 +288,7 @@ bool RegisterAggr::hasAliasOf(RegisterRef RR) const {
288288
289289bool RegisterAggr::hasCoverOf (RegisterRef RR) const {
290290 if (RR.isMask ()) {
291- BitVector T (PRI.getMaskUnits (RR. Reg ));
291+ BitVector T (PRI.getMaskUnits (RR));
292292 return T.reset (Units).none ();
293293 }
294294
@@ -303,7 +303,7 @@ bool RegisterAggr::hasCoverOf(RegisterRef RR) const {
303303
304304RegisterAggr &RegisterAggr::insert (RegisterRef RR) {
305305 if (RR.isMask ()) {
306- Units |= PRI.getMaskUnits (RR. Reg );
306+ Units |= PRI.getMaskUnits (RR);
307307 return *this ;
308308 }
309309
@@ -392,7 +392,7 @@ RegisterAggr::ref_iterator::ref_iterator(const RegisterAggr &RG, bool End)
392392 : Owner(&RG) {
393393 for (int U = RG.Units .find_first (); U >= 0 ; U = RG.Units .find_next (U)) {
394394 RegisterRef R = RG.PRI .getRefForUnit (U);
395- Masks[R.Reg ] |= R.Mask ;
395+ Masks[R.Id ] |= R.Mask ;
396396 }
397397 Pos = End ? Masks.end () : Masks.begin ();
398398 Index = End ? Masks.size () : 0 ;
0 commit comments