@@ -89,7 +89,7 @@ static bool foreachUnit(const TargetRegisterInfo *TRI,
8989 Callable Func) {
9090 if (VRegInterval.hasSubRanges ()) {
9191 for (MCRegUnitMaskIterator Units (PhysReg, TRI); Units.isValid (); ++Units) {
92- unsigned Unit = (*Units).first ;
92+ MCRegUnit Unit = (*Units).first ;
9393 LaneBitmask Mask = (*Units).second ;
9494 for (const LiveInterval::SubRange &S : VRegInterval.subranges ()) {
9595 if ((S.LaneMask & Mask).any ()) {
@@ -115,7 +115,7 @@ void LiveRegMatrix::assign(const LiveInterval &VirtReg, MCRegister PhysReg) {
115115 VRM->assignVirt2Phys (VirtReg.reg (), PhysReg);
116116
117117 foreachUnit (
118- TRI, VirtReg, PhysReg, [&](unsigned Unit, const LiveRange &Range) {
118+ TRI, VirtReg, PhysReg, [&](MCRegUnit Unit, const LiveRange &Range) {
119119 LLVM_DEBUG (dbgs () << ' ' << printRegUnit (Unit, TRI) << ' ' << Range);
120120 Matrix[Unit].unify (VirtReg, Range);
121121 return false ;
@@ -132,7 +132,7 @@ void LiveRegMatrix::unassign(const LiveInterval &VirtReg) {
132132 VRM->clearVirt (VirtReg.reg ());
133133
134134 foreachUnit (TRI, VirtReg, PhysReg,
135- [&](unsigned Unit, const LiveRange &Range) {
135+ [&](MCRegUnit Unit, const LiveRange &Range) {
136136 LLVM_DEBUG (dbgs () << ' ' << printRegUnit (Unit, TRI));
137137 Matrix[Unit].extract (VirtReg, Range);
138138 return false ;
@@ -175,11 +175,11 @@ bool LiveRegMatrix::checkRegUnitInterference(const LiveInterval &VirtReg,
175175 return false ;
176176 CoalescerPair CP (VirtReg.reg (), PhysReg, *TRI);
177177
178- bool Result = foreachUnit (TRI, VirtReg, PhysReg, [&]( unsigned Unit,
179- const LiveRange &Range) {
180- const LiveRange &UnitRange = LIS->getRegUnit (Unit);
181- return Range.overlaps (UnitRange, CP, *LIS->getSlotIndexes ());
182- });
178+ bool Result = foreachUnit (
179+ TRI, VirtReg, PhysReg, [&](MCRegUnit Unit, const LiveRange &Range) {
180+ const LiveRange &UnitRange = LIS->getRegUnit (Unit);
181+ return Range.overlaps (UnitRange, CP, *LIS->getSlotIndexes ());
182+ });
183183 return Result;
184184}
185185
0 commit comments