Skip to content

Commit

Permalink
[AMDGPU] Add EXPENSIVE_CHECK into GCNRPTracker::reset
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vpykhtin committed Oct 28, 2022
1 parent 088a816 commit fecf067
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
Expand Up @@ -260,6 +260,22 @@ void GCNRPTracker::reset(const MachineInstr &MI,
}

MaxPressure = CurPressure = getRegPressure(*MRI, LiveRegs);

LLVM_DEBUG(dbgs() << "\nReset " << (After ? "after" : "before") << ": " << MI
<< print(LiveRegs, *MRI));
#if defined(EXPENSIVE_CHECKS) && !defined(NDEBUG)
if (LiveRegsCopy) {
auto LISLRS =
After ? getLiveRegsAfter(MI, LIS) : getLiveRegsBefore(MI, LIS);
if (!isEqual(LISLRS, *LiveRegsCopy)) {
dbgs() << "RP mismatch: "
<< reportMismatch(LISLRS, *LiveRegsCopy,
MRI->getTargetRegisterInfo());
llvm_unreachable("GCNRPTracker::reset LiveRegsCopy doens't match those "
"calculated by LIS");
}
}
#endif
}

void GCNUpwardRPTracker::reset(const MachineInstr &MI,
Expand Down

0 comments on commit fecf067

Please sign in to comment.