[llvm] [Reg2Mem] Handle CallBr instructions (PR #90953)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri May 3 05:03:18 PDT 2024


================
@@ -102,9 +102,12 @@ AllocaInst *llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads,
         new StoreInst(&I, Slot, Handler->getFirstInsertionPt());
       return Slot;
     }
+  } else if (InvokeInst *II = dyn_cast<InvokeInst>(&I)) {
+    InsertPt = II->getNormalDest()->getFirstInsertionPt();
+  } else if (CallBrInst *CBI = dyn_cast<CallBrInst>(&I)) {
+    InsertPt = CBI->getDefaultDest()->getFirstInsertionPt();
----------------
nikic wrote:

I don't think this is right. The result of callbr can be used on all destinations, not just the default destination.

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


More information about the llvm-commits mailing list