summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp6
-rw-r--r--polly/test/ScopInfo/isl_trip_count_02.ll4
2 files changed, 8 insertions, 2 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index d6fa4c96d93..199f92bafdf 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -903,9 +903,13 @@ void ScopStmt::addLoopBoundsToDomain(TempScop &tempScop) {
isl_set *UpperBoundSet = isl_pw_aff_le_set(IV, UpperBound);
Domain = isl_set_intersect(Domain, UpperBoundSet);
} else {
- // If SCEV cannot provide a loop trip count we compute it with ISL.
+ // If SCEV cannot provide a loop trip count, we compute it with ISL. If
+ // the domain remains unbounded, make the assumed context infeasible
+ // as code generation currently does not expect unbounded loops.
addLoopTripCountToDomain(L);
isl_pw_aff_free(IV);
+ if (!isl_set_dim_has_upper_bound(Domain, isl_dim_set, i))
+ Parent.addAssumption(isl_set_empty(Parent.getParamSpace()));
}
}
diff --git a/polly/test/ScopInfo/isl_trip_count_02.ll b/polly/test/ScopInfo/isl_trip_count_02.ll
index 02f5a9f7658..a720cf88f40 100644
--- a/polly/test/ScopInfo/isl_trip_count_02.ll
+++ b/polly/test/ScopInfo/isl_trip_count_02.ll
@@ -1,6 +1,8 @@
; RUN: opt %loadPolly -polly-detect-unprofitable -polly-allow-non-scev-backedge-taken-count -polly-scops -analyze < %s | FileCheck %s
;
-; CHECK: [M, N] -> { Stmt_for_body[i0] : i0 >= 0 and N <= -1 + M };
+; TODO: We do not allow unbounded loops at the moment.
+;
+; CHECK-NOT: Stmt_for_body
;
; void f(int *A, int N, int M) {
; for (int i = M; i > N; i++)
OpenPOWER on IntegriCloud