Skip to content

Commit e057859

Browse files
committed
[Polly] Check for ISL errors
1 parent f74e909 commit e057859

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

polly/lib/Transform/ScheduleOptimizer.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,9 +927,24 @@ static void runIslScheduleOptimizer(
927927
walkScheduleTreeForStatistics(Schedule, 2);
928928
}
929929

930+
// Check for why any computation could have failed
930931
if (MaxOpGuard.hasQuotaExceeded()) {
931932
POLLY_DEBUG(dbgs() << "Schedule optimizer calculation exceeds ISL quota\n");
932933
return;
934+
} else if (isl_ctx_last_error(Ctx) != isl_error_none) {
935+
const char *File = isl_ctx_last_error_file(Ctx);
936+
int Line = isl_ctx_last_error_line(Ctx);
937+
const char *Msg = isl_ctx_last_error_msg(Ctx);
938+
POLLY_DEBUG(
939+
dbgs()
940+
<< "ISL reported an error during the computation of a new schedule at "
941+
<< File << ":" << Line << ": " << Msg);
942+
isl_ctx_reset_error(Ctx);
943+
return;
944+
} else if (Schedule.is_null()) {
945+
POLLY_DEBUG(dbgs() << "Schedule optimizer did not compute a new schedule "
946+
"for unknown reasons\n");
947+
return;
933948
}
934949

935950
// Skip profitability check if user transformation(s) have been applied.

0 commit comments

Comments
 (0)