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

[NFC][DAGCombine][X86] '~(X - 1)' pattern tests

The fold 'A - (A & (B - 1))' -> 'A & (0 - B)'
added in 8dab0a4a
is too specific. It should just be 'A - (A & B)' -> 'A & (~B)',
but we currently fail to sink that '~' into `(B - 1)`.

Name: ~(X - 1)  ->  (0 - X)
%o = add i32 %X, -1
%r = xor i32 %o, -1
  =>
%r = sub i32 0, %X

https://rise4fun.com/Alive/rjU
parent 3d492d75
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