Commit a213b219 by Sebastian Pop Committed by Sebastian Pop

re PR middle-end/37375 ([graphite] Parameter detection and scev only take a…

re PR middle-end/37375 ([graphite] Parameter detection and scev only take a surrounding loop as border)

2008-09-05  Sebastian Pop  <sebastian.pop@amd.com>

	PR tree-optimization/37375
	* tree-scalar-evolution.c (scev_info_str): Add field instantiated_below.
	(new_scev_info_str, eq_scev_info, find_var_scev_info,
	set_scalar_evolution, get_scalar_evolution, get_instantiated_value,
	set_instantiated_value): Pass instantiated_below.
	(analyze_scalar_evolution_1, analyze_scalar_evolution): Update calls to
	above functions.
	(instantiate_scev_1, instantiate_scev): Pass a basic block above which the
	definitions are not instantiated.

	* tree-scalar-evolution.h (instantiate_scev): Update declaration.
	(block_before_loop): New.
	* tree-data-ref.c (dr_analyze_indices): Update uses of instantiate_scev.
	* graphite.c (block_before_scop): New.
	(loop_affine_expr, stmt_simple_for_scop_p, harmful_stmt_in_bb): Pass a 
	basic block, not a loop for determining the parameters.
	(scopdet_edge_info, build_scops_1): Do not pass outermost loop in the
	scop.
	(idx_record_params, find_params_in_bb, find_scop_parameters,
	build_loop_iteration_domains, add_conditions_to_domain): Update calls 
	to instantiate_scev.
	
	* Makefile.in (cfgloopmanip.o): Add missing dependency on TREE_FLOW_H.

From-SVN: r140164
parent 00ca6640
2008-09-09 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/37375
* tree-scalar-evolution.c (scev_info_str): Add field instantiated_below.
(new_scev_info_str, eq_scev_info, find_var_scev_info,
set_scalar_evolution, get_scalar_evolution, get_instantiated_value,
set_instantiated_value): Pass instantiated_below.
(analyze_scalar_evolution_1, analyze_scalar_evolution): Update calls to
above functions.
(instantiate_scev_1, instantiate_scev): Pass a basic block above which the
definitions are not instantiated.
* tree-scalar-evolution.h (instantiate_scev): Update declaration.
(block_before_loop): New.
* tree-data-ref.c (dr_analyze_indices): Update uses of instantiate_scev.
* graphite.c (block_before_scop): New.
(loop_affine_expr, stmt_simple_for_scop_p, harmful_stmt_in_bb): Pass a
basic block, not a loop for determining the parameters.
(scopdet_edge_info, build_scops_1): Do not pass outermost loop in the
scop.
(idx_record_params, find_params_in_bb, find_scop_parameters,
build_loop_iteration_domains, add_conditions_to_domain): Update calls
to instantiate_scev.
* Makefile.in (cfgloopmanip.o): Add missing dependency on TREE_FLOW_H.
2008-09-09 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-opt/37333
......
......@@ -2816,7 +2816,7 @@ loop-invariant.o : loop-invariant.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(HASHTAB_H) except.h
cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) output.h \
coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H)
coretypes.h $(TM_H) cfghooks.h $(OBSTACK_H) $(TREE_FLOW_H)
loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(GGC_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(CFGLAYOUT_H) \
coretypes.h $(TM_H) $(OBSTACK_H) tree-pass.h $(TIMEVAR_H) $(FLAGS_H) $(DF_H)
......
......@@ -747,6 +747,7 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
VEC (tree, heap) *access_fns = NULL;
tree ref = unshare_expr (DR_REF (dr)), aref = ref, op;
tree base, off, access_fn;
basic_block before_loop = block_before_loop (nest);
while (handled_component_p (aref))
{
......@@ -754,7 +755,7 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
{
op = TREE_OPERAND (aref, 1);
access_fn = analyze_scalar_evolution (loop, op);
access_fn = instantiate_scev (nest, loop, access_fn);
access_fn = instantiate_scev (before_loop, loop, access_fn);
VEC_safe_push (tree, heap, access_fns, access_fn);
TREE_OPERAND (aref, 1) = build_int_cst (TREE_TYPE (op), 0);
......@@ -767,7 +768,7 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
{
op = TREE_OPERAND (aref, 0);
access_fn = analyze_scalar_evolution (loop, op);
access_fn = instantiate_scev (nest, loop, access_fn);
access_fn = instantiate_scev (before_loop, loop, access_fn);
base = initial_condition (access_fn);
split_constant_offset (base, &base, &off);
access_fn = chrec_replace_initial_condition (access_fn,
......
......@@ -29,7 +29,7 @@ extern void scev_initialize (void);
extern void scev_reset (void);
extern void scev_finalize (void);
extern tree analyze_scalar_evolution (struct loop *, tree);
extern tree instantiate_scev (struct loop *, struct loop *, tree);
extern tree instantiate_scev (basic_block, struct loop *, tree);
extern tree resolve_mixers (struct loop *, tree);
extern void gather_stats_on_scev_database (void);
extern void scev_analysis (void);
......@@ -37,6 +37,16 @@ unsigned int scev_const_prop (void);
extern bool simple_iv (struct loop *, gimple, tree, affine_iv *, bool);
/* Returns the basic block preceding LOOP or ENTRY_BLOCK_PTR when the
loop is function's body. */
static inline basic_block
block_before_loop (loop_p loop)
{
edge preheader = loop_preheader_edge (loop);
return (preheader ? preheader->src : ENTRY_BLOCK_PTR);
}
/* Analyze all the parameters of the chrec that were left under a
symbolic form. LOOP is the loop in which symbolic names have to
be analyzed and instantiated. */
......@@ -44,7 +54,7 @@ extern bool simple_iv (struct loop *, gimple, tree, affine_iv *, bool);
static inline tree
instantiate_parameters (struct loop *loop, tree chrec)
{
return instantiate_scev (loop, loop, chrec);
return instantiate_scev (block_before_loop (loop), loop, chrec);
}
/* Returns the loop of the polynomial chrec CHREC. */
......
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