aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2013-06-06 02:49:02 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2013-06-06 02:49:02 +0000
commitf8c129801fb7ff74229051a4da0abd08d6d7aa07 (patch)
treeb45da4bc9a6229fa8f20af2322bf6c7e5a9ff1ca
parentd889a7bccef264bd2e714624c0abd1aaf5b27f02 (diff)
downloadllvm-f8c129801fb7ff74229051a4da0abd08d6d7aa07.zip
llvm-f8c129801fb7ff74229051a4da0abd08d6d7aa07.tar.gz
llvm-f8c129801fb7ff74229051a4da0abd08d6d7aa07.tar.bz2
Test that independent block pass does not transform induction variables
The original test case showed a problem with the independet blocks pass and we decided to XFAIL it for now. Unfortunately the failure is not detected if we build without asserts and the verification of the independent block pass is not run. This change tests now for the actual reason of the failure and should trigger even in a non asserts build. We did not yet solve the underlying bug, but this should at least make the test suite behavior consistent. Merged from: https://llvm.org/svn/llvm-project/polly/trunk@183025 llvm-svn: 183384
-rw-r--r--polly/test/IndependentBlocks/indvars.ll39
-rw-r--r--polly/test/Isl/CodeGen/scevcodegen-1.ll37
2 files changed, 39 insertions, 37 deletions
diff --git a/polly/test/IndependentBlocks/indvars.ll b/polly/test/IndependentBlocks/indvars.ll
new file mode 100644
index 0000000..aa096f4
--- /dev/null
+++ b/polly/test/IndependentBlocks/indvars.ll
@@ -0,0 +1,39 @@
+; RUN: opt %loadPolly -polly-independent -polly-codegen-scev %s | FileCheck %s
+; XFAIL: *
+;
+; Ensure that the independent block pass does not invalidate the induction
+; variable here.
+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"
+
+define void @main() nounwind {
+entry:
+ br label %for.i
+
+for.i:
+ %indvar.i = phi i64 [ 0, %entry ], [ %indvar.next.i, %for.i.backedge ]
+ br i1 true, label %for.j.preheader, label %for.j2
+
+for.j.preheader:
+ br label %for.j
+
+for.j:
+ %indvar.j = phi i64 [ %indvar.next.j, %for.j ], [ 0, %for.j.preheader ]
+ %indvar.next.j = add i64 %indvar.j, 1
+ %exitcond.j = icmp eq i64 %indvar.next.j, 0
+ br i1 %exitcond.j, label %for.j2, label %for.j
+
+for.j2:
+ fence seq_cst
+ br label %for.i.backedge
+
+for.i.backedge:
+ %indvar.next.i = add i64 %indvar.i, 1
+ %exitcond.i = icmp eq i64 %indvar.next.i, 2048
+ br i1 %exitcond.i, label %for.i, label %.end
+
+.end:
+ ret void
+}
+
+; CHECK: %indvar.j = phi i64 [ %indvar.next.j, %for.j ], [ 0, %for.j.preheader ]
diff --git a/polly/test/Isl/CodeGen/scevcodegen-1.ll b/polly/test/Isl/CodeGen/scevcodegen-1.ll
deleted file mode 100644
index d492d71..0000000
--- a/polly/test/Isl/CodeGen/scevcodegen-1.ll
+++ /dev/null
@@ -1,37 +0,0 @@
-; RUN: opt %loadPolly -polly-codegen-isl -polly-codegen-scev %s
-; -polly-independent causes: Cannot generate independent blocks
-;
-; XFAIL:*
-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"
-
-define void @main() nounwind {
-.split:
- br label %.start
-
-.start:
- %indvar15 = phi i64 [ 0, %.split ], [ %indvar.next16, %.loopexit ]
- %tmp25 = add i64 %indvar15, 1
- br i1 true, label %.preheader, label %.loop2
-
-.preheader:
- br label %.loop1
-
-.loop1:
- %indvar33 = phi i64 [ %indvar.next34, %.loop1 ], [ 0, %.preheader ]
- %indvar.next34 = add i64 %indvar33, 1
- %exitcond40 = icmp eq i64 %indvar.next34, 0
- br i1 %exitcond40, label %.loop2, label %.loop1
-
-.loop2:
- %exitcond26.old = icmp eq i64 undef, %tmp25
- br i1 false, label %.loopexit, label %.loop2
-
-.loopexit:
- %indvar.next16 = add i64 %indvar15, 1
- %exitcond53 = icmp eq i64 %indvar.next16, 2048
- br i1 %exitcond53, label %.start, label %.end
-
-.end:
- ret void
-}