diff options
author | Richard Biener <rguenther@suse.de> | 2017-09-21 12:02:58 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-09-21 12:02:58 +0000 |
commit | 73d1c65029e56f95bfb3d83e2bb9a403f3f69de4 (patch) | |
tree | 950b14ee9c3396c1eee5799efd04a0c6584059fb /gcc | |
parent | a708f4b67038ff12800a3874722374a66624e2a0 (diff) | |
download | gcc-73d1c65029e56f95bfb3d83e2bb9a403f3f69de4.zip gcc-73d1c65029e56f95bfb3d83e2bb9a403f3f69de4.tar.gz gcc-73d1c65029e56f95bfb3d83e2bb9a403f3f69de4.tar.bz2 |
graphite-isl-ast-to-gimple.c (graphite_regenerate_ast_isl): Restore valid IL after code generation errors.
2017-09-21 Richard Biener <rguenther@suse.de>
* graphite-isl-ast-to-gimple.c (graphite_regenerate_ast_isl):
Restore valid IL after code generation errors.
* graphite.c (graphite_transform_loops): Diagnose code
generation issues as MSG_MISSED_OPTIMIZATION and continue
with processing SCOPs.
From-SVN: r253060
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/graphite-isl-ast-to-gimple.c | 20 | ||||
-rw-r--r-- | gcc/graphite.c | 17 |
3 files changed, 36 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8a534f6..08d5620 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2017-09-21 Richard Biener <rguenther@suse.de> + + * graphite-isl-ast-to-gimple.c (graphite_regenerate_ast_isl): + Restore valid IL after code generation errors. + * graphite.c (graphite_transform_loops): Diagnose code + generation issues as MSG_MISSED_OPTIMIZATION and continue + with processing SCOPs. + 2017-09-21 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c index ccf0c21..87a1b06 100644 --- a/gcc/graphite-isl-ast-to-gimple.c +++ b/gcc/graphite-isl-ast-to-gimple.c @@ -2997,6 +2997,26 @@ graphite_regenerate_ast_isl (scop_p scop) } } + if (t.codegen_error_p ()) + { + /* We registered new names, scrap that. */ + if (need_ssa_update_p (cfun)) + delete_update_ssa (); + /* Remove the unreachable region. */ + remove_edge_and_dominated_blocks (if_region->true_region->region.entry); + basic_block ifb = if_region->false_region->region.entry->src; + gimple_stmt_iterator gsi = gsi_last_bb (ifb); + gsi_remove (&gsi, true); + if_region->false_region->region.entry->flags &= ~EDGE_FALSE_VALUE; + if_region->false_region->region.entry->flags |= EDGE_FALLTHRU; + /* remove_edge_and_dominated_blocks marks loops for removal but + doesn't actually remove them (fix that...). */ + loop_p loop; + FOR_EACH_LOOP (loop, LI_FROM_INNERMOST) + if (! loop->header) + delete_loop (loop); + } + free (if_region->true_region); free (if_region->region); free (if_region); diff --git a/gcc/graphite.c b/gcc/graphite.c index af336da..d8777f0 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -337,17 +337,16 @@ graphite_transform_loops (void) if (!apply_poly_transforms (scop)) continue; + location_t loc = find_loop_location + (scops[i]->scop_info->region.entry->dest->loop_father); + need_cfg_cleanup_p = true; - /* When code generation is not successful, do not continue - generating code for the next scops: the IR has to be cleaned up - and could be in an inconsistent state. */ if (!graphite_regenerate_ast_isl (scop)) - break; - - location_t loc = find_loop_location - (scop->scop_info->region.entry->dest->loop_father); - dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, - "loop nest optimized\n"); + dump_printf_loc (MSG_MISSED_OPTIMIZATION, loc, + "loop nest not optimized, code generation error\n"); + else + dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, + "loop nest optimized\n"); } free_scops (scops); |