[llvm] [Reg2Mem] Handle CallBr instructions (PR #90953)
via llvm-commits
llvm-commits at lists.llvm.org
Fri May 3 05:12:03 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();
----------------
XChy wrote:
Why? As the langref says:
> The output values of a ‘callbr’ instruction are available only to the ‘fallthrough’ block, not to any ‘indirect’ blocks(s).
https://github.com/llvm/llvm-project/pull/90953
More information about the llvm-commits
mailing list