[PATCH] D86395: InstCombine transform pattern "(~A & B) ^ A -> (A | B)" added

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 29 09:25:48 PDT 2020


xbolva00 added a comment.

No furher comments from me. If possible, commit new tests and rebase this patch.

Wait for @spatel too.



================
Comment at: llvm/test/Transforms/InstCombine/xor-or.ll:21
+  %4 = and i32 %3, %1
+  %5 = xor i32 %4, %0
+  ret i32 %5
----------------
spatel wrote:
> This test doesn't match the comment.
> 
> You need something like this:
> 
> ```
> define i32 @test2(i32 %p, i32 %y) {
>   %x = add i32 %p, 42 ; thwart complexity-based canonicalization
>   %n = xor i32 %x, -1
>   %a = and i32 %n, %y
>   %r = xor i32 %x, %a
>   ret i32 %r
> }
> 
> ```
Not done?


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

https://reviews.llvm.org/D86395



More information about the llvm-commits mailing list