diff --git a/polly/lib/Transform/ScheduleOptimizer.cpp b/polly/lib/Transform/ScheduleOptimizer.cpp index 0888ebd7a9362..cb08397c201f2 100644 --- a/polly/lib/Transform/ScheduleOptimizer.cpp +++ b/polly/lib/Transform/ScheduleOptimizer.cpp @@ -927,9 +927,24 @@ static void runIslScheduleOptimizer( walkScheduleTreeForStatistics(Schedule, 2); } + // Check for why any computation could have failed if (MaxOpGuard.hasQuotaExceeded()) { POLLY_DEBUG(dbgs() << "Schedule optimizer calculation exceeds ISL quota\n"); return; + } else if (isl_ctx_last_error(Ctx) != isl_error_none) { + const char *File = isl_ctx_last_error_file(Ctx); + int Line = isl_ctx_last_error_line(Ctx); + const char *Msg = isl_ctx_last_error_msg(Ctx); + POLLY_DEBUG( + dbgs() + << "ISL reported an error during the computation of a new schedule at " + << File << ":" << Line << ": " << Msg); + isl_ctx_reset_error(Ctx); + return; + } else if (Schedule.is_null()) { + POLLY_DEBUG(dbgs() << "Schedule optimizer did not compute a new schedule " + "for unknown reasons\n"); + return; } // Skip profitability check if user transformation(s) have been applied.