Commit Graph

4 Commits

Author SHA1 Message Date
David Bolvansky 3747c48d64 [NFC] Adjust tests for new fold
llvm-svn: 370886
2019-09-04 12:22:28 +00:00
David Bolvansky 358b80b340 [InstCombine] Fold sub (or A, B) (and A, B) to (xor A, B)
Summary:
```
Name: sub or and to xor
%or = or i32 %y, %x
%and = and i32 %x, %y
%sub = sub i32 %or, %and
  =>
%sub = xor i32 %x, %y

Optimization: sub or and to xor
Done: 1
Optimization is correct!
```
https://rise4fun.com/Alive/eJu

Reviewers: spatel, lebedev.ri

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 370883
2019-09-04 12:00:33 +00:00
David Bolvansky 54f3a651f3 [NFC] Added a new test for D67153
llvm-svn: 370881
2019-09-04 11:44:00 +00:00
David Bolvansky 75d734475a [NFC] Added tests for 'SUB of OR and AND to XOR' fold
llvm-svn: 370878
2019-09-04 11:17:08 +00:00