[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:06 PDT 2025
================
@@ -74,6 +74,34 @@ class CalleeSavedInfo {
bool isSpilledToReg() const { return SpilledToReg; }
};
+class SaveRestorePoints {
+public:
+ using PointsMap = DenseMap<MachineBasicBlock *, std::vector<CalleeSavedInfo>>;
+
+private:
+ PointsMap Map;
+
+public:
+ const PointsMap &get() const { return Map; }
+
+ const std::vector<CalleeSavedInfo> getCSInfo(MachineBasicBlock *MBB) const {
+ return Map.lookup(MBB);
+ }
+
+ void set(PointsMap CSI) { Map = std::move(CSI); }
+
+ MachineBasicBlock *findAny(const CalleeSavedInfo &Match) const {
+ for (auto [BB, CSIV] : Map)
----------------
arsenm wrote:
braces
https://github.com/llvm/llvm-project/pull/119357
More information about the llvm-commits
mailing list