@@ -313,29 +313,22 @@ collectVirtualRegUses(SmallVectorImpl<VRegMaskOrUnit> &VRegMaskOrUnits,
313313// / Mostly copy/paste from CodeGen/RegisterPressure.cpp
314314static LaneBitmask getLanesWithProperty (
315315 const LiveIntervals &LIS, const MachineRegisterInfo &MRI,
316- bool TrackLaneMasks, Register RegUnit, SlotIndex Pos,
317- LaneBitmask SafeDefault,
316+ bool TrackLaneMasks, Register Reg, SlotIndex Pos,
318317 function_ref<bool (const LiveRange &LR, SlotIndex Pos)> Property) {
319- if (RegUnit.isVirtual ()) {
320- const LiveInterval &LI = LIS.getInterval (RegUnit);
321- LaneBitmask Result;
322- if (TrackLaneMasks && LI.hasSubRanges ()) {
323- for (const LiveInterval::SubRange &SR : LI.subranges ()) {
324- if (Property (SR, Pos))
325- Result |= SR.LaneMask ;
326- }
327- } else if (Property (LI, Pos)) {
328- Result = TrackLaneMasks ? MRI.getMaxLaneMaskForVReg (RegUnit)
329- : LaneBitmask::getAll ();
318+ assert (Reg.isVirtual ());
319+ const LiveInterval &LI = LIS.getInterval (Reg);
320+ LaneBitmask Result;
321+ if (TrackLaneMasks && LI.hasSubRanges ()) {
322+ for (const LiveInterval::SubRange &SR : LI.subranges ()) {
323+ if (Property (SR, Pos))
324+ Result |= SR.LaneMask ;
330325 }
331-
332- return Result;
326+ } else if (Property (LI, Pos)) {
327+ Result =
328+ TrackLaneMasks ? MRI.getMaxLaneMaskForVReg (Reg) : LaneBitmask::getAll ();
333329 }
334330
335- const LiveRange *LR = LIS.getCachedRegUnit (RegUnit);
336- if (LR == nullptr )
337- return SafeDefault;
338- return Property (*LR, Pos) ? LaneBitmask::getAll () : LaneBitmask::getNone ();
331+ return Result;
339332}
340333
341334// / Mostly copy/paste from CodeGen/RegisterPressure.cpp
@@ -503,10 +496,9 @@ void GCNRPTracker::reset(const MachineRegisterInfo &MRI_,
503496}
504497
505498// / Mostly copy/paste from CodeGen/RegisterPressure.cpp
506- LaneBitmask GCNRPTracker::getLastUsedLanes (Register RegUnit,
507- SlotIndex Pos) const {
499+ LaneBitmask GCNRPTracker::getLastUsedLanes (Register Reg, SlotIndex Pos) const {
508500 return getLanesWithProperty (
509- LIS, *MRI, true , RegUnit , Pos.getBaseIndex (), LaneBitmask::getNone (),
501+ LIS, *MRI, true , Reg , Pos.getBaseIndex (),
510502 [](const LiveRange &LR, SlotIndex Pos) {
511503 const LiveRange::Segment *S = LR.getSegmentContaining (Pos);
512504 return S != nullptr && S->end == Pos.getRegSlot ();
0 commit comments