[llvm] [AMDGPU][Scheduler] Refactor VGPR rematerialization during scheduling (PR #118722)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 05:58:51 PST 2024


================
@@ -1716,6 +1712,11 @@ bool PreRARematStage::isTriviallyReMaterializable(const MachineInstr &MI) {
   if (!DAG.TII->isTriviallyReMaterializable(MI))
     return false;
 
+  // Even though TargetInstrInfo::isReallyTriviallyReMaterializable already
+  // ensures that the instruction has no virtual register uses,
+  // SIInstrInfo::isReallyTriviallyReMaterializable may consider an instruction
+  // rematerializable and return before calling its parent's method, so we need
+  // to double-check here.
----------------
arsenm wrote:

Seems like a bug? All of these rematerialize functions are confusing

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


More information about the llvm-commits mailing list