This patch precommits tests that expose bugs in BasicBlock::removePredecessor.
In certain cases calling this function breaks SSA form.
Those bugs will be fixed in upcoming patches.
Details
- Reviewers
grosser spatel lebedev.ri
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/test/Transforms/Inline/clone-function-no-assert-on-phis.ll | ||
---|---|---|
8–10 | Can that happen for non-dead code? |
llvm/test/Transforms/Inline/clone-function-no-assert-on-phis.ll | ||
---|---|---|
8–10 | I think it doesn't happen for non-dead code. Otherwise, verifier would tell us about that. |
llvm/test/Transforms/Inline/clone-function-no-assert-on-phis.ll | ||
---|---|---|
8–10 | Please can you be more specific? https://bugs.llvm.org/show_bug.cgi?id=27065 |
llvm/test/Transforms/Inline/clone-function-no-assert-on-phis.ll | ||
---|---|---|
8–10 | I don't have a test case for LLVM where this would cause miscompilation or compiler crash. But I ran into issues in our downstream. If you look from an API perspective, BasicBlock::removePredecessor violates its 'contract'. I mean it could leave broken code after itself. And we are not sure noone will use this code afterwards. Moreover, implementation of BasicBlock::removePredecessor has serious issue and happens to work just by luck. I will upload the fix to showcase this. As for the second part, yes, the repro in the LLVM bug tracker is no longer valid. You can find small examples in the unittests attached to this patch. |
Can that happen for non-dead code?
That is perfectly okay for dead, unreachable code.