summaryrefslogtreecommitdiff
path: root/gcc/graphite-poly.c
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-12 14:23:01 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-12 14:23:01 +0000
commita741358d2ef4498e2c72c96fe5a45a333478489f (patch)
treeea44f243fde73312dfa71681281a6fb0189704fc /gcc/graphite-poly.c
parent95b2e0d363a0f078a9f37c6f2f33f620eee2aa99 (diff)
downloadgcc-a741358d2ef4498e2c72c96fe5a45a333478489f.tar.gz
Restore original scattering when the transform is not legal.
2009-08-05 Sebastian Pop <sebastian.pop@amd.com> * graphite-blocking.c (scop_do_strip_mine): Call store_scattering. Early return without analyzing the data dependences if no transform has been done. Call restore_scattering if the transform is not legal. (graphite-interchange.c): Same. * graphite-poly.c (print_scattering_function): Test for PBB_TRANSFORMED. (graphite_read_transforms): Initialize PBB_TRANSFORMED. (apply_poly_transforms): Do not gcc_assert that the transform is legal. (new_poly_bb): Initialize PBB_TRANSFORMED, PBB_SAVED, and PBB_ORIGINAL. Do not initialize PBB_NB_SCATTERING_TRANSFORM, PBB_NB_LOCAL_VARIABLES, PBB_TRANSFORMED_SCATTERING, and PBB_ORIGINAL_SCATTERING. (free_poly_dr): Free PBB_TRANSFORMED, PBB_SAVED, and PBB_ORIGINAL. * graphite-poly.h (struct poly_scattering): New. (struct poly_bb): Add original, transformed, and saved fields. Remove transformed_scattering, original_scattering, nb_local_variables, and nb_scattering_transform fields. (PBB_ORIGINAL, PBB_TRANSFORMED, PBB_SAVED): New. (poly_scattering_new): New. (poly_scattering_free): New. (poly_scattering_copy): New. (store_scattering_pbb): New. (store_scattering): New. (restore_scattering_pbb): New. (restore_scattering): New. * graphite-sese-to-poly.c (build_pbb_scattering_polyhedrons): Initialize PBB_TRANSFORMED and PBB_ORIGINAL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150686 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-poly.c')
-rw-r--r--gcc/graphite-poly.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/gcc/graphite-poly.c b/gcc/graphite-poly.c
index 6d24cbd52f1..d06da75b811 100644
--- a/gcc/graphite-poly.c
+++ b/gcc/graphite-poly.c
@@ -142,7 +142,7 @@ print_scattering_function (FILE *file, poly_bb_p pbb)
{
graphite_dim_t i;
- if (!PBB_TRANSFORMED_SCATTERING (pbb))
+ if (!PBB_TRANSFORMED (pbb))
return;
fprintf (file, "scattering bb_%d (\n", GBB_BB (PBB_BLACK_BOX (pbb))->index);
@@ -255,16 +255,10 @@ apply_poly_transforms (scop_p scop)
gcc_unreachable (); /* Not yet supported. */
if (flag_loop_strip_mine)
- {
- transform_done |= scop_do_strip_mine (scop);
- gcc_assert (graphite_legal_transform (scop));
- }
+ transform_done |= scop_do_strip_mine (scop);
if (flag_loop_interchange)
- {
- transform_done |= scop_do_interchange (scop);
- gcc_assert (graphite_legal_transform (scop));
- }
+ transform_done |= scop_do_interchange (scop);
return transform_done;
}
@@ -309,11 +303,10 @@ new_poly_bb (scop_p scop, void *black_box)
PBB_DOMAIN (pbb) = NULL;
PBB_SCOP (pbb) = scop;
pbb_set_black_box (pbb, black_box);
- PBB_TRANSFORMED_SCATTERING (pbb) = NULL;
- PBB_ORIGINAL_SCATTERING (pbb) = NULL;
+ PBB_TRANSFORMED (pbb) = NULL;
+ PBB_SAVED (pbb) = NULL;
+ PBB_ORIGINAL (pbb) = NULL;
PBB_DRS (pbb) = VEC_alloc (poly_dr_p, heap, 3);
- PBB_NB_SCATTERING_TRANSFORM (pbb) = 0;
- PBB_NB_LOCAL_VARIABLES (pbb) = 0;
VEC_safe_push (poly_bb_p, heap, SCOP_BBS (scop), pbb);
}
@@ -327,11 +320,14 @@ free_poly_bb (poly_bb_p pbb)
ppl_delete_Pointset_Powerset_C_Polyhedron (PBB_DOMAIN (pbb));
- if (PBB_TRANSFORMED_SCATTERING (pbb))
- ppl_delete_Polyhedron (PBB_TRANSFORMED_SCATTERING (pbb));
+ if (PBB_TRANSFORMED (pbb))
+ poly_scattering_free (PBB_TRANSFORMED (pbb));
+
+ if (PBB_SAVED (pbb))
+ poly_scattering_free (PBB_SAVED (pbb));
- if (PBB_ORIGINAL_SCATTERING (pbb))
- ppl_delete_Polyhedron (PBB_ORIGINAL_SCATTERING (pbb));
+ if (PBB_ORIGINAL (pbb))
+ poly_scattering_free (PBB_ORIGINAL (pbb));
if (PBB_DRS (pbb))
for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb), i, pdr); i++)