This prohibits hoisiting identical llvm.deoptimize calls from 'then' and 'else' blocks of a conditional branch.
This fixes a crash that happened because we didn't hoist the return instructions together with the llvm.deoptimize calls, so the verifier would crash.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Transforms/Utils/SimplifyCFG.cpp | ||
---|---|---|
1521 | To me it looks like overkill. As far as I understand the problem, the crash happens when we hoist the deoptimize call which is then not followed by return after this hoisting. Hoisting any other instruction is perfectly legal, and it also reduces code size. Let's make the fix as non-invasive as possible. I still think that the requirement to have deoptimize immediately followed by return is useless and weird, but it's out of scope of this one. Until cancelled, we should sustain it. |
Instead of prohibiting hoisting from deoptimize blocks, just disallow hoisiting of llvm.deoptimize calls
LGTM, thanks! Would be good to simplify the bundle if possible.
llvm/test/Transforms/SimplifyCFG/dont-hoist-deoptimize.ll | ||
---|---|---|
31 | Is this massive bundle needed or can it be reduced? Same for the bundle below. |
llvm/test/Transforms/SimplifyCFG/dont-hoist-deoptimize.ll | ||
---|---|---|
31 | Yeah, they may be reduced. Thanks! Landed reduced version |
To me it looks like overkill. As far as I understand the problem, the crash happens when we hoist the deoptimize call which is then not followed by return after this hoisting. Hoisting any other instruction is perfectly legal, and it also reduces code size. Let's make the fix as non-invasive as possible.
I still think that the requirement to have deoptimize immediately followed by return is useless and weird, but it's out of scope of this one. Until cancelled, we should sustain it.