[SimplifyCFG] Create logical or in SimplifyCondBranchToCondBranch()
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 4 May 2021 17:11:37 +0000 (19:11 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 4 May 2021 17:51:30 +0000 (19:51 +0200)
commite20897726f080d6378668f8b4b656bbb34313578
tree32d103047b5dba032ab000c0a5b3aa973d1cf18a
parent54db12ff5a5ed33662c75bc465c5a44ac234c6f2
[SimplifyCFG] Create logical or in SimplifyCondBranchToCondBranch()

We need to use a logical or instead of a bitwise or to preserve
poison behavior. Poison from the second condition should not
propagate if the first condition is true.

We were already handling this correctly in FoldBranchToCommonDest(),
but not in this fold. (There are still other folds with this issue.)
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/SimplifyEqualityComparisonWithOnlyPredecessor-domtree-preservation-edgecase.ll
llvm/test/Transforms/SimplifyCFG/branch-fold.ll
llvm/test/Transforms/SimplifyCFG/extract-cost.ll
llvm/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll
llvm/test/Transforms/SimplifyCFG/preserve-branchweights.ll
llvm/test/Transforms/SimplifyCFG/wc-widen-block.ll