[PATCH] D112338: [InstCombine] Fold `(~(a | b) & c) | ~(a | c)` into `~((b & c) | a)`

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 28 13:19:23 PDT 2021


rampitec added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/and-xor-or.ll:1035
 
 define i32 @or_and_not_not_commute2(i32 %a, i32 %b, i32 %c) {
 ; CHECK-LABEL: @or_and_not_not_commute2(
----------------
spatel wrote:
> This is identical to the first test?
It has commuted 'and'. Now since I have added sdiv in the first test these are really different.


================
Comment at: llvm/test/Transforms/InstCombine/and-xor-or.ll:1092
 
 define i32 @or_and_not_not_commute5(i32 %a, i32 %b, i32 %c) {
 ; CHECK-LABEL: @or_and_not_not_commute5(
----------------
spatel wrote:
> Flipped the wrong set of operands? This is effectively the same as "commute2".
> 
> The final 'or' doesn't really matter (but it's fine to commute that just to be sure).
This is exactly the test for commuted final 'or', just for completeness.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D112338/new/

https://reviews.llvm.org/D112338



More information about the llvm-commits mailing list