OSDN Git Service

[InstCombine] add test for missing vector optimization
authorSanjay Patel <spatel@rotateright.com>
Sat, 4 Jun 2016 21:41:25 +0000 (21:41 +0000)
committerSanjay Patel <spatel@rotateright.com>
Sat, 4 Jun 2016 21:41:25 +0000 (21:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271808 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/cast.ll

index de09a7b..91b1348 100644 (file)
@@ -209,11 +209,24 @@ define i1 @test19(i32 %X) {
 ; CHECK-NEXT:    [[Z:%.*]] = icmp slt i32 %X, 12345
 ; CHECK-NEXT:    ret i1 [[Z]]
 ;
-  %c = sext i32 %X to i64         ; <i64> [#uses=1]
-  %Z = icmp slt i64 %c, 12345             ; <i1> [#uses=1]
+  %c = sext i32 %X to i64
+  %Z = icmp slt i64 %c, 12345
   ret i1 %Z
 }
 
+; FIXME: Vector should be the same as scalar.
+
+define <2 x i1> @test19vec(<2 x i32> %X) {
+; CHECK-LABEL: @test19vec(
+; CHECK-NEXT:    [[C:%.*]] = sext <2 x i32> %X to <2 x i64>
+; CHECK-NEXT:    [[Z:%.*]] = icmp slt <2 x i64> [[C]], <i64 12345, i64 2147483647>
+; CHECK-NEXT:    ret <2 x i1> [[Z]]
+;
+  %c = sext <2 x i32> %X to <2 x i64>
+  %Z = icmp slt <2 x i64> %c, <i64 12345, i64 2147483647>
+  ret <2 x i1> %Z
+}
+
 define i1 @test20(i1 %B) {
 ; CHECK-LABEL: @test20(
 ; CHECK-NEXT:    ret i1 false