[NFC][InstCombine] Add baseline tests for canonicalizing "and, add", "or, add", ...
authorEric Gullufsen <ericgullufsen@gmail.com>
Wed, 24 Aug 2022 14:44:04 +0000 (10:44 -0400)
committerEric Gullufsen <ericgullufsen@gmail.com>
Fri, 26 Aug 2022 17:57:11 +0000 (13:57 -0400)
commit2f525cfb76974b7c23aeda1199dfe9d78b012d2c
tree2cbefa5c3088bf8011dbc55d1ce11f9a9093fa73
parent482777123427622f15837cdbda97080798f6cc85
[NFC][InstCombine] Add baseline tests for canonicalizing "and, add", "or, add", "xor, add"

Baseline tests for canonicalizing "logic op, add"
```
((x + C1) & C2) --> ((x & C2) + C1)
((x + C1) ^ C2) --> ((x ^ C2) + C1)
((x + C1) | C2) --> ((x | C2) + C1)
```
for suitable constants `C1` and `C2`.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D131140
llvm/test/Transforms/InstCombine/and-xor-or.ll