[llvm-commits] [polly] r167923 - in /polly/trunk/test/CodeGen: simple_vec_call_2.ll simple_vec_impossible.ll simple_vec_ptr_ptr_ty.ll

Tobias Grosser grosser at fim.uni-passau.de
Wed Nov 14 00:25:52 PST 2012


Author: grosser
Date: Wed Nov 14 02:25:52 2012
New Revision: 167923

URL: http://llvm.org/viewvc/llvm-project?rev=167923&view=rev
Log:
test: LLVM supports now vectors of arbitrary pointers

This allows Polly to vectorize more code. Fix the relevant test cases.

Added:
    polly/trunk/test/CodeGen/simple_vec_ptr_ptr_ty.ll
Removed:
    polly/trunk/test/CodeGen/simple_vec_impossible.ll
Modified:
    polly/trunk/test/CodeGen/simple_vec_call_2.ll

Modified: polly/trunk/test/CodeGen/simple_vec_call_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/simple_vec_call_2.ll?rev=167923&r1=167922&r2=167923&view=diff
==============================================================================
--- polly/trunk/test/CodeGen/simple_vec_call_2.ll (original)
+++ polly/trunk/test/CodeGen/simple_vec_call_2.ll Wed Nov 14 02:25:52 2012
@@ -27,9 +27,6 @@
 }
 
 ; CHECK: %p_scevgep = getelementptr [1024 x float**]* @B, i64 0, i64 0
-; CHECK: %p_scevgep1 = getelementptr [1024 x float**]* @B, i64 0, i64 1
-; CHECK: %p_scevgep2 = getelementptr [1024 x float**]* @B, i64 0, i64 2
-; CHECK: %p_scevgep3 = getelementptr [1024 x float**]* @B, i64 0, i64 3
 ; CHECK: %value_p_splat_one = load <1 x float>* bitcast ([1024 x float]* @A to <1 x float>*), align 8
 ; CHECK: %value_p_splat = shufflevector <1 x float> %value_p_splat_one, <1 x float> %value_p_splat_one, <4 x i32> zeroinitializer
 ; CHECK: %0 = extractelement <4 x float> %value_p_splat, i32 0
@@ -40,10 +37,12 @@
 ; CHECK: [[RES2:%[a-zA-Z0-9_]+]] = tail call float** @foo(float %1) nounwind
 ; CHECK: [[RES3:%[a-zA-Z0-9_]+]] = tail call float** @foo(float %2) nounwind
 ; CHECK: [[RES4:%[a-zA-Z0-9_]+]] = tail call float** @foo(float %3) nounwind
-; CHECK: store float** [[RES1]], float*** %p_scevgep, align 4
-; CHECK: store float** [[RES2]], float*** %p_scevgep1, align 4
-; CHECK: store float** [[RES3]], float*** %p_scevgep2, align 4
-; CHECK: store float** [[RES4]], float*** %p_scevgep3, align 4
+; CHECK: %4 = insertelement <4 x float**> undef, float** %p_result, i32 0
+; CHECK: %5 = insertelement <4 x float**> %4, float** %p_result4, i32 1
+; CHECK: %6 = insertelement <4 x float**> %5, float** %p_result5, i32 2
+; CHECK: %7 = insertelement <4 x float**> %6, float** %p_result6, i32 3
+; CHECK: %vector_ptr = bitcast float*** %p_scevgep to <4 x float**>*
+; CHECK: store <4 x float**> %7, <4 x float**>* %vector_ptr, align 8
 
 ; CHECK-SCEV: %value_p_splat_one = load <1 x float>* bitcast ([1024 x float]* @A to <1 x float>*), align 8
 ; CHECK-SCEV: %value_p_splat = shufflevector <1 x float> %value_p_splat_one, <1 x float> %value_p_splat_one, <4 x i32> zeroinitializer
@@ -55,7 +54,8 @@
 ; CHECK-SCEV: [[RES2:%[a-zA-Z0-9_]+]] = tail call float** @foo(float %1) nounwind
 ; CHECK-SCEV: [[RES3:%[a-zA-Z0-9_]+]] = tail call float** @foo(float %2) nounwind
 ; CHECK-SCEV: [[RES4:%[a-zA-Z0-9_]+]] = tail call float** @foo(float %3) nounwind
-; CHECK-SCEV: store float** [[RES1]], float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 0), align 4
-; CHECK-SCEV: store float** [[RES2]], float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 1), align 4
-; CHECK-SCEV: store float** [[RES3]], float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 2), align 4
-; CHECK-SCEV: store float** [[RES4]], float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 3), align 4
+; CHECK-SCEV: %4 = insertelement <4 x float**> undef, float** %p_result, i32 0
+; CHECK-SCEV: %5 = insertelement <4 x float**> %4, float** %p_result1, i32 1
+; CHECK-SCEV: %6 = insertelement <4 x float**> %5, float** %p_result2, i32 2
+; CHECK-SCEV: %7 = insertelement <4 x float**> %6, float** %p_result3, i32 3
+; CHECK-SCEV: store <4 x float**> %7, <4 x float**>* bitcast ([1024 x float**]* @B to <4 x float**>*), align 

