summaryrefslogtreecommitdiffstats
path: root/polly/test/ScopInfo/variant_load_empty_domain.ll
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2015-10-04 15:00:05 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2015-10-04 15:00:05 +0000
commitf17a78ef63eb18ff975e85b10bdfd3e5d262713d (patch)
treec669c12e43d34180e72cd7df63fae9a2451301f5 /polly/test/ScopInfo/variant_load_empty_domain.ll
parent634909c2c93defc2fa941e141e44de689073647f (diff)
downloadbcm5719-llvm-f17a78ef63eb18ff975e85b10bdfd3e5d262713d.tar.gz
bcm5719-llvm-f17a78ef63eb18ff975e85b10bdfd3e5d262713d.zip
Remove non-executed statements during SCoP simplifcation
A statement with an empty domain complicates the invariant load hoisting and does not help any subsequent analysis or transformation. In fact it might introduce parameter dimensions or increase the schedule dimensionality. To this end, we remove statements with an empty domain early in the SCoP simplification. llvm-svn: 249276
Diffstat (limited to 'polly/test/ScopInfo/variant_load_empty_domain.ll')
-rw-r--r--polly/test/ScopInfo/variant_load_empty_domain.ll52
1 files changed, 52 insertions, 0 deletions
diff --git a/polly/test/ScopInfo/variant_load_empty_domain.ll b/polly/test/ScopInfo/variant_load_empty_domain.ll
new file mode 100644
index 00000000000..d42d24818f3
--- /dev/null
+++ b/polly/test/ScopInfo/variant_load_empty_domain.ll
@@ -0,0 +1,52 @@
+; RUN: opt %loadPolly -polly-scops -polly-detect-unprofitable -analyze < %s | FileCheck %s
+;
+; CHECK: Invariant Accesses: {
+; CHECK-NEXT: }
+;
+; CHECK-NOT: Stmt_if_then
+;
+;
+; void f(int *A) {
+; for (int i = 1; i < 10; i++) {
+; A[i]++;
+; if (i > 10)
+; A[i] += A[0];
+; }
+; }
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @f(i32* %A) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 10
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
+ %tmp = load i32, i32* %arrayidx, align 4
+ %inc = add nsw i32 %tmp, 1
+ store i32 %inc, i32* %arrayidx, align 4
+ br i1 false, label %if.then, label %if.end
+
+if.then: ; preds = %for.body
+ %tmp1 = load i32, i32* %A, align 4
+ %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
+ %tmp2 = load i32, i32* %arrayidx4, align 4
+ %add = add nsw i32 %tmp2, %tmp1
+ store i32 %add, i32* %arrayidx4, align 4
+ br label %if.end
+
+if.end: ; preds = %if.then, %for.body
+ br label %for.inc
+
+for.inc: ; preds = %if.end
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
OpenPOWER on IntegriCloud