[polly] r222112 - Modify test cases to work with SCEV based code generation

Tobias Grosser tobias at grosser.es
Sun Nov 16 14:43:22 PST 2014


Author: grosser
Date: Sun Nov 16 16:43:21 2014
New Revision: 222112

URL: http://llvm.org/viewvc/llvm-project?rev=222112&view=rev
Log:
Modify test cases to work with SCEV based code generation

This patch includes tests where we actually need to adjust the CHECK lines
for SCEV based code generation. Besides these adjustments we add explicit
calls to -polly-codegen-scev=[true|false] and make sure we test both cases.

Modified:
    polly/trunk/test/Cloog/CodeGen/loop_with_condition_nested.ll
    polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll
    polly/trunk/test/Isl/CodeGen/LoopParallelMD/loop_nest_param_parallel.ll
    polly/trunk/test/Isl/CodeGen/aliasing_different_base_and_access_type.ll
    polly/trunk/test/Isl/CodeGen/annotated_alias_scopes.ll
    polly/trunk/test/Isl/CodeGen/loop_with_condition_nested.ll
    polly/trunk/test/Isl/CodeGen/simple_vec_assign_scalar.ll
    polly/trunk/test/Isl/CodeGen/simple_vec_cast.ll
    polly/trunk/test/Isl/single_loop_param_less_equal.ll
    polly/trunk/test/Isl/single_loop_param_less_than.ll

Modified: polly/trunk/test/Cloog/CodeGen/loop_with_condition_nested.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Cloog/CodeGen/loop_with_condition_nested.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Cloog/CodeGen/loop_with_condition_nested.ll (original)
+++ polly/trunk/test/Cloog/CodeGen/loop_with_condition_nested.ll Sun Nov 16 16:43:21 2014
@@ -1,5 +1,5 @@
 ; RUN: opt %loadPolly -basicaa -polly-cloog -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -basicaa -polly-codegen -loops -analyze < %s | FileCheck %s -check-prefix=LOOPS
+; RUN: opt %loadPolly -basicaa -polly-codegen -polly-codegen-scev=false -loops -analyze < %s | FileCheck %s -check-prefix=LOOPS
 
 ;#include <string.h>
 ;#define N 1024

Modified: polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll (original)
+++ polly/trunk/test/Cloog/CodeGen/vector_load_from_bitcast.ll Sun Nov 16 16:43:21 2014
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -tbaa -polly-codegen -polly-vectorizer=polly -S < %s | FileCheck %s
+; RUN: opt %loadPolly -tbaa -polly-codegen -polly-vectorizer=polly -polly-codegen-scev=false -S < %s | FileCheck %s
 
 target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128"
 target triple = "i386-apple-macosx10.8.0"

Modified: polly/trunk/test/Isl/CodeGen/LoopParallelMD/loop_nest_param_parallel.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/LoopParallelMD/loop_nest_param_parallel.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/LoopParallelMD/loop_nest_param_parallel.ll (original)
+++ polly/trunk/test/Isl/CodeGen/LoopParallelMD/loop_nest_param_parallel.ll Sun Nov 16 16:43:21 2014
@@ -1,4 +1,5 @@
-; RUN: opt %loadPolly -polly-codegen-isl -polly-ast-detect-parallel -S < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-codegen-isl -polly-ast-detect-parallel -polly-codegen-scev=false -S < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-codegen-isl -polly-ast-detect-parallel -polly-codegen-scev=true -S < %s | FileCheck %s
 ;
 ; Check that we mark multiple parallel loops correctly including the memory instructions.
 ;
@@ -8,7 +9,7 @@
 ; CHECK-DAG:  %polly.loop_cond[[CInner:[0-9]*]] = icmp sle i64 %polly.indvar{{[0-9]*}}, 510
 ; CHECK-DAG:  br i1 %polly.loop_cond[[CInner]], label %polly.loop_header{{[0-9]*}}, label %polly.loop_exit{{[0-9]*}}, !llvm.loop ![[IDInner:[0-9]*]]
 ;
