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

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 11:05:26 PDT 2018


rnk added inline comments.


================
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...
----------------
I think this pass needs to preserve operand bundles. You probably want to call `II->getOperandBundlesAsDefs(Bundles)`, and then remove `"funclet"` bundles.


================
Comment at: test/Transforms/Util/lowerinvoke-funclet.ll:19
+  %1 = catchpad within %0 [i8* null, i32 64, i8* null]
+  invoke void @bar(i32 3) [ "funclet"(token %1) ]
+          to label %invoke.cont1 unwind label %ehcleanup
----------------
You should be able to extend this test with some arbitrary "test" bundle and then check that it comes out after the pass.


Repository:
  rL LLVM

https://reviews.llvm.org/D46242





More information about the llvm-commits mailing list