[llvm] r277555 - add vector test for icmp+sub

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 17:36:54 PDT 2016


Author: spatel
Date: Tue Aug  2 19:36:54 2016
New Revision: 277555

URL: http://llvm.org/viewvc/llvm-project?rev=277555&view=rev
Log:
add vector test for icmp+sub

Modified:
    llvm/trunk/test/Transforms/InstCombine/sub.ll

Modified: llvm/trunk/test/Transforms/InstCombine/sub.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/sub.ll?rev=277555&r1=277554&r2=277555&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/sub.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/sub.ll Tue Aug  2 19:36:54 2016
@@ -101,12 +101,26 @@ define i32 @test10a(i32 %A) {
 }
 
 define i1 @test11(i8 %A, i8 %B) {
-	%C = sub i8 %A, %B
-	%cD = icmp ne i8 %C, 0
-	ret i1 %cD
 ; CHECK-LABEL: @test11(
-; CHECK: %cD = icmp ne i8 %A, %B
-; CHECK: ret i1 %cD
+; CHECK-NEXT:    [[D:%.*]] = icmp ne i8 %A, %B
+; CHECK-NEXT:    ret i1 [[D]]
+;
+  %C = sub i8 %A, %B
+  %D = icmp ne i8 %C, 0
+  ret i1 %D
+}
+
+; FIXME: Vectors should get the same folds as scalars.
+
+define <2 x i1> @test11vec(<2 x i8> %A, <2 x i8> %B) {
+; CHECK-LABEL: @test11vec(
+; CHECK-NEXT:    [[C:%.*]] = sub <2 x i8> %A, %B
+; CHECK-NEXT:    [[D:%.*]] = icmp ne <2 x i8> [[C]], zeroinitializer
+; CHECK-NEXT:    ret <2 x i1> [[D]]
+;
+  %C = sub <2 x i8> %A, %B
+  %D = icmp ne <2 x i8> %C, zeroinitializer
+  ret <2 x i1> %D
 }
 
 define i32 @test12(i32 %A) {




More information about the llvm-commits mailing list