-; CHECK-DAG: store i32 %p_tmp{{[0-9]*}}, i32* %p_arrayidx{{[0-9]*}}, {{[ ._!,a-zA-Z0-9]*}}, !llvm.mem.parallel_loop_access !4
+; CHECK-DAG: store i32 %{{[a-z_0-9]*}}, i32* %{{[a-z_0-9]*}}, {{[ ._!,a-zA-Z0-9]*}}, !llvm.mem.parallel_loop_access !4
 ;
 ; CHECK-DAG: ![[IDOuter]] = metadata !{metadata ![[IDOuter]]}
 ; CHECK-DAG: ![[IDInner]] = metadata !{metadata ![[IDInner]]}

Modified: polly/trunk/test/Isl/CodeGen/aliasing_different_base_and_access_type.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/aliasing_different_base_and_access_type.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/aliasing_different_base_and_access_type.ll (original)
+++ polly/trunk/test/Isl/CodeGen/aliasing_different_base_and_access_type.ll Sun Nov 16 16:43:21 2014
@@ -1,9 +1,9 @@
-; RUN: opt %loadPolly -S -polly-code-generator=isl -polly-codegen-isl < %s | FileCheck %s
+; RUN: opt %loadPolly -S -polly-code-generator=isl -polly-codegen-isl -polly-codegen-scev=false < %s | FileCheck %s
+; RUN: opt %loadPolly -S -polly-code-generator=isl -polly-codegen-isl -polly-codegen-scev=true < %s | FileCheck %s
 ;
 ; We have to cast %B to "short *" before we create RTCs.
 ;
-; CHECK:      entry:
-; CHECK-NEXT:   %polly.access.cast.B = bitcast i32* %B to i16*
+; CHECK:   %polly.access.cast.B = bitcast i32* %B to i16*
 ; CHECK-NEXT:   %polly.access.B = getelementptr i16* %polly.access.cast.B, i64 1024
 ;
 ; We should never access %B as an i32 pointer:

Modified: polly/trunk/test/Isl/CodeGen/annotated_alias_scopes.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/annotated_alias_scopes.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/annotated_alias_scopes.ll (original)
+++ polly/trunk/test/Isl/CodeGen/annotated_alias_scopes.ll Sun Nov 16 16:43:21 2014
@@ -1,13 +1,16 @@
-; RUN: opt %loadPolly -polly-code-generator=isl -polly-codegen-isl -S < %s | FileCheck %s --check-prefix=SCOPES
-; RUN: opt %loadPolly -polly-code-generator=isl -polly-codegen-isl -polly-annotate-alias-scopes=false -S < %s | FileCheck %s --check-prefix=NOSCOPES
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-codegen-isl -polly-codegen-scev=false -S < %s | FileCheck %s --check-prefix=SCOPES
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-codegen-isl -polly-codegen-scev=true -S < %s | FileCheck %s --check-prefix=SCOPES
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-codegen-isl -polly-codegen-scev=false -polly-annotate-alias-scopes=false -S < %s | FileCheck %s --check-prefix=NOSCOPES
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-codegen-isl -polly-codegen-scev=true -polly-annotate-alias-scopes=false -S < %s | FileCheck %s --check-prefix=NOSCOPES
 ;
 ; Check that we create alias scopes that indicate the accesses to A, B and C cannot alias in any way.
 ;
