Open LebedevRI opened 4 years ago
define i8 @square(i8 %x, i8 %y) { %t0 = xor i8 %x, -43 %t1 = add i8 %t0, 1 %r = add i8 %t1, %y ret i8 %r }
https://godbolt.org/z/EpjvTY
Name: zz %t0 = xor i8 %x, -43 %t1 = add i8 %t0, 1 %r = add i8 %t1, %y ret i8 %r => %n0 = xor i8 %x, 42 %r = sub i8 %y, %n0 ret i8 %r %t0 = xor i8 %x, -43 %t1 = add i8 %t0, 1 Done: 1 Transformation seems to be correct!
I.e. we are missing an inverse-ish transform for https://reviews.llvm.org/D77459
https://alive2.llvm.org/ce/z/DazrgT
Extended Description
https://godbolt.org/z/EpjvTY