The actual transform i was going after was:
https://rise4fun.com/Alive/Tp9H
Name: zz Pre: isPowerOf2(C0) && isPowerOf2(C1) && C1 == C0 %t0 = and i8 %x, C0 %r = icmp eq i8 %t0, C1 => %t = icmp eq i8 %t0, 0 %r = xor i1 %t, -1 Name: zz Pre: isPowerOf2(C0) %t0 = and i8 %x, C0 %r = icmp ne i8 %t0, 0 => %t = icmp eq i8 %t0, 0 %r = xor i1 %t, -1
but as it can be seen from the current tests, we already canonicalize most of it,
and we are only missing handling multi-use non-canonical icmp predicates.
If we have both !=0 and ==0, even though we can CSE them,
we end up being stuck with them. We should canonicalize to the ==0.
I believe this is one of the cleanup steps i'll need after -scalarizer
if i end up proceeding with my WIP alloca promotion helper pass.
Add a comment to keep this synced with canonicalizeICmpPredicate()?