diff options
author | hanbeom <kese111@gmail.com> | 2024-04-03 15:29:10 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 14:29:10 +0800 |
commit | 4ef22fce8208b9fc08da60c5e4f014ca09811b96 (patch) | |
tree | 55232c451191419d2a34acc1a04b936f2cdecfdc /llvm/lib/Object/COFFObjectFile.cpp | |
parent | de3e05ecb22473fe9904272ec3511ad1fd62d8d0 (diff) | |
download | llvm-4ef22fce8208b9fc08da60c5e4f014ca09811b96.zip llvm-4ef22fce8208b9fc08da60c5e4f014ca09811b96.tar.gz llvm-4ef22fce8208b9fc08da60c5e4f014ca09811b96.tar.bz2 |
[InstCombine] Simplify select if it combinated and/or/xor (#73362)
`and/or/xor` operations can each be changed to sum of logical
operations including operators other than themselves.
`x&y -> (x|y) ^ (x^y)`
`x|y -> (x&y) | (x^y)`
`x^y -> (x|y) ^ (x&y)`
if left of condition of `SelectInst` is `and/or/xor` logical
operation and right is equal to `0, -1`, or a `constant`, and
if `TrueVal` consist of `and/or/xor` logical operation then we
can optimize this case.
This patch implements this combination.
Proof: https://alive2.llvm.org/ce/z/WW8iRR
Fixes https://github.com/llvm/llvm-project/issues/71792.
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions