[llvm] [AMDGPU] Optionally Use GCNRPTrackers during scheduling (PR #93090)

Jeffrey Byrnes via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 13:55:12 PDT 2024


================
@@ -1524,9 +1582,6 @@ bool PreRARematStage::sinkTriviallyRematInsts(const GCNSubtarget &ST,
     MachineInstr *MI = Entry.first;
     MachineInstr *OldMI = Entry.second;
 
-    // Remove OldMI from BBLiveInMap since we are sinking it from its MBB.
-    DAG.BBLiveInMap.erase(OldMI);
----------------
jrbyrnes wrote:

Based on the way I'm reading the code and the comment, it seems the intention of this line is to remove any live-in registers that are defined by OldMI, as we are rematerailizing the registers. But, what this line actually does is remove the entire LiveIn LiveRegSet if OldMI is a key in the map.

It seems to me that we need to update the set of live-ins for the impacted region to reflect the eliminated cross-BB live ranges. Rather than doing this per-register, I've just recalculated the entire map after all the changes to LIS were made.

That said, perhaps this should be addressed separately? 

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


More information about the llvm-commits mailing list