summaryrefslogtreecommitdiffstats
path: root/polly/test/ScopInfo
diff options
context:
space:
mode:
Diffstat (limited to 'polly/test/ScopInfo')
-rw-r--r--polly/test/ScopInfo/simple_loop_unsigned.ll32
-rw-r--r--polly/test/ScopInfo/simple_loop_unsigned_2.ll25
-rw-r--r--polly/test/ScopInfo/simple_loop_unsigned_3.ll26
-rw-r--r--polly/test/ScopInfo/unsigned-condition.ll27
4 files changed, 95 insertions, 15 deletions
diff --git a/polly/test/ScopInfo/simple_loop_unsigned.ll b/polly/test/ScopInfo/simple_loop_unsigned.ll
new file mode 100644
index 00000000000..0f451f2cc2b
--- /dev/null
+++ b/polly/test/ScopInfo/simple_loop_unsigned.ll
@@ -0,0 +1,32 @@
+; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
+
+; void f(int a[], unsigned N) {
+; unsigned i;
+; do {
+; a[i] = i;
+; } while (++i <= N);
+; }
+
+; CHECK: Assumed Context:
+; CHECK-NEXT: [N] -> { : N >= 0 }
+;
+; CHECK: Domain :=
+; CHECK-NEXT: [N] -> { Stmt_bb[i0] : 0 <= i0 < N; Stmt_bb[0] : N <= 0 };
+
+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"
+
+define void @f(i64* nocapture %a, i64 %N) nounwind {
+entry:
+ br label %bb
+
+bb: ; preds = %bb, %entry
+ %i = phi i64 [ 0, %entry ], [ %i.inc, %bb ]
+ %scevgep = getelementptr inbounds i64, i64* %a, i64 %i
+ store i64 %i, i64* %scevgep
+ %i.inc = add nsw i64 %i, 1
+ %exitcond = icmp uge i64 %i.inc, %N
+ br i1 %exitcond, label %return, label %bb
+
+return: ; preds = %bb, %entry
+ ret void
+}
diff --git a/polly/test/ScopInfo/simple_loop_unsigned_2.ll b/polly/test/ScopInfo/simple_loop_unsigned_2.ll
new file mode 100644
index 00000000000..744bf2771ad
--- /dev/null
+++ b/polly/test/ScopInfo/simple_loop_unsigned_2.ll
@@ -0,0 +1,25 @@
+; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
+
+; CHECK: Assumed Context:
+; CHECK-NEXT: [N] -> { : N > 0 }
+;
+; CHECK: Domain :=
+; CHECK-NEXT: [N] -> { Stmt_bb[i0] : 0 <= i0 < N; Stmt_bb[0] : N <= 0 };
+;
+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"
+
+define void @f(i64* nocapture %a, i64 %N) nounwind {
+entry:
+ br label %bb
+
+bb: ; preds = %bb, %entry
+ %i = phi i64 [ %N, %entry ], [ %i.dec, %bb ]
+ %scevgep = getelementptr inbounds i64, i64* %a, i64 %i
+ store i64 %i, i64* %scevgep
+ %i.dec = add nsw i64 %i, -1
+ %exitcond = icmp ugt i64 %i.dec, 0
+ br i1 %exitcond, label %bb, label %return
+
+return: ; preds = %bb, %entry
+ ret void
+}
diff --git a/polly/test/ScopInfo/simple_loop_unsigned_3.ll b/polly/test/ScopInfo/simple_loop_unsigned_3.ll
new file mode 100644
index 00000000000..d495b68b466
--- /dev/null
+++ b/polly/test/ScopInfo/simple_loop_unsigned_3.ll
@@ -0,0 +1,26 @@
+; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
+
+; CHECK: Assumed Context:
+; CHECK-NEXT: [N] -> { : }
+;
+; CHECK: Domain :=
+; CHECK-NEXT: [N] -> { Stmt_bb[i0] : 0 < i0 <= 1000 - N; Stmt_bb[0] };
+
+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"
+
+define void @f(i64* nocapture %a, i64 %N) nounwind {
+entry:
+ br label %bb
+
+bb: ; preds = %bb, %entry
+ %i = phi i64 [ 1000, %entry ], [ %i.dec, %bb ]
+ %scevgep = getelementptr inbounds i64, i64* %a, i64 %i
+ store i64 %i, i64* %scevgep
+ %i.dec = add nsw i64 %i, -1
+ %sub = sub nsw i64 %N, %i
+ %exitcond = icmp ult i64 %sub, 0
+ br i1 %exitcond, label %bb, label %return
+
+return: ; preds = %bb, %entry
+ ret void
+}
diff --git a/polly/test/ScopInfo/unsigned-condition.ll b/polly/test/ScopInfo/unsigned-condition.ll
index 69c815e8cd2..57c1039a495 100644
--- a/polly/test/ScopInfo/unsigned-condition.ll
+++ b/polly/test/ScopInfo/unsigned-condition.ll
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -polly-scops -analyze -polly-allow-unsigned < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
; void f(int a[], int N, unsigned P) {
; int i;
@@ -7,6 +7,17 @@
; a[i] = i;
; }
+; The assumed context is the universe because the "signed-unsigned assumption"
+; [P, N] -> { : N > 0 and P >= 0 }
+; is implied by the execution domain. Thus if something is executed this
+; assumption will hold.
+
+; CHECK: Assumed Context:
+; CHECK-NEXT: [P, N] -> { : }
+;
+; CHECK: Domain :=
+; CHECK-NEXT: [P, N] -> { Stmt_store[i0] : P >= 42 and 0 <= i0 < N };
+
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"
define void @f(i64* nocapture %a, i64 %N, i64 %P) nounwind {
@@ -31,17 +42,3 @@ bb.backedge:
return:
ret void
}
-
-
-; CHECK: Assumed Context:
-; CHECK-NEXT: [P, N] -> { : }
-;
-; CHECK: Statements {
-; CHECK-NEXT: Stmt_store
-; CHECK-NEXT: Domain :=
-; CHECK-NEXT: [P, N] -> { Stmt_store[i0] : P >= 42 and 0 <= i0 < N };
-; CHECK-NEXT: Schedule :=
-; CHECK-NEXT: [P, N] -> { Stmt_store[i0] -> [i0] };
-; CHECK-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
-; CHECK-NEXT: [P, N] -> { Stmt_store[i0] -> MemRef_a[i0] };
-; CHECK-NEXT: }
OpenPOWER on IntegriCloud