[Instcombine] fold logic ops to select
authorchenglin.bi <chenglin.bi@linaro.org>
Thu, 5 Jan 2023 03:03:42 +0000 (11:03 +0800)
committerchenglin.bi <chenglin.bi@linaro.org>
Thu, 5 Jan 2023 04:04:35 +0000 (12:04 +0800)
commit87b2c760d0183246c27f9e1c34e1e1120e03449b
tree75593ee40ff56b45c020e62009658b7e857c9066
parent50be2859443a7dea7c160cfb1e145832327b9ed8
[Instcombine] fold logic ops to select

(C & X) | ~(C | Y) -> C ? X : ~Y

https://alive2.llvm.org/ce/z/4yLh_i

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D139080
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/test/Transforms/InstCombine/logical-select.ll