[llvm] [CodeGen] Minor refactor of CSRSavedLocation struct [nfc] (PR #170721)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 4 11:59:52 PST 2025


================
@@ -267,11 +278,11 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
         break;
       }
       if (CSRReg || CSROffset) {
+        CSRSavedLocation Loc(CSRReg, CSROffset);
         auto It = CSRLocMap.find(CFI.getRegister());
----------------
topperc wrote:

We should try the `insert` instead of `find` here. If the `insert` fails, do the check to make sure the value we tried to insert matches what was already there.

This can be a follow up.

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


More information about the llvm-commits mailing list