[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


================
@@ -423,16 +423,20 @@ void PEIImpl::calculateCallFrameInfo(MachineFunction &MF) {
 /// callee-saved registers, and placing prolog and epilog code.
 void PEIImpl::calculateSaveRestoreBlocks(MachineFunction &MF) {
   const MachineFrameInfo &MFI = MF.getFrameInfo();
-
   // Even when we do not change any CSR, we still want to insert the
   // prologue and epilogue of the function.
   // 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:

Replace with "multiple save points are not yet supported"

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


More information about the llvm-commits mailing list