[PATCH] D46242: Support a funclet operand bundle in LowerInvoke

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 8 15:18:25 PDT 2018


rnk added a comment.

(sorry, delayed response due to vacatoin)



================
Comment at: lib/Transforms/Utils/LowerInvoke.cpp:51
     if (InvokeInst *II = dyn_cast<InvokeInst>(BB.getTerminator())) {
-      SmallVector<Value *, 16> CallArgs(II->op_begin(), II->op_end() - 3);
+      SmallVector<Value *, 16> CallArgs(II->arg_begin(), II->arg_end());
       // Insert a normal call instruction...
----------------
aheejin wrote:
> rnk wrote:
> > I think this pass needs to preserve operand bundles. You probably want to call `II->getOperandBundlesAsDefs(Bundles)`, and then remove `"funclet"` bundles.
> Then is this pass supposed to remove funclet operand bundles for call instructions as well?
I guess it doesn't matter actually. There should be a pass to remove all unreachable code after this pass. I'd recommend transferring all the bundles from the invoke to the call, just for simplicity.


Repository:
  rL LLVM

https://reviews.llvm.org/D46242





More information about the llvm-commits mailing list