[llvm] [AMDGPU] Fix GCNUpwardRPTracker: max register pressure on defs. (PR #74422)

Piotr Sobczak via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 5 00:50:51 PST 2023


================
@@ -274,32 +274,42 @@ void GCNUpwardRPTracker::recede(const MachineInstr &MI) {
   if (MI.isDebugInstr())
     return;
 
-  auto DecrementDef = [this](const MachineOperand &MO) {
+  // Kill all defs.
+  GCNRegPressure DefPressure, ECDefPressure;
+  bool HasECDefs = false;
----------------
piotrAMD wrote:

Just to check my understanding - adding the variable `HasECDefs` is not really needed, but it saves some cpu cycles as it avoids adding pressures with all zeros in a common non-clobber case (`DefPressure += ECDefPressure`). Is that right?


https://github.com/llvm/llvm-project/pull/74422


More information about the llvm-commits mailing list