Skip to content
Unverified Commit 473deaf3 authored by Roman Lebedev's avatar Roman Lebedev
Browse files

[NFC][X86][AArch64] Add 'A - (A & B)' pattern tests (PR44448)

The fold 'A - (A & (B - 1))' -> 'A & (0 - B)'
added in 8dab0a4a
is too specific. It should just be 'A - (A & B)' -> 'A & (~B)'

Name: X - (X & Y)  ->  X & (~Y)
%o = and i32 %X, %Y
%r = sub i32 %X, %o
  =>
%n = xor i32 %Y, -1
%r = and i32 %X, %n

https://rise4fun.com/Alive/kOUl

See
  https://bugs.llvm.org/show_bug.cgi?id=44448
  https://reviews.llvm.org/D71499
parent df4119c1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment