diff options
author | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2016-04-12 17:54:29 +0000 |
---|---|---|
committer | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2016-04-12 17:54:29 +0000 |
commit | fb72187fdd0912f66001d322f0a63a7b4df32e17 (patch) | |
tree | b7d84e578cfe252ae02f5c5b2c9d0770fbe59c6b | |
parent | b0c887762a898e72db6b0a768a7599b1fa36dc67 (diff) | |
download | bcm5719-llvm-fb72187fdd0912f66001d322f0a63a7b4df32e17.tar.gz bcm5719-llvm-fb72187fdd0912f66001d322f0a63a7b4df32e17.zip |
[FIX] Check the invalid context agains the context to rule out SCoPs
llvm-svn: 266096
-rw-r--r-- | polly/lib/Analysis/ScopInfo.cpp | 1 | ||||
-rw-r--r-- | polly/test/ScopInfo/infeasible_invalid_context.ll | 70 |
2 files changed, 71 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index a59e1523a4b..438e380a493 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -3425,6 +3425,7 @@ bool Scop::hasFeasibleRuntimeContext() const { auto *NegativeContext = getInvalidContext(); auto *DomainContext = isl_union_set_params(getDomains()); IsFeasible = !isl_set_is_subset(DomainContext, NegativeContext); + IsFeasible &= !isl_set_is_subset(Context, NegativeContext); isl_set_free(NegativeContext); isl_set_free(DomainContext); diff --git a/polly/test/ScopInfo/infeasible_invalid_context.ll b/polly/test/ScopInfo/infeasible_invalid_context.ll new file mode 100644 index 00000000000..9922bbc650c --- /dev/null +++ b/polly/test/ScopInfo/infeasible_invalid_context.ll @@ -0,0 +1,70 @@ +; RUN: opt %loadPolly -polly-detect -analyze < %s \ +; RUN: | FileCheck %s -check-prefix=DETECT + +; RUN: opt %loadPolly -polly-scops -analyze < %s \ +; RUN: | FileCheck %s -check-prefix=SCOPS + +; DETECT: Valid Region for Scop: if.end116 => for.inc216 +; SCOPS-NOT: Statements + +; Verify that we detect this scop, but that, due to an infeasible run-time +; check, we refuse to model it. +; +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" + +%struct.tnode.1.7.13.67.121.175.217.307.325.337.349.367.379.391.433.445.667.727.733.739 = type { i32, i32, %struct.tnode.1.7.13.67.121.175.217.307.325.337.349.367.379.391.433.445.667.727.733.739*, %struct.tnode.1.7.13.67.121.175.217.307.325.337.349.367.379.391.433.445.667.727.733.739*, %struct.tnode.1.7.13.67.121.175.217.307.325.337.349.367.379.391.433.445.667.727.733.739*, %struct.tnode.1.7.13.67.121.175.217.307.325.337.349.367.379.391.433.445.667.727.733.739*, %struct.tnode.1.7.13.67.121.175.217.307.325.337.349.367.379.391.433.445.667.727.733.739*, i32, i32, %struct.plist.0.6.12.66.120.174.216.306.324.336.348.366.378.390.432.444.666.726.732.738* } +%struct.plist.0.6.12.66.120.174.216.306.324.336.348.366.378.390.432.444.666.726.732.738 = type { i32, %struct.plist.0.6.12.66.120.174.216.306.324.336.348.366.378.390.432.444.666.726.732.738* } + +@vFixedEdgeRoot = external global %struct.tnode.1.7.13.67.121.175.217.307.325.337.349.367.379.391.433.445.667.727.733.739*, align 8 +@hEdgeRoot = external global %struct.tnode.1.7.13.67.121.175.217.307.325.337.349.367.379.391.433.445.667.727.733.739*, align 8 + +; Function Attrs: nounwind uwtable +define void @readgeo() #0 { +entry: + %vx = alloca i32, align 4 + br label %if.end64 + +if.end64: ; preds = %entry + br label %for.body73 + +for.body73: ; preds = %for.inc216, %if.end64 + %v.0101 = phi i32 [ 0, %for.inc216 ], [ 1, %if.end64 ] + br i1 undef, label %if.then93, label %if.else + +if.then93: ; preds = %for.body73 + br label %for.inc216 + +if.else: ; preds = %for.body73 + br i1 undef, label %if.then111, label %if.end116 + +if.then111: ; preds = %if.else + br label %if.end116 + +if.end116: ; preds = %if.then111, %if.else + %rippleCount.2 = phi i32 [ 1, %if.then111 ], [ undef, %if.else ] + %rem11790 = and i32 %v.0101, 1 + %cmp118 = icmp eq i32 %rem11790, 0 + br i1 %cmp118, label %if.then120, label %if.else154 + +if.then120: ; preds = %if.end116 + call void @tinsert() + br label %if.end193 + +if.else154: ; preds = %if.end116 + call void @tinsert() + br label %if.end193 + +if.end193: ; preds = %if.else154, %if.then120 + %0 = load i32, i32* %vx, align 4 + br label %for.inc216 + +for.inc216: ; preds = %if.end193, %if.then93 + %rippleCount.3 = phi i32 [ undef, %if.then93 ], [ %rippleCount.2, %if.end193 ] + %ux.2 = phi i32 [ undef, %if.then93 ], [ %0, %if.end193 ] + br i1 undef, label %for.body73, label %for.end218 + +for.end218: ; preds = %for.inc216 + unreachable +} + +declare void @tinsert() |