-; SCOPES:      %[[BIdx:[._a-zA-Z0-9]*]] = getelementptr inbounds i32* %B, i64 %polly.indvar
+; SCOPES-LABEL: polly.stmt.for.body:
+; SCOPES:      %[[BIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} i32* %B, i64 %polly.indvar
 ; SCOPES:      load i32* %[[BIdx]], align 4, !alias.scope ![[AliasScopeB:[0-9]*]], !noalias ![[NoAliasB:[0-9]*]]
-; SCOPES:      %[[CIdx:[._a-zA-Z0-9]*]] = getelementptr inbounds float* %C, i64 %polly.indvar
+; SCOPES:      %[[CIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} float* %C, i64 %polly.indvar
 ; SCOPES:      load float* %[[CIdx]], align 4, !alias.scope ![[AliasScopeC:[0-9]*]], !noalias ![[NoAliasC:[0-9]*]]
-; SCOPES:      %[[AIdx:[._a-zA-Z0-9]*]] = getelementptr inbounds i32* %A, i64 %polly.indvar
+; SCOPES:      %[[AIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} i32* %A, i64 %polly.indvar
 ; SCOPES:      store i32 %{{[._a-zA-Z0-9]*}}, i32* %[[AIdx]], align 4, !alias.scope ![[AliasScopeA:[0-9]*]], !noalias ![[NoAliasA:[0-9]*]]
 ;
 ; SCOPES:      ![[AliasScopeB]] = metadata !{metadata ![[AliasScopeB]], metadata !{{[0-9]*}}, metadata !"polly.alias.scope.B"}
@@ -26,15 +29,15 @@
 ; SCOPES-DAG:     metadata ![[AliasScopeC]]
 ; SCOPES:       }
 ;
-; NOSCOPES:    %[[BIdx:[._a-zA-Z0-9]*]] = getelementptr inbounds i32* %B, i64 %polly.indvar
+; NOSCOPES:    %[[BIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} i32* %B, i64 %polly.indvar
 ; NOSCOPES:    load i32* %[[BIdx]]
 ; NOSCOPES-NOT: alias.scope
 ; NOSCOPES-NOT: noalias
-; NOSCOPES:    %[[CIdx:[._a-zA-Z0-9]*]] = getelementptr inbounds float* %C, i64 %polly.indvar
+; NOSCOPES:    %[[CIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} float* %C, i64 %polly.indvar
 ; NOSCOPES:    load float* %[[CIdx]]
 ; NOSCOPES-NOT: alias.scope
 ; NOSCOPES-NOT: noalias
-; NOSCOPES:    %[[AIdx:[._a-zA-Z0-9]*]] = getelementptr inbounds i32* %A, i64 %polly.indvar
+; NOSCOPES:    %[[AIdx:[._a-zA-Z0-9]*]] = getelementptr{{.*}} i32* %A, i64 %polly.indvar
 ; NOSCOPES:    store i32 %{{[._a-zA-Z0-9]*}}, i32* %[[AIdx]]
 ; NOSCOPES-NOT: alias.scope
 ; NOSCOPES-NOT: noalias

Modified: polly/trunk/test/Isl/CodeGen/loop_with_condition_nested.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/loop_with_condition_nested.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/loop_with_condition_nested.ll (original)
+++ polly/trunk/test/Isl/CodeGen/loop_with_condition_nested.ll Sun Nov 16 16:43:21 2014
@@ -1,5 +1,6 @@
 ; RUN: opt %loadPolly -basicaa -polly-ast -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -basicaa -polly-codegen-isl -loops -analyze < %s | FileCheck %s -check-prefix=LOOPS
+; RUN: opt %loadPolly -basicaa -polly-codegen-isl -polly-codegen-scev=false -loops -analyze < %s | FileCheck %s -check-prefix=LOOPS
+; RUN: opt %loadPolly -basicaa -polly-codegen-isl -polly-codegen-scev=true -loops -analyze < %s | FileCheck %s -check-prefix=LOOPS
 
 
 ;#include <string.h>
@@ -215,4 +216,4 @@ declare void @llvm.memset.p0i8.i64(i8* n
 ; LOOPS: Printing analysis 'Natural Loop Information' for function 'loop_with_condition':
 ; LOOPS: Loop at depth 1 containing: %1<header><exiting>,%2,%4,%7,%6,%8,%9,%10<latch>
 ; LOOPS: Loop at depth 1 containing:
-; LOOPS: %polly.loop_header<header>,%polly.cond,%polly.merge,%polly.then,%polly.else,%polly.stmt.,%polly.cond3,%polly.merge4,%polly.then5,%polly.else6,%polly.stmt.7,%polly.stmt.8<latch><exiting>
+; LOOPS: %polly.loop_header<header>,%polly.cond,%polly.merge,%polly.then,%polly.else,%polly.stmt.,%polly.cond3,%polly.merge4,%polly.then5,%polly.else6,%polly.stmt.7,%polly.stmt{{.*}}<latch><exiting>

Modified: polly/trunk/test/Isl/CodeGen/simple_vec_assign_scalar.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/simple_vec_assign_scalar.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/simple_vec_assign_scalar.ll (original)
+++ polly/trunk/test/Isl/CodeGen/simple_vec_assign_scalar.ll Sun Nov 16 16:43:21 2014
@@ -1,4 +1,5 @@
-; RUN: opt %loadPolly -basicaa -polly-codegen-isl %vector-opt -dce -S < %s | FileCheck %s
+; RUN: opt %loadPolly -basicaa -polly-codegen-isl -polly-codegen-scev=false %vector-opt -dce -S < %s | FileCheck %s
+; RUN: opt %loadPolly -basicaa -polly-codegen-isl -polly-codegen-scev=true %vector-opt -dce -S < %s | FileCheck %s -check-prefix=CHECK-SCEV
 
 ;#define N 1024
 ;float A[N];
@@ -63,3 +64,6 @@ bb:
 ; CHECK: %vector_ptr7 = bitcast float* %p_scevgep.moved.to.bb3 to <4 x float>*
 ; CHECK: store <4 x float> %tmp4p_vec, <4 x float>* %vector_ptr7, align 8
 
+; CHECK-SCEV: %tmp_p_vec_full = load <4 x float>* bitcast ([1024 x float]* @A to <4 x float>*), align 8, !alias.scope !0, !noalias !2
+; CHECK-SCEV: %tmp4p_vec = fadd <4 x float> %tmp_p_vec_full, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
+; CHECK-SCEV: store <4 x float> %tmp4p_vec, <4 x float>* bitcast ([1024 x float]* @B to <4 x float>*), align 8, !alias.scope !3, !noalias !4

Modified: polly/trunk/test/Isl/CodeGen/simple_vec_cast.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/simple_vec_cast.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/simple_vec_cast.ll (original)
+++ polly/trunk/test/Isl/CodeGen/simple_vec_cast.ll Sun Nov 16 16:43:21 2014
@@ -1,4 +1,5 @@
-; RUN: opt %loadPolly -basicaa -polly-codegen-isl %vector-opt -dce -S < %s | FileCheck %s
+; RUN: opt %loadPolly -basicaa -polly-codegen-isl -polly-codegen-scev=false %vector-opt -dce -S < %s | FileCheck %s
+; RUN: opt %loadPolly -basicaa -polly-codegen-isl -polly-codegen-scev=true %vector-opt -dce -S < %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"
 
@@ -29,10 +30,15 @@ bb4:
   ret void
 }
 
-; CHECK: %p_scevgep.moved.to.bb2 = getelementptr [1024 x double]* @B, i64 0, i64 0
+; CHECK: [[PTR:%[a-zA-Z0-9_\.]+]] = getelementptr [1024 x double]* @B, i64 0, i64 0
 ; CHECK: %tmp_p_splat_one = load <1 x float>* bitcast ([1024 x float]* @A to <1 x float>*), align 8
 ; CHECK: %tmp_p_splat = shufflevector <1 x float> %tmp_p_splat_one, <1 x float> %tmp_p_splat_one, <4 x i32> zeroinitializer
 ; CHECK: %0 = fpext <4 x float> %tmp_p_splat to <4 x double>
-; CHECK: %vector_ptr = bitcast double* %p_scevgep.moved.to.bb2 to <4 x double>*
+; CHECK: %vector_ptr = bitcast double* [[PTR]] to <4 x double>*
 ; CHECK: store <4 x double> %0, <4 x double>* %vector_ptr, align 8
 
+; CHECK-SCEV: %tmp_p_splat_one = load <1 x float>* bitcast ([1024 x float]* @A to <1 x float>*), align 8, !alias.scope !0, !noalias !2
+; CHECK-SCEV: %tmp_p_splat = shufflevector <1 x float> %tmp_p_splat_one, <1 x float> %tmp_p_splat_one, <4 x i32> zeroinitializer
+; CHECK-SCEV: %0 = fpext <4 x float> %tmp_p_splat to <4 x double>
+; CHECK-SCEV: store <4 x double> %0, <4 x double>* bitcast ([1024 x double]* @B to <4 x double>*), align 8, !alias.scope !3, !noalias !4
+

Modified: polly/trunk/test/Isl/single_loop_param_less_equal.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/single_loop_param_less_equal.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Isl/single_loop_param_less_equal.ll (original)
+++ polly/trunk/test/Isl/single_loop_param_less_equal.ll Sun Nov 16 16:43:21 2014
@@ -1,5 +1,6 @@
 ; RUN: opt %loadPolly -polly-ast -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -polly-codegen-isl -S < %s | FileCheck %s -check-prefix=CODEGEN
+; RUN: opt %loadPolly -polly-codegen-isl -polly-codegen-scev=false -S < %s | FileCheck %s -check-prefix=CODEGEN
+; RUN: opt %loadPolly -polly-codegen-isl -polly-codegen-scev=true -S < %s | FileCheck %s -check-prefix=CODEGEN
 ; RUN: opt %loadPolly -polly-codegen-isl -loops -analyze < %s | FileCheck %s -check-prefix=LOOPS
 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-pc-linux-gnu"
@@ -49,8 +50,8 @@ ret:
 ; CODEGEN:   br label %polly.stmt.loop.body
 
 ; CODEGEN: polly.stmt.loop.body:
-; CODEGEN:   %p_scevgep.moved.to.loop.body = getelementptr [1024 x i32]* @A, i64 0, i64 %polly.indvar
-; CODEGEN:   store i32 1, i32* %p_scevgep.moved.to.loop.body
+; CODEGEN:   [[PTR:%[a-zA-Z0-9_\.]+]] = getelementptr [1024 x i32]* @A, i64 0, i64 %polly.indvar
+; CODEGEN:   store i32 1, i32* [[PTR]]
 ; CODEGEN:   %polly.indvar_next = add nsw i64 %polly.indvar, 1
 ; CODEGEN:   %polly.adjust_ub = sub i64 %n, 1
 ; CODEGEN:   %polly.loop_cond = icmp sle i64 %polly.indvar, %polly.adjust_ub

Modified: polly/trunk/test/Isl/single_loop_param_less_than.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/single_loop_param_less_than.ll?rev=222112&r1=222111&r2=222112&view=diff
==============================================================================
--- polly/trunk/test/Isl/single_loop_param_less_than.ll (original)
+++ polly/trunk/test/Isl/single_loop_param_less_than.ll Sun Nov 16 16:43:21 2014
@@ -1,5 +1,6 @@
 ; RUN: opt %loadPolly -polly-ast -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -polly-codegen-isl -S < %s | FileCheck %s -check-prefix=CODEGEN
+; RUN: opt %loadPolly -polly-codegen-isl -polly-codegen-scev=false -S < %s | FileCheck %s -check-prefix=CODEGEN
+; RUN: opt %loadPolly -polly-codegen-isl -polly-codegen-scev=true -S < %s | FileCheck %s -check-prefix=CODEGEN
 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-pc-linux-gnu"
 
@@ -47,12 +48,12 @@ ret:
 ; CODEGEN:   br label %polly.stmt.loop.body
 
 ; CODEGEN: polly.stmt.loop.body:
-; CODEGEN:   %p_scevgep.moved.to.loop.body = getelementptr [1024 x i32]* @A, i64 0, i64 %polly.indvar
-; CODEGEN:   store i32 1, i32* %p_scevgep.moved.to.loop.body
+; CODEGEN:   [[PTR:%[a-zA-Z0-9_\.]+]] =  getelementptr [1024 x i32]* @A, i64 0, i64 %polly.indvar
+; CODEGEN:   store i32 1, i32* [[PTR]]
 ; CODEGEN:   %polly.indvar_next = add nsw i64 %polly.indvar, 1
 ; CODEGEN:   %polly.adjust_ub = sub i64 %n, 1
 ; CODEGEN:   %polly.loop_cond = icmp slt i64 %polly.indvar, %polly.adjust_ub
 ; CODEGEN:   br i1 %polly.loop_cond, label %polly.loop_header, label %polly.loop_exit
 
 ; CODEGEN: polly.loop_preheader:
-; CODEGENL   br label %polly.loop_header
+; CODEGEN:   br label %polly.loop_header





More information about the llvm-commits mailing list