The current LowerInvoke pass cannot handle invoke instructions with a
funclet bundle operand. The order of operands for an invoke instruction
is {call arguments, callee, funclet operand (if any), normal dest,
unwind dest}. The current code assumes there is no funclet operand and
incorrectly includes a funclet operand into call arguments.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/Utils/LowerInvoke.cpp | ||
---|---|---|
51 ↗ | (On Diff #144503) | I think this pass needs to preserve operand bundles. You probably want to call II->getOperandBundlesAsDefs(Bundles), and then remove "funclet" bundles. |
test/Transforms/Util/lowerinvoke-funclet.ll | ||
19 ↗ | (On Diff #144503) | You should be able to extend this test with some arbitrary "test" bundle and then check that it comes out after the pass. |
lib/Transforms/Utils/LowerInvoke.cpp | ||
---|---|---|
51 ↗ | (On Diff #144503) | Then is this pass supposed to remove funclet operand bundles for call instructions as well? |
@rnk Ping? Thanks for your comments! I understand that I need to preserve other non-funclet operand bundles, and will do that, but what I'm not sure about is, as I said, if we are supposed to remove "funclet" bundles in this pass, should we do the same thing for "funclet" bundles attached to call instructions for consistency? If we should, would it make sense to be a part of "LowerInvoke" pass, the name that sounds like suggesting it only touches invoke instructions?
(sorry, delayed response due to vacatoin)
lib/Transforms/Utils/LowerInvoke.cpp | ||
---|---|---|
51 ↗ | (On Diff #144503) | 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. |