forked from OSchip/llvm-project
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
This commit is contained in:
parent
af14993016
commit
3898a0468c
|
@ -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);
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue