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

Michael Maitland via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 06:26:17 PST 2025


================
@@ -392,14 +394,10 @@ void MIRPrinter::convert(ModuleSlotTracker &MST,
   YamlMFI.HasTailCall = MFI.hasTailCall();
   YamlMFI.IsCalleeSavedInfoValid = MFI.isCalleeSavedInfoValid();
   YamlMFI.LocalFrameSize = MFI.getLocalFrameSize();
-  if (MFI.getSavePoint()) {
-    raw_string_ostream StrOS(YamlMFI.SavePoint.Value);
-    StrOS << printMBBReference(*MFI.getSavePoint());
-  }
-  if (MFI.getRestorePoint()) {
-    raw_string_ostream StrOS(YamlMFI.RestorePoint.Value);
-    StrOS << printMBBReference(*MFI.getRestorePoint());
-  }
+  if (MFI.getSavePoint())
----------------
michaelmaitland wrote:

Here we have singular getSavePoint, plural YamlMFI.SavePoints, and singular getSavePoint again. It is a little weird that we're mixing singular and plural.

This makes me think that we should get rid of SavePoint and RestorePoint and replace it entirely with the plural SavePoints and RestorePoints. By this I mean `SavePoint` and `RestorePoint` should be replaced entirely in MIR with `SavePoints` and `RestorePoints`. There plural version can do everything the singular version can and more.

This could be done in a follow up patch if others agree this would be a good direction to move in.

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


More information about the llvm-commits mailing list