[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


================
@@ -441,13 +445,15 @@ void PEIImpl::calculateSaveRestoreBlocks(MachineFunction &MF) {
     return;
   }
 
-  // Save refs to entry and return blocks.
-  SaveBlocks.push_back(&MF.front());
-  for (MachineBasicBlock &MBB : MF) {
-    if (MBB.isEHFuncletEntry())
-      SaveBlocks.push_back(&MBB);
-    if (MBB.isReturnBlock())
-      RestoreBlocks.push_back(&MBB);
+  if (MFI.getSavePoints().empty()) {
----------------
preames wrote:

You have an early return just above.  Delete the if-clause and reduce indentation.

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


More information about the llvm-commits mailing list