---------------------------------------- define i1 @src(i8 %x, i8 %y, i8 %z) { %0: %f = fshl i8 %x, i8 %x, i8 %z %f2 = fshl i8 %y, i8 %y, i8 %z %r = icmp eq i8 %f, %f2 ret i1 %r } => define i1 @tgt(i8 %x, i8 %y, i8 %z) { %0: %r = icmp eq i8 %x, %y ret i1 %r } Transformation seems to be correct!
https://alive2.llvm.org/ce/z/qAZp8f
Solves PR51565
This can be an assert, right? We're called only by foldICmpEquality(), so it already checked.