[llvm] [MIR] Support save/restore points with independent sets of registers (PR #119358)

Elizaveta Noskova via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 21 22:53:49 PDT 2025


================
@@ -967,12 +967,12 @@ bool ShrinkWrapImpl::run(MachineFunction &MF) {
                     << "\nRestore: " << printMBBReference(*Restore) << '\n');
 
   MachineFrameInfo &MFI = MF.getFrameInfo();
-  SmallVector<MachineBasicBlock *, 4> SavePoints;
-  SmallVector<MachineBasicBlock *, 4> RestorePoints;
-  if (Save) {
-    SavePoints.push_back(Save);
-    RestorePoints.push_back(Restore);
-  }
+
+  // List of CalleeSavedInfo for registers will be added during prologepilog
+  // pass
+  SaveRestorePoints SavePoints({{Save, {}}});
----------------
enoskova-sc wrote:

Yes, Save is always not-null here, otherwise we we had to return under this condition (or earlier):
``` 
bool ArePointsInteresting() const { return Save != Entry && Save && Restore; }
...
 if (!ArePointsInteresting())
    return Changed;
```

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


More information about the llvm-commits mailing list