Commit b0789219 by Tobias Grosser Committed by Tobias Grosser

graphite.c (bb_in_sese_p, [...]): Moved.

2009-02-04  Tobias Grosser  <grosser@fim.uni-passau.de> 

	* graphite.c (bb_in_sese_p, sese_build_livein_liveouts_use,
	sese_build_livein_liveouts_bb, sese_build_livein_liveouts,
	register_bb_in_sese, new_sese, free_sese): Moved.
	(dot_scop_1, build_scop_loop_nests, build_loop_iteration_domains,
	outermost_loop_in_scop, build_scop_iteration_domain,
	expand_scalar_variables_ssa_name, get_vdef_before_scop,
	limit_scops): Use bb_in_sese_p instead of bb_in_scop_p.
	Use loop_in_sese_p instead of loop_in_scop_p.
	(new_graphite_bb, gloog): Do not initialize SCOP_BBS_B.
	(new_scop, free_scop): Remove SCOP_LOOP2CLOOG_LOOP and SCOP_BBS_B.
	(scopdet_basic_block_info): Fix bug in scop detection.
	(new_loop_to_cloog_loop_str, hash_loop_to_cloog_loop,
	eq_loop_to_cloog_loop): Remove.
	(nb_loops_around_loop_in_scop, nb_loop
	ref_nb_loops): Moved here...
	* graphite.h (ref_nb_loops): ... from here.
	(struct scop): Remove bbs_b bitmap and loop2cloog_loop.
	(loop_domain_dim, loop_iteration_vector_dim): Remove.
	(SCOP_BBS_B, bb_in_scop_p, loop_in_scop_p): Removed.
	* testsuite/gcc.dg/graphite/scop-19.c: New

From-SVN: r143947
parent d75ea2a5
2009-02-04 Tobias Grosser <grosser@fim.uni-passau.de>
* graphite.c (bb_in_sese_p, sese_build_livein_liveouts_use,
sese_build_livein_liveouts_bb, sese_build_livein_liveouts,
register_bb_in_sese, new_sese, free_sese): Moved.
(dot_scop_1, build_scop_loop_nests, build_loop_iteration_domains,
outermost_loop_in_scop, build_scop_iteration_domain,
expand_scalar_variables_ssa_name, get_vdef_before_scop,
limit_scops): Use bb_in_sese_p instead of bb_in_scop_p.
Use loop_in_sese_p instead of loop_in_scop_p.
(new_graphite_bb, gloog): Do not initialize SCOP_BBS_B.
(new_scop, free_scop): Remove SCOP_LOOP2CLOOG_LOOP and SCOP_BBS_B.
(scopdet_basic_block_info): Fix bug in scop detection.
(new_loop_to_cloog_loop_str, hash_loop_to_cloog_loop,
eq_loop_to_cloog_loop): Remove.
(nb_loops_around_loop_in_scop, nb_loop
ref_nb_loops): Moved here...
* graphite.h (ref_nb_loops): ... from here.
(struct scop): Remove bbs_b bitmap and loop2cloog_loop.
(loop_domain_dim, loop_iteration_vector_dim): Remove.
(SCOP_BBS_B, bb_in_scop_p, loop_in_scop_p): Removed.
* testsuite/gcc.dg/graphite/scop-19.c: New
2009-02-04 Paolo Bonzini <bonzini@gnu.org>
Hans-Peter Nilsson <hp@axis.com>
......
......@@ -23,6 +23,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree-data-ref.h"
int ref_nb_loops (data_reference_p);
typedef struct graphite_bb *graphite_bb_p;
DEF_VEC_P(graphite_bb_p);
DEF_VEC_ALLOC_P (graphite_bb_p, heap);
......@@ -216,6 +218,8 @@ gbb_loop (struct graphite_bb *gbb)
return GBB_BB (gbb)->loop_father;
}
int nb_loops_around_gb (graphite_bb_p);
/* Calculate the number of loops around GB in the current SCOP. Only
works if GBB_DOMAIN is built. */
......@@ -313,13 +317,11 @@ struct scop
/* A SCOP is defined as a SESE region. */
sese region;
/* All the basic blocks in this scop. They have extra information
attached to them, in the graphite_bb structure. */
/* All the basic blocks in this scop that contain memory references
and that will be represented as statements in the polyhedral
representation. */
VEC (graphite_bb_p, heap) *bbs;
/* Set for a basic block index when it belongs to this SCOP. */
bitmap bbs_b;
lambda_vector static_schedule;
/* Parameters used within the SCOP. */
......@@ -349,7 +351,6 @@ struct scop
};
#define SCOP_BBS(S) S->bbs
#define SCOP_BBS_B(S) S->bbs_b
#define SCOP_REGION(S) S->region
/* SCOP_ENTRY bb dominates all the bbs of the scop. SCOP_EXIT bb
post-dominates all the bbs of the scop. SCOP_EXIT potentially
......@@ -572,59 +573,4 @@ scop_gimple_loop_depth (scop_p scop, loop_p loop)
return depth;
}
/* Static inline function prototypes. */
static inline unsigned scop_nb_params (scop_p scop);
/* Returns true when BB is in SCOP. */
static inline bool
bb_in_scop_p (basic_block bb, scop_p scop)
{
return bitmap_bit_p (SCOP_BBS_B (scop), bb->index);
}
/* Returns true when LOOP is in SCOP. */
static inline bool
loop_in_scop_p (struct loop *loop, scop_p scop)
{
return (bb_in_scop_p (loop->header, scop)
&& bb_in_scop_p (loop->latch, scop));
}
/* Calculate the number of loops around LOOP in the SCOP. */
static inline int
nb_loops_around_loop_in_scop (struct loop *l, scop_p scop)
{
int d = 0;
for (; loop_in_scop_p (l, scop); d++, l = loop_outer (l));
return d;
}
/* Calculate the number of loops around GB in the current SCOP. */
static inline int
nb_loops_around_gb (graphite_bb_p gb)
{
return nb_loops_around_loop_in_scop (gbb_loop (gb), GBB_SCOP (gb));
}
/* Returns the dimensionality of an enclosing loop iteration domain
with respect to enclosing SCoP for a given data reference REF. The
returned dimensionality is homogeneous (depth of loop nest + number
of SCoP parameters + const). */
static inline int
ref_nb_loops (data_reference_p ref)
{
loop_p loop = loop_containing_stmt (DR_STMT (ref));
scop_p scop = DR_SCOP (ref);
return nb_loops_around_loop_in_scop (loop, scop) + scop_nb_params (scop) + 2;
}
#endif /* GCC_GRAPHITE_H */
/* { dg-options "-O2 -fgraphite -fdump-tree-graphite-all" } */
typedef unsigned int __uint32_t;
typedef __uint32_t __size_t;
typedef __size_t size_t;
struct demangle_component
{
union
{
} u;
};
enum d_builtin_type_print
{
D_PRINT_VOID
};
struct d_growable_string
{
size_t alc;
};
d_growable_string_resize (struct d_growable_string *dgs, size_t need)
{
size_t newalc;
newalc = dgs->alc > 0 ? dgs->alc : 2;
while (newalc < need)
newalc <<= 1;
}
d_growable_string_append_buffer (struct d_growable_string *dgs,
const char *s, size_t l)
{
size_t need;
if (need > dgs->alc)
d_growable_string_resize (dgs, need);
}
/* { dg-final { scan-tree-dump-times "number of SCoPs: 0" 2 "graphite"} } */
/* { dg-final { cleanup-tree-dump "graphite" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment