%tobool = icmp ne i16 %and, 0
ret i1 %tobool
}
+
+; FIXME: this is a miscompile. We should not transform this.
+; See https://bugs.llvm.org/show_bug.cgi?id=44802
+define i1 @pr44802(i3 %a, i3 %x, i3 %y) {
+; CHECK-LABEL: @pr44802(
+; CHECK-NEXT: [[TMP1:%.*]] = and i3 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i3 [[TMP1]], 0
+; CHECK-NEXT: ret i1 [[TMP2]]
+;
+ %t0 = icmp ne i3 %a, 0
+ %t1 = zext i1 %t0 to i3
+ %t2 = lshr i3 %x, %t1
+ %t3 = shl i3 %y, %t1
+ %t4 = and i3 %t2, %t3
+ %t5 = icmp ne i3 %t4, 0
+ ret i1 %t5
+}