@@ -92,6 +92,15 @@ PhysicalRegisterInfo::PhysicalRegisterInfo(const TargetRegisterInfo &tri,
92
92
}
93
93
MaskInfos[M].Units = PU.flip ();
94
94
}
95
+
96
+ AliasInfos.resize (TRI.getNumRegUnits ());
97
+ for (uint32_t U = 0 , NU = TRI.getNumRegUnits (); U != NU; ++U) {
98
+ BitVector AS (TRI.getNumRegs ());
99
+ for (MCRegUnitRootIterator R (U, &TRI); R.isValid (); ++R)
100
+ for (MCSuperRegIterator S (*R, &TRI, true ); S.isValid (); ++S)
101
+ AS.set (*S);
102
+ AliasInfos[U].Regs = AS;
103
+ }
95
104
}
96
105
97
106
std::set<RegisterId> PhysicalRegisterInfo::getAliasSet (RegisterId Reg) const {
@@ -317,26 +326,17 @@ RegisterRef RegisterAggr::makeRegRef() const {
317
326
if (U < 0 )
318
327
return RegisterRef ();
319
328
320
- auto AliasedRegs = [this ] (uint32_t Unit, BitVector &Regs) {
321
- for (MCRegUnitRootIterator R (Unit, &PRI.getTRI ()); R.isValid (); ++R)
322
- for (MCSuperRegIterator S (*R, &PRI.getTRI (), true ); S.isValid (); ++S)
323
- Regs.set (*S);
324
- };
325
-
326
329
// Find the set of all registers that are aliased to all the units
327
330
// in this aggregate.
328
331
329
332
// Get all the registers aliased to the first unit in the bit vector.
330
- BitVector Regs (PRI.getTRI ().getNumRegs ());
331
- AliasedRegs (U, Regs);
333
+ BitVector Regs = PRI.getUnitAliases (U);
332
334
U = Units.find_next (U);
333
335
334
336
// For each other unit, intersect it with the set of all registers
335
337
// aliased that unit.
336
338
while (U >= 0 ) {
337
- BitVector AR (PRI.getTRI ().getNumRegs ());
338
- AliasedRegs (U, AR);
339
- Regs &= AR;
339
+ Regs &= PRI.getUnitAliases (U);
340
340
U = Units.find_next (U);
341
341
}
342
342
0 commit comments