summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp3
-rw-r--r--polly/test/ScopInfo/phi_scalar_simple_1.ll9
2 files changed, 10 insertions, 2 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 7a6c92d52a7..aac15c9e13f 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -1927,8 +1927,7 @@ void Scop::addLoopBoundsToHeaderDomain(Loop *L, LoopInfo &LI) {
isl_set *UnboundedCtx = isl_set_params(Parts.first);
isl_set *BoundedCtx = isl_set_complement(UnboundedCtx);
- // TODO: Use the unbounded part to build runtime assumptions.
- isl_set_free(BoundedCtx);
+ addAssumption(BoundedCtx);
}
void Scop::buildAliasChecks(AliasAnalysis &AA) {
diff --git a/polly/test/ScopInfo/phi_scalar_simple_1.ll b/polly/test/ScopInfo/phi_scalar_simple_1.ll
index ed7ed125d90..cba9010fb3b 100644
--- a/polly/test/ScopInfo/phi_scalar_simple_1.ll
+++ b/polly/test/ScopInfo/phi_scalar_simple_1.ll
@@ -1,5 +1,14 @@
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-scops -analyze < %s | FileCheck %s
;
+; The assumed context is tricky here as the equality test for the inner loop
+; allows an "unbounded" loop trip count. We assume that does not happen, thus
+; if N <= 1 the outer loop is not executed and we are done, if N >= 3 the
+; equality test in the inner exit condition will trigger at some point and,
+; finally, if N == 2 we would have an unbounded inner loop.
+;
+; CHECK: Assumed Context:
+; CHECK-NEXT: [N] -> { : N >= 3 or N <= 1 }
+;
; int jd(int *restrict A, int x, int N) {
; for (int i = 1; i < N; i++)
; for (int j = 3; j < N; j++)
OpenPOWER on IntegriCloud