diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-25 09:48:31 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-09-25 09:48:31 +0000 |
commit | a1db6b7f7a27f1b5e97d5bb64cead3ee8ed29e7d (patch) | |
tree | 03aab835117a5662f821e9bed7cfa704fbe66ed6 /gcc | |
parent | 0d6c88477501919bcdec8f486b9ca1bb5fe44688 (diff) | |
download | gcc-a1db6b7f7a27f1b5e97d5bb64cead3ee8ed29e7d.tar.gz |
2017-09-25 Richard Biener <rguenther@suse.de>
* graphite-optimize-isl.c (optimize_isl): Fail and dump if
ISL errors other than isl_error_quota happen. Dump if the
schedule is the same.
* graphite-sese-to-poly.c (build_poly_scop): Fail on ISL
errors instead of aborting inside ISL.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253142 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/graphite-optimize-isl.c | 28 | ||||
-rw-r--r-- | gcc/graphite-sese-to-poly.c | 13 |
3 files changed, 37 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aae06a1e87c..4967e988a63 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-09-25 Richard Biener <rguenther@suse.de> + + * graphite-optimize-isl.c (optimize_isl): Fail and dump if + ISL errors other than isl_error_quota happen. Dump if the + schedule is the same. + * graphite-sese-to-poly.c (build_poly_scop): Fail on ISL + errors instead of aborting inside ISL. + 2017-09-25 Iain Sandoe <iain@codesourcery.com> PR target/80556 diff --git a/gcc/graphite-optimize-isl.c b/gcc/graphite-optimize-isl.c index ef41e55e173..dbf10ead1ca 100644 --- a/gcc/graphite-optimize-isl.c +++ b/gcc/graphite-optimize-isl.c @@ -111,6 +111,7 @@ scop_get_domains (scop_p scop) static bool optimize_isl (scop_p scop) { + int old_err = isl_options_get_on_error (scop->isl_context); int old_max_operations = isl_ctx_get_max_operations (scop->isl_context); int max_operations = PARAM_VALUE (PARAM_MAX_ISL_OPERATIONS); if (max_operations) @@ -150,19 +151,23 @@ optimize_isl (scop_p scop) scop->transformed_schedule = isl_schedule_map_schedule_node_bottom_up (scop->transformed_schedule, get_schedule_for_node_st, NULL); - isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_ABORT); + isl_options_set_on_error (scop->isl_context, old_err); isl_ctx_reset_operations (scop->isl_context); isl_ctx_set_max_operations (scop->isl_context, old_max_operations); if (!scop->transformed_schedule - || isl_ctx_last_error (scop->isl_context) == isl_error_quota) + || isl_ctx_last_error (scop->isl_context) != isl_error_none) { location_t loc = find_loop_location (scop->scop_info->region.entry->dest->loop_father); - dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc, - "loop nest not optimized, optimization timed out " - "after %d operations [--param max-isl-operations]\n", - max_operations); + if (isl_ctx_last_error (scop->isl_context) == isl_error_quota) + dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc, + "loop nest not optimized, optimization timed out " + "after %d operations [--param max-isl-operations]\n", + max_operations); + else + dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc, + "loop nest not optimized, ISL signalled an error\n"); return false; } @@ -175,12 +180,13 @@ optimize_isl (scop_p scop) if (same_schedule) { + location_t loc = find_loop_location + (scop->scop_info->region.entry->dest->loop_father); + dump_printf_loc (MSG_NOTE, loc, + "loop nest not optimized, optimized schedule is " + "identical to original schedule\n"); if (dump_file) - { - fprintf (dump_file, "[scheduler] isl optimized schedule is " - "identical to the original schedule.\n"); - print_schedule_ast (dump_file, scop->original_schedule, scop); - } + print_schedule_ast (dump_file, scop->original_schedule, scop); isl_schedule_free (scop->transformed_schedule); scop->transformed_schedule = isl_schedule_copy (scop->original_schedule); return false; diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c index 5d6ba67bbce..fc8cd89239c 100644 --- a/gcc/graphite-sese-to-poly.c +++ b/gcc/graphite-sese-to-poly.c @@ -1244,6 +1244,9 @@ build_original_schedule (scop_p scop) bool build_poly_scop (scop_p scop) { + int old_err = isl_options_get_on_error (scop->isl_context); + isl_options_set_on_error (scop->isl_context, ISL_ON_ERROR_CONTINUE); + build_scop_context (scop); unsigned i = 0; @@ -1253,6 +1256,14 @@ build_poly_scop (scop_p scop) build_scop_drs (scop); build_original_schedule (scop); - return true; + + enum isl_error err = isl_ctx_last_error (scop->isl_context); + isl_ctx_reset_error (scop->isl_context); + isl_options_set_on_error (scop->isl_context, old_err); + if (err != isl_error_none) + dump_printf (MSG_MISSED_OPTIMIZATION, + "ISL error while building poly scop\n"); + + return err == isl_error_none; } #endif /* HAVE_isl */ |