Removed: polly/trunk/test/CodeGen/simple_vec_impossible.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/simple_vec_impossible.ll?rev=167922&view=auto
==============================================================================
--- polly/trunk/test/CodeGen/simple_vec_impossible.ll (original)
+++ polly/trunk/test/CodeGen/simple_vec_impossible.ll (removed)
@@ -1,48 +0,0 @@
-; RUN: opt %loadPolly -basicaa -polly-codegen %vector-opt -S -polly-codegen-scev=false < %s | FileCheck %s
-; RUN: opt %loadPolly -basicaa -polly-codegen %vector-opt -S -polly-codegen-scev=true < %s | FileCheck %s -check-prefix=CHECK-SCEV
-target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
-target triple = "x86_64-unknown-linux-gnu"
-
- at A = common global [1024 x float**] zeroinitializer, align 16
- at B = common global [1024 x float**] zeroinitializer, align 16
-
-declare float @foo(float) readnone
-
-define void @simple_vec_call() nounwind {
-entry:
-  br label %body
-
-body:
-  %indvar = phi i64 [ 0, %entry ], [ %indvar_next, %body ]
-  %scevgep = getelementptr [1024 x float**]* @B, i64 0, i64 %indvar
-  %value = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0), align 16
-  store float** %value, float*** %scevgep, align 4
-  %indvar_next = add i64 %indvar, 1
-  %exitcond = icmp eq i64 %indvar_next, 4
-  br i1 %exitcond, label %return, label %body
-
-return:
-  ret void
-}
-
-; CHECK: %p_scevgep = getelementptr [1024 x float**]* @B, i64 0, i64 0
-; CHECK: %p_scevgep1 = getelementptr [1024 x float**]* @B, i64 0, i64 1
-; CHECK: %p_scevgep2 = getelementptr [1024 x float**]* @B, i64 0, i64 2
-; CHECK: %p_scevgep3 = getelementptr [1024 x float**]* @B, i64 0, i64 3
-; CHECK: %value_p_scalar_ = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0)
-; CHECK: %value_p_scalar_4 = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0)
-; CHECK: %value_p_scalar_5 = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0)
-; CHECK: %value_p_scalar_6 = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0)
-; CHECK: store float** %value_p_scalar_, float*** %p_scevgep, align 4
-; CHECK: store float** %value_p_scalar_4, float*** %p_scevgep1, align 4
-; CHECK: store float** %value_p_scalar_5, float*** %p_scevgep2, align 4
-; CHECK: store float** %value_p_scalar_6, float*** %p_scevgep3, align 4
-
-; CHECK-SCEV: %value_p_scalar_ = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0)
-; CHECK-SCEV: %value_p_scalar_1 = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0)
-; CHECK-SCEV: %value_p_scalar_2 = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0)
-; CHECK-SCEV: %value_p_scalar_3 = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0)
-; CHECK-SCEV: store float** %value_p_scalar_, float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 0), align 4
-; CHECK-SCEV: store float** %value_p_scalar_1, float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 1), align 4
-; CHECK-SCEV: store float** %value_p_scalar_2, float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 2), align 4
-; CHECK-SCEV: store float** %value_p_scalar_3, float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 3), align 4

Added: polly/trunk/test/CodeGen/simple_vec_ptr_ptr_ty.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/CodeGen/simple_vec_ptr_ptr_ty.ll?rev=167923&view=auto
==============================================================================
--- polly/trunk/test/CodeGen/simple_vec_ptr_ptr_ty.ll (added)
+++ polly/trunk/test/CodeGen/simple_vec_ptr_ptr_ty.ll Wed Nov 14 02:25:52 2012
@@ -0,0 +1,40 @@
+; RUN: opt %loadPolly -basicaa -polly-codegen %vector-opt -S -polly-codegen-scev=false < %s | FileCheck %s
+; RUN: opt %loadPolly -basicaa -polly-codegen %vector-opt -S -polly-codegen-scev=true < %s | FileCheck %s -check-prefix=CHECK-SCEV
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+ at A = common global [1024 x float**] zeroinitializer, align 16
+ at B = common global [1024 x float**] zeroinitializer, align 16
+
+declare float @foo(float) readnone
+
+define void @simple_vec_call() nounwind {
+entry:
+  br label %body
+
+body:
+  %indvar = phi i64 [ 0, %entry ], [ %indvar_next, %body ]
+  %scevgep = getelementptr [1024 x float**]* @B, i64 0, i64 %indvar
+  %value = load float*** getelementptr inbounds ([1024 x float**]* @A, i64 0, i64 0), align 16
+  store float** %value, float*** %scevgep, align 4
+  %indvar_next = add i64 %indvar, 1
+  %exitcond = icmp eq i64 %indvar_next, 4
+  br i1 %exitcond, label %return, label %body
+
+return:
+  ret void
+}
+
+; CHECK: %p_scevgep = getelementptr [1024 x float**]* @B, i64 0, i64 0
+; CHECK: %p_scevgep1 = getelementptr [1024 x float**]* @B, i64 0, i64 1
+; CHECK: %p_scevgep2 = getelementptr [1024 x float**]* @B, i64 0, i64 2
+; CHECK: %p_scevgep3 = getelementptr [1024 x float**]* @B, i64 0, i64 3
+; CHECK: %value_p_splat_one = load <1 x float**>* bitcast ([1024 x float**]* @A to <1 x float**>*), align 8
+; CHECK: %value_p_splat = shufflevector <1 x float**> %value_p_splat_one, <1 x float**> %value_p_splat_one, <4 x i32> zeroinitializer
+; CHECK: %vector_ptr = bitcast float*** %p_scevgep to <4 x float**>*
+; CHECK: store <4 x float**> %value_p_splat, <4 x float**>* %vector_ptr
+
+
+; CHECK-SCEV: %value_p_splat_one = load <1 x float**>* bitcast ([1024 x float**]* @A to <1 x float**>*), align 8
+; CHECK-SCEV: %value_p_splat = shufflevector <1 x float**> %value_p_splat_one, <1 x float**> %value_p_splat_one, <4 x i32> zeroinitializer
+; CHECK-SCEV: store <4 x float**> %value_p_splat, <4 x float**>* bitcast ([1024 x float**]* @B to <4 x float**>*), align 8





More information about the llvm-commits mailing list