[llvm] [AMDGPU][Scheduler] Refactor ArchVGPR rematerialization during scheduling (PR #125885)
    Jeffrey Byrnes via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Mar 28 17:01:53 PDT 2025
    
    
  
================
@@ -1688,174 +1696,426 @@ bool PreRARematStage::allUsesAvailableAt(const MachineInstr *InstToRemat,
   return true;
 }
 
-void PreRARematStage::collectRematerializableInstructions() {
-  const SIRegisterInfo *SRI = static_cast<const SIRegisterInfo *>(DAG.TRI);
-  for (unsigned I = 0, E = DAG.MRI.getNumVirtRegs(); I != E; ++I) {
-    Register Reg = Register::index2VirtReg(I);
-    if (!DAG.LIS->hasInterval(Reg))
-      continue;
+namespace {
+/// Models excess register pressure in a region and tracks our progress as we
+/// identify rematerialization opportunities.
+struct ExcessRP {
----------------
jrbyrnes wrote:
It would be nice if we could build better ExcessRP queries into GCNRegPressure and rewrite this heuristic to use those queries in combination with GCNRegPressure.inc() . This will help with code maintenance -- maybe as a followup PR
https://github.com/llvm/llvm-project/pull/125885
    
    
More information about the llvm-commits
mailing list