[InstCombine] fold more icmp + select patterns by distributive laws
authorchenglin.bi <chenglin.bi@linaro.org>
Wed, 7 Dec 2022 15:54:23 +0000 (23:54 +0800)
committerchenglin.bi <chenglin.bi@linaro.org>
Wed, 7 Dec 2022 15:55:49 +0000 (23:55 +0800)
commitb4c8cfc7c211fae99c734ca5091c334238528443
tree01c22ebc2a7b8a9fc1b1d4b42566d74e65eec96b
parent10c3df728cb6d445b6ab9e2d62487e4ecf55693b
[InstCombine] fold more icmp + select patterns by distributive laws

follow up D139076, add icmp with not only eq/ne, but also gt/lt/ge/le.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D139253
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/test/Transforms/InstCombine/select-bitext.ll
llvm/test/Transforms/InstCombine/select-cmp.ll