[polly] r274272 - Propagate on-error status

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 30 13:42:59 PDT 2016


Author: grosser
Date: Thu Jun 30 15:42:58 2016
New Revision: 274272

URL: http://llvm.org/viewvc/llvm-project?rev=274272&view=rev
Log:
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.

Modified:
    polly/trunk/lib/Analysis/DependenceInfo.cpp
    polly/trunk/lib/Transform/ScheduleOptimizer.cpp

Modified: polly/trunk/lib/Analysis/DependenceInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/DependenceInfo.cpp?rev=274272&r1=274271&r2=274272&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/DependenceInfo.cpp (original)
+++ polly/trunk/lib/Analysis/DependenceInfo.cpp Thu Jun 30 15:42:58 2016
@@ -368,6 +368,8 @@ void Dependences::calculateDependences(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(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);
 

Modified: polly/trunk/lib/Transform/ScheduleOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ScheduleOptimizer.cpp?rev=274272&r1=274271&r2=274272&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ScheduleOptimizer.cpp (original)
+++ polly/trunk/lib/Transform/ScheduleOptimizer.cpp Thu Jun 30 15:42:58 2016
@@ -721,6 +721,7 @@ bool IslScheduleOptimizer::runOnScop(Sco
   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(Sco
       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.




More information about the llvm-commits mailing list