[llvm] [llvm] Support multiple save/restore points in mir (PR #119357)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 7 13:19:59 PDT 2025


================
@@ -209,10 +209,15 @@ void SILowerSGPRSpills::calculateSaveRestoreBlocks(MachineFunction &MF) {
   // So set the save points for those.
 
   // Use the points found by shrink-wrapping, if any.
-  if (MFI.getSavePoint()) {
-    SaveBlocks.push_back(MFI.getSavePoint());
-    assert(MFI.getRestorePoint() && "Both restore and save must be set");
-    MachineBasicBlock *RestoreBlock = MFI.getRestorePoint();
+  if (!MFI.getSavePoints().empty()) {
+    assert(MFI.getSavePoints().size() < 2 &&
+           "MFI can't contain multiple save points!");
----------------
preames wrote:

Same basic pattern to comments as above...

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


More information about the llvm-commits mailing list