[llvm] [llvm] Support multiple save/restore points in mir (PR #119357)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 21 04:42:05 PDT 2025
================
@@ -631,6 +631,61 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::CalledGlobal)
namespace llvm {
namespace yaml {
+// Struct representing one save/restore point in the
+// 'savePoint' / 'restorePoint' list. One point consist of machine basic block
+// name and list of saved/restored in this basic block registers. Generally
+// 'registers' is not obligatory field, if this field is not specified, it is
+// assumed to be equal to the list of all CalleeSavedRegisters, calculated
+// during PEI
+struct SaveRestorePointEntry {
+ StringValue Point;
+ std::vector<StringValue> Registers;
+
+ bool operator==(const SaveRestorePointEntry &Other) const {
+ return Point == Other.Point && Registers == Other.Registers;
+ }
+};
+
+using SaveRestorePoints =
+ std::variant<std::vector<SaveRestorePointEntry>, StringValue>;
----------------
arsenm wrote:
I don't understand why this is a variant, and not just the vector of points
https://github.com/llvm/llvm-project/pull/119357
More information about the llvm-commits
mailing list