[PATCH] D109428: [SImplifyCFG] SwitchInst processing redirecting the UB edges from the BB with the phiNode, that contains the UB, to the new BB.
Max Kazantsev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 16 22:46:08 PDT 2021
mkazantsev accepted this revision.
mkazantsev added a comment.
This revision is now accepted and ready to land.
LGTM with nits
================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:6616
+ // Create the new block in which will redirect the edges that
+ // lead to undefine behavior
+ BasicBlock *Unreachable = BasicBlock::Create(
----------------
Better
```
Redirect all branches leading to UB into a newly created unreachable block.
```
================
Comment at: llvm/test/Transforms/SimplifyCFG/switch_ub.ll:67
; TODO: Basing on fact that load(null) is UB, we can remove edge pred->bb.
define i32 @test_03(i32* %p, i32 %x, i1 %cond) {
----------------
Pls remove TODOs
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109428/new/
https://reviews.llvm.org/D109428
More information about the llvm-commits
mailing list