summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2016-06-30 20:42:58 +0000
committerTobias Grosser <tobias@grosser.es>2016-06-30 20:42:58 +0000
commit3898a0468c63b66c0533cf313f16cb8b5edab5b9 (patch)
tree299de3aff06df6bae642cbca97f6f2d001e6c4f9
parentaf14993016fffbcdff50a855adf5f9f8f6edc339 (diff)
downloadbcm5719-llvm-3898a0468c63b66c0533cf313f16cb8b5edab5b9.tar.gz
bcm5719-llvm-3898a0468c63b66c0533cf313f16cb8b5edab5b9.zip
Propagate on-error status
This ensures that the error status set with -polly-on-isl-error-abort is maintained even after running DependenceInfo and ScheduleOptimizer. Both passes temporarily set the error status to CONTINUE as the dependence analysis uses a compute-out and the scheduler may not be able to derive a schedule. In both cases we want to not abort, but to handle the error gracefully. Before this commit, we always set the error reporting to ABORT after these passes. After this commit, we use the error reporting mode that was active earlier. This comes without a test case as this would require us to introduce (memory) errors which would trigger the isl errors. llvm-svn: 274272
-rw-r--r--polly/lib/Analysis/DependenceInfo.cpp4
-rw-r--r--polly/lib/Transform/ScheduleOptimizer.cpp3
2 files changed, 5 insertions, 2 deletions
diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp
index 1ebc7783bc1..fc8c98ed991 100644
--- a/polly/lib/Analysis/DependenceInfo.cpp
+++ b/polly/lib/Analysis/DependenceInfo.cpp
@@ -368,6 +368,8 @@ void Dependences::calculateDependences(Scop &S) {
long MaxOpsOld = isl_ctx_get_max_operations(IslCtx.get());
if (OptComputeOut)
isl_ctx_set_max_operations(IslCtx.get(), OptComputeOut);
+
+ auto OnErrorStatus = isl_options_get_on_error(IslCtx.get());
isl_options_set_on_error(IslCtx.get(), ISL_ON_ERROR_CONTINUE);
DEBUG(dbgs() << "Read: " << Read << "\n";
@@ -436,7 +438,7 @@ void Dependences::calculateDependences(Scop &S) {
RAW = WAW = WAR = nullptr;
isl_ctx_reset_error(IslCtx.get());
}
- isl_options_set_on_error(IslCtx.get(), ISL_ON_ERROR_ABORT);
+ isl_options_set_on_error(IslCtx.get(), OnErrorStatus);
isl_ctx_reset_operations(IslCtx.get());
isl_ctx_set_max_operations(IslCtx.get(), MaxOpsOld);
diff --git a/polly/lib/Transform/ScheduleOptimizer.cpp b/polly/lib/Transform/ScheduleOptimizer.cpp
index c96fa5f1d57..22ae87e3805 100644
--- a/polly/lib/Transform/ScheduleOptimizer.cpp
+++ b/polly/lib/Transform/ScheduleOptimizer.cpp
@@ -721,6 +721,7 @@ bool IslScheduleOptimizer::runOnScop(Scop &S) {
isl_options_set_schedule_max_coefficient(Ctx, MaxCoefficient);
isl_options_set_tile_scale_tile_loops(Ctx, 0);
+ auto OnErrorStatus = isl_options_get_on_error(Ctx);
isl_options_set_on_error(Ctx, ISL_ON_ERROR_CONTINUE);
isl_schedule_constraints *ScheduleConstraints;
@@ -733,7 +734,7 @@ bool IslScheduleOptimizer::runOnScop(Scop &S) {
isl_schedule_constraints_set_coincidence(ScheduleConstraints, Validity);
isl_schedule *Schedule;
Schedule = isl_schedule_constraints_compute_schedule(ScheduleConstraints);
- isl_options_set_on_error(Ctx, ISL_ON_ERROR_ABORT);
+ isl_options_set_on_error(Ctx, OnErrorStatus);
// In cases the scheduler is not able to optimize the code, we just do not
// touch the schedule.
OpenPOWER on IntegriCloud