filecheckize
authorChris Lattner <sabre@nondot.org>
Wed, 1 Sep 2010 05:10:14 +0000 (05:10 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 1 Sep 2010 05:10:14 +0000 (05:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112695 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/ScalarRepl/vector_promote.ll

index 4f875b0841b25179ce4277eff0c56c0eb080ef68..dd4251bde987ce24fb02b68b35a66b693e900025 100644 (file)
@@ -1,8 +1,7 @@
-; RUN: opt < %s -scalarrepl -S | not grep alloca
-; RUN: opt < %s -scalarrepl -S | grep {load <4 x float>}
+; RUN: opt < %s -scalarrepl -S | FileCheck %s
 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64"
 
-define void @test(<4 x float>* %F, float %f) {
+define void @test1(<4 x float>* %F, float %f) {
 entry:
        %G = alloca <4 x float>, align 16               ; <<4 x float>*> [#uses=3]
        %tmp = load <4 x float>* %F             ; <<4 x float>> [#uses=2]
@@ -14,6 +13,11 @@ entry:
        %tmp6 = fadd <4 x float> %tmp4, %tmp4           ; <<4 x float>> [#uses=1]
        store <4 x float> %tmp6, <4 x float>* %F
        ret void
+; CHECK: @test1
+; CHECK-NOT: alloca
+; CHECK: %tmp = load <4 x float>* %F
+; CHECK: fadd <4 x float> %tmp, %tmp
+; CHECK-NEXT: insertelement <4 x float> %tmp3, float %f, i32 0
 }
 
 define void @test2(<4 x float>* %F, float %f) {
@@ -28,6 +32,11 @@ entry:
        %tmp6 = fadd <4 x float> %tmp4, %tmp4           ; <<4 x float>> [#uses=1]
        store <4 x float> %tmp6, <4 x float>* %F
        ret void
+; CHECK: @test2
+; CHECK-NOT: alloca
+; CHECK: %tmp = load <4 x float>* %F
+; CHECK: fadd <4 x float> %tmp, %tmp
+; CHECK-NEXT: insertelement <4 x float> %tmp3, float %f, i32 2
 }
 
 define void @test3(<4 x float>* %F, float* %f) {
@@ -40,6 +49,11 @@ entry:
        %tmp.upgrd.4 = load float* %tmp.upgrd.3         ; <float> [#uses=1]
        store float %tmp.upgrd.4, float* %f
        ret void
+; CHECK: @test3
+; CHECK-NOT: alloca
+; CHECK: %tmp = load <4 x float>* %F
+; CHECK: fadd <4 x float> %tmp, %tmp
+; CHECK-NEXT: extractelement <4 x float> %tmp3, i32 2
 }
 
 define void @test4(<4 x float>* %F, float* %f) {
@@ -52,6 +66,11 @@ entry:
        %tmp.upgrd.6 = load float* %G.upgrd.5           ; <float> [#uses=1]
        store float %tmp.upgrd.6, float* %f
        ret void
+; CHECK: @test4
+; CHECK-NOT: alloca
+; CHECK: %tmp = load <4 x float>* %F
+; CHECK: fadd <4 x float> %tmp, %tmp
+; CHECK-NEXT: extractelement <4 x float> %tmp3, i32 0
 }
 
 define i32 @test5(float %X) {  ;; should turn into bitcast.
@@ -61,5 +80,8 @@ define i32 @test5(float %X) {  ;; should turn into bitcast.
        %a = bitcast float* %X1 to i32*
        %tmp = load i32* %a
        ret i32 %tmp
+; CHECK: @test5
+; CHECK-NEXT: bitcast float %X to i32
+; CHECK-NEXT: ret i32
 }