Fix a phase-ordering problem in SimplifyCFG.
Switch simplification could sometimes fail to notice when an intermediate case removal caused the switch condition to become constant. This would cause the switch to be simplified into a conditional branch rather than a direct branch. Most of the time this didn't matter, except that occasionally downstream parts of SimplifyCFG expect tautological branches to already have been eliminated. The missed handling in switch simplification would cause an assertion failure in the downstream code. Triggering the assertion failure is fairly sensitive to the exact order of various simplifications. Fixes https://github.com/llvm/llvm-project/issues/59768 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D140831
Loading
Please sign in to comment