[FastISel][AArch64] Don't fold the sign-/zero-extend from i1 into the compare.
[oota-llvm.git] / test / CodeGen / AArch64 / arm64-fast-isel-icmp.ll
index bd1666bfb84a8961f2a7a6ae3ddae46d92865080..e0d7d413166428561a1f4a92cf7d8c269b732360 100644 (file)
@@ -172,6 +172,17 @@ entry:
   ret i32 %conv2
 }
 
+define i32 @icmp_i1_signed(i1 %a, i1 %b) nounwind {
+entry:
+; CHECK-LABEL: icmp_i1_signed
+; CHECK:       sbfx [[REG1:w[0-9]+]], w0, #0, #1
+; CHECK-NEXT:  sbfx [[REG2:w[0-9]+]], w1, #0, #1
+; CHECK-NEXT:  cmp  [[REG1]], [[REG2]]
+; CHECK-NEXT:  cset w0, gt
+  %cmp = icmp sgt i1 %a, %b
+  %conv2 = zext i1 %cmp to i32
+  ret i32 %conv2
+}
 
 define i32 @icmp_i16_signed_const(i16 %a) nounwind {
 entry: