]> granicus.if.org Git - llvm/commit
[InstCombine] sub(xor(x, y), or(x, y)) -> neg(and(x, y))
authorDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 4 Sep 2019 18:03:21 +0000 (18:03 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Wed, 4 Sep 2019 18:03:21 +0000 (18:03 +0000)
commit3339db288445ef1d23ec64aa6dcd1a033506b881
treeb9a932498ea5eec4252129de3981f85702e8ae27
parent21474c96c13d5aba1a5a470c6b665622f635792a
[InstCombine] sub(xor(x, y), or(x, y)) -> neg(and(x, y))

Summary:
```
Name: sub(xor(x, y), or(x, y)) -> neg(and(x, y))
%or = or i32 %y, %x
%xor = xor i32 %x, %y
%sub = sub i32 %xor, %or
  =>
%sub1 = and i32 %x, %y
%sub = sub i32 0, %sub1

Optimization: sub(xor(x, y), or(x, y)) -> neg(and(x, y))
Done: 1
Optimization is correct!
```

https://rise4fun.com/Alive/8OI

Reviewers: lebedev.ri

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67188

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@370945 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/sub-xor-or-neg-and.ll