[llvm] [MCP][NFC] Refactor eliminateSpillageCopies (PR #208210)

Gaƫtan Bossu via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 06:48:21 PDT 2026


================
@@ -1263,304 +1263,271 @@ void MachineCopyPropagation::backwardCopyPropagateBlock(
   Tracker.clear();
 }
 
-[[maybe_unused]] static void printSpillReloadChain(
-    DenseMap<MachineInstr *, SmallVector<MachineInstr *>> &SpillChain,
-    DenseMap<MachineInstr *, SmallVector<MachineInstr *>> &ReloadChain,
-    MachineInstr *Leader) {
-  auto &SC = SpillChain[Leader];
-  auto &RC = ReloadChain[Leader];
-  for (auto I = SC.rbegin(), E = SC.rend(); I != E; ++I)
-    (*I)->dump();
-  for (MachineInstr *MI : RC)
-    MI->dump();
-}
+struct SpillReloadPair {
----------------
gbossu wrote:

I think it's worth detailing what a pair is in this context, because the term is used throughout the refactor. Given this is MachineCopyPropagation, I guess this represents a spill followed by a reload of a physical register through another temporary register (and not through memory).

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


More information about the llvm-commits mailing list