[llvm] [CodeGen] Allow multiple location for the same CSR. (PR #168531)

Petr Penzin via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 21 11:48:36 PST 2025


================
@@ -76,38 +118,27 @@ class CFIInstrInserter : public MachineFunctionPass {
     unsigned IncomingCFARegister = 0;
     /// Value of cfa register valid at basic block exit.
     unsigned OutgoingCFARegister = 0;
-    /// Set of callee saved registers saved at basic block entry.
-    BitVector IncomingCSRSaved;
-    /// Set of callee saved registers saved at basic block exit.
-    BitVector OutgoingCSRSaved;
+    /// Set of locations where the callee saved registers are at basic block
+    /// entry.
+    SmallVector<CSRSavedLocation> IncomingCSRLocations;
+    /// Set of locations where the callee saved registers are at basic block
+    /// exit.
+    SmallVector<CSRSavedLocation> OutgoingCSRLocations;
----------------
ppenzin wrote:

Are all fields inside the `CSRSavedLocation` needed downstream from this definition? These two data structures would use quite a bit more memory, especially if we have a target with a lot of registers.

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


More information about the llvm-commits mailing list