aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-scalar-evolution.h
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2008-09-09 18:39:45 +0000
committerSebastian Pop <spop@gcc.gnu.org>2008-09-09 18:39:45 +0000
commita213b2190b451de691e9517e68dffd533f299bb9 (patch)
tree73195c19addce9aac12faa4c9914cd880f94c5b0 /gcc/tree-scalar-evolution.h
parent00ca66405c3b9da27fab36bd55e62148e97d7491 (diff)
downloadgcc-a213b2190b451de691e9517e68dffd533f299bb9.zip
gcc-a213b2190b451de691e9517e68dffd533f299bb9.tar.gz
gcc-a213b2190b451de691e9517e68dffd533f299bb9.tar.bz2
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
Diffstat (limited to 'gcc/tree-scalar-evolution.h')
-rw-r--r--gcc/tree-scalar-evolution.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/tree-scalar-evolution.h b/gcc/tree-scalar-evolution.h
index 5d6d711..7ba0708 100644
--- a/gcc/tree-scalar-evolution.h
+++ b/gcc/tree-scalar-evolution.h
@@ -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. */