summaryrefslogtreecommitdiff
path: root/gcc/graphite-isl-ast-to-gimple.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-02 20:40:17 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-02 20:40:17 +0000
commitda7b620034cc2fdf772ce7d6aa9ae84f1eced3f7 (patch)
tree0679698553e27f050c59ee1e87f955b6ec39918c /gcc/graphite-isl-ast-to-gimple.c
parent73bd9dd479270b8eeca68a1da8211664331713d6 (diff)
downloadgcc-da7b620034cc2fdf772ce7d6aa9ae84f1eced3f7.tar.gz
fix PR68550: do not handle ISL loop peeled statements
In case ISL did some loop peeling, like this: S_8(0); for (int c1 = 1; c1 <= 5; c1 += 1) { S_8(c1); } S_8(6); we should not copy loop-phi nodes in S_8(0) or in S_8(6). PR tree-optimization/68550 * graphite-isl-ast-to-gimple.c (copy_loop_phi_nodes): Add dump. (copy_bb_and_scalar_dependences): Do not code generate loop peeled statements. * gfortran.dg/graphite/pr68550-1.f90: New. * gfortran.dg/graphite/pr68550-2.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231206 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-isl-ast-to-gimple.c')
-rw-r--r--gcc/graphite-isl-ast-to-gimple.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/graphite-isl-ast-to-gimple.c b/gcc/graphite-isl-ast-to-gimple.c
index bfce3169549..3139f302ff0 100644
--- a/gcc/graphite-isl-ast-to-gimple.c
+++ b/gcc/graphite-isl-ast-to-gimple.c
@@ -2096,6 +2096,12 @@ translate_isl_ast_to_gimple::copy_loop_phi_nodes (basic_block bb,
codegen_error = !copy_loop_phi_args (phi, ibp_old_bb, new_phi,
ibp_new_bb, true);
update_stmt (new_phi);
+
+ if (dump_file)
+ {
+ fprintf (dump_file, "[codegen] creating loop-phi node: ");
+ print_gimple_stmt (dump_file, new_phi, 0, 0);
+ }
}
return true;
@@ -2894,6 +2900,26 @@ translate_isl_ast_to_gimple::copy_bb_and_scalar_dependences (basic_block bb,
return NULL;
}
+ /* In case ISL did some loop peeling, like this:
+
+ S_8(0);
+ for (int c1 = 1; c1 <= 5; c1 += 1) {
+ S_8(c1);
+ }
+ S_8(6);
+
+ there should be no loop-phi nodes in S_8(0).
+
+ FIXME: We need to reason about dynamic instances of S_8, i.e., the
+ values of all scalar variables: for the moment we instantiate only
+ SCEV analyzable expressions on the iteration domain, and we need to
+ extend that to reductions that cannot be analyzed by SCEV. */
+ if (!bb_in_sese_p (phi_bb, region->if_region->true_region->region))
+ {
+ codegen_error = true;
+ return NULL;
+ }
+
if (dump_file)
fprintf (dump_file, "[codegen] bb_%d contains loop phi nodes.\n",
bb->index);