Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-03-28 12:34:40 +0300
committerTobias Grosser <tobias@grosser.es>2015-03-28 12:34:40 +0300
commit6794238c70c3c2d06f0ff57931a650232038952e (patch)
treef676c3258348c01c82389ed18ffdd9a601b8fe60 /polly/test
parent17778eb826b59e200891fdc2191e86898daf05ae (diff)
Code generate parameters and run-time checks after branching new code region
When creating parameters the SCEVexpander may introduce new induction variables, that possibly create scalar dependences in the original scop, before we code generate the scop. The resulting scalar dependences may then inhibit correct code generation of the scop. To prevent this, we first version the code without a run-time check and only then introduce new parameters and the run-time condition. The if-condition that guards the original scop from being modified by the SCEVexpander. This change causes some test case changes as the run-time conditions are now introduced in the split basic block rather than in the entry basic block. This fixes http://llvm.org/PR22069 Test case reduced by: Karthik Senthil llvm-svn: 233477
Diffstat (limited to 'polly/test')
-rw-r--r--polly/test/Isl/CodeGen/20150328-SCEVExpanderIntroducesNewIV.ll34
-rw-r--r--polly/test/Isl/CodeGen/aliasing_different_pointer_types.ll3
-rw-r--r--polly/test/Isl/CodeGen/multidim_2d_parametric_array_static_loop_bounds.ll2
-rw-r--r--polly/test/Isl/CodeGen/run-time-condition-with-scev-parameters.ll5
4 files changed, 38 insertions, 6 deletions
diff --git a/polly/test/Isl/CodeGen/20150328-SCEVExpanderIntroducesNewIV.ll b/polly/test/Isl/CodeGen/20150328-SCEVExpanderIntroducesNewIV.ll
new file mode 100644
index 000000000000..6118fb0baef5
--- /dev/null
+++ b/polly/test/Isl/CodeGen/20150328-SCEVExpanderIntroducesNewIV.ll
@@ -0,0 +1,34 @@
+; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-codegen-isl -S < %s | FileCheck %s
+
+; CHECK: polly
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+define void @foo() {
+entry:
+ br label %while.header
+
+while.cond.loopexit3:
+ br label %while.header
+
+while.header:
+ br label %switchbb
+
+switchbb:
+ switch i32 undef, label %while.header [
+ i32 1, label %for.body121
+ i32 2, label %unreachableA
+ i32 3, label %unreachableB
+ ]
+
+unreachableA:
+ unreachable
+
+for.body121:
+ %indvar = phi i32 [ 0, %switchbb ], [ %indvar.next, %for.body121 ]
+ %indvar.next = add nsw i32 %indvar, 1
+ br i1 false, label %for.body121, label %while.cond.loopexit3
+
+unreachableB:
+ unreachable
+}
diff --git a/polly/test/Isl/CodeGen/aliasing_different_pointer_types.ll b/polly/test/Isl/CodeGen/aliasing_different_pointer_types.ll
index 6ae6ac7855a8..7a1afa54fa7d 100644
--- a/polly/test/Isl/CodeGen/aliasing_different_pointer_types.ll
+++ b/polly/test/Isl/CodeGen/aliasing_different_pointer_types.ll
@@ -3,7 +3,7 @@
; Check that we cast the different pointer types correctly before we compare
; them in the RTC's. We use i8* as max pointer type.
;
-; CHECK: entry:
+; CHECK: polly.split_new_and_old:
; CHECK: %polly.access.B = getelementptr float*, float** %B, i64 1024
; CHECK: %polly.access.A = getelementptr double*, double** %A, i64 0
; CHECK: %[[paBb:[._a-zA-Z0-9]]] = bitcast float** %polly.access.B to i8*
@@ -16,7 +16,6 @@
; CHECK: %[[A1LeB2:[._a-zA-Z0-9]]] = icmp ule i8* %[[paA1b]], %[[paB2b]]
; CHECK: %[[le1OrLe2:[._a-zA-Z0-9]]] = or i1 %[[ALeB]], %[[A1LeB2]]
; CHECK: %[[orAndTrue:[._a-zA-Z0-9]]] = and i1 true, %[[le1OrLe2]]
-; CHECK: br label %polly.split_new_and_old
;
; void jd(double **A, float **B) {
; for (int i = 0; i < 1024; i++)
diff --git a/polly/test/Isl/CodeGen/multidim_2d_parametric_array_static_loop_bounds.ll b/polly/test/Isl/CodeGen/multidim_2d_parametric_array_static_loop_bounds.ll
index 764a1a08b43a..4136da3da953 100644
--- a/polly/test/Isl/CodeGen/multidim_2d_parametric_array_static_loop_bounds.ll
+++ b/polly/test/Isl/CodeGen/multidim_2d_parametric_array_static_loop_bounds.ll
@@ -11,8 +11,8 @@ target triple = "x86_64-unknown-linux-gnu"
; }
;
; CHECK: entry:
-; CHECK: %0 = icmp sge i64 %m, 150
; CHECK: polly.split_new_and_old:
+; CHECK: %0 = icmp sge i64 %m, 150
; CHECK: br i1 %0, label %polly.start, label %for.i
define void @foo(i64 %n, i64 %m, double* %A) {
diff --git a/polly/test/Isl/CodeGen/run-time-condition-with-scev-parameters.ll b/polly/test/Isl/CodeGen/run-time-condition-with-scev-parameters.ll
index 1528cf8e9813..28ebb7014570 100644
--- a/polly/test/Isl/CodeGen/run-time-condition-with-scev-parameters.ll
+++ b/polly/test/Isl/CodeGen/run-time-condition-with-scev-parameters.ll
@@ -1,9 +1,8 @@
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-codegen-isl -S -polly-delinearize < %s | FileCheck %s
-; CHECK: %1 = zext i32 %n to i64
-; CHECK-NEST: %2 = icmp sge i64 %1, 1
-; CHECK-NEST: br label %polly.split_new_and_old
; CHECK: polly.split_new_and_old:
+; CHECK-NEXT: %1 = zext i32 %n to i64
+; CHECK-NEXT: %2 = icmp sge i64 %1, 1
; CHECK-NEXT: br i1 %2, label %polly.start, label %for.body4