Skip to content

Commit fecf067

Browse files
committed
[AMDGPU] Add EXPENSIVE_CHECK into GCNRPTracker::reset
This would check if passed in live-ins registers match those calculated using LIS. This check currently breaks 420 lit tests when enabled. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D136860
1 parent 088a816 commit fecf067

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

llvm/lib/Target/AMDGPU/GCNRegPressure.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,22 @@ void GCNRPTracker::reset(const MachineInstr &MI,
260260
}
261261

262262
MaxPressure = CurPressure = getRegPressure(*MRI, LiveRegs);
263+
264+
LLVM_DEBUG(dbgs() << "\nReset " << (After ? "after" : "before") << ": " << MI
265+
<< print(LiveRegs, *MRI));
266+
#if defined(EXPENSIVE_CHECKS) && !defined(NDEBUG)
267+
if (LiveRegsCopy) {
268+
auto LISLRS =
269+
After ? getLiveRegsAfter(MI, LIS) : getLiveRegsBefore(MI, LIS);
270+
if (!isEqual(LISLRS, *LiveRegsCopy)) {
271+
dbgs() << "RP mismatch: "
272+
<< reportMismatch(LISLRS, *LiveRegsCopy,
273+
MRI->getTargetRegisterInfo());
274+
llvm_unreachable("GCNRPTracker::reset LiveRegsCopy doens't match those "
275+
"calculated by LIS");
276+
}
277+
}
278+
#endif
263279
}
264280

265281
void GCNUpwardRPTracker::reset(const MachineInstr &MI,

0 commit comments

Comments
 (0)