aboutsummaryrefslogtreecommitdiff
path: root/polly/lib/ScheduleOptimizer.cpp
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2014-02-21 20:51:36 +0000
committerTobias Grosser <tobias@grosser.es>2014-02-21 20:51:36 +0000
commit34f06135628a4098b5112e1309cf9fa4073cd9cf (patch)
tree27e3319fe702b5aba1fc07378f9118cb0d54984f /polly/lib/ScheduleOptimizer.cpp
parent40066cce0000efafd95c49f5032a4a703d80d57a (diff)
downloadllvm-34f06135628a4098b5112e1309cf9fa4073cd9cf.zip
llvm-34f06135628a4098b5112e1309cf9fa4073cd9cf.tar.gz
llvm-34f06135628a4098b5112e1309cf9fa4073cd9cf.tar.bz2
Optimizer: Do not accidentally set schedule to NULL
In case the domain of a statement is empty, the schedule optimizer set by accident the schedule to a NULL pointer. This is incorrect. Instead, we set it to an empty isl_map with zero schedule dimensions. We already checked for this in our test cases, but unfortunately the test cases did not fail as expected. The assert we add in this commit now ensures that the test cases fail properly in case we regress on this again. llvm-svn: 201886
Diffstat (limited to 'polly/lib/ScheduleOptimizer.cpp')
-rw-r--r--polly/lib/ScheduleOptimizer.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/polly/lib/ScheduleOptimizer.cpp b/polly/lib/ScheduleOptimizer.cpp
index 14fea7c..9e4e4ce 100644
--- a/polly/lib/ScheduleOptimizer.cpp
+++ b/polly/lib/ScheduleOptimizer.cpp
@@ -544,15 +544,7 @@ bool IslScheduleOptimizer::runOnScop(Scop &S) {
StmtBand = isl_union_map_intersect_domain(isl_union_map_copy(ScheduleMap),
isl_union_set_from_set(Domain));
if (isl_union_map_is_empty(StmtBand)) {
- // Statements with an empty iteration domain may not have a schedule
- // assigned by the isl schedule optimizer. As Polly expects each statement
- // to have a schedule, we keep the old schedule for this statement. As
- // there are zero iterations to execute, the content of the schedule does
- // not matter.
- //
- // TODO: Consider removing such statements when constructing the scop.
- StmtSchedule = Stmt->getScattering();
- StmtSchedule = isl_map_set_tuple_id(StmtSchedule, isl_dim_out, NULL);
+ StmtSchedule = isl_map_from_domain(isl_set_empty(Stmt->getDomainSpace()));
isl_union_map_free(StmtBand);
} else {
assert(isl_union_map_n_map(StmtBand) == 1);