Commit b1347638 by Daniel Berlin Committed by Daniel Berlin

tree-data-ref.c (analyze_array_indexes): Only estimate when estimate_only is true.

2005-09-20  Daniel Berlin  <dberlin@dberlin.org>

	* tree-data-ref.c (analyze_array_indexes): Only estimate when
	estimate_only  is true.
	* tree-flow.h (ref_contains_indirect_ref): New prototype.
	* tree-flow-inline.h (ref_contains_indirect_ref): Moved from
	tree-ssa-structalias.c
	* tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): Use
	ref_contains_indirect_ref.
	* tree-ssa-structalias.c (ref_contains_indirect_ref): Moved.

From-SVN: r104518
parent 0c997639
2005-09-21 Daniel Berlin <dberlin@dberlin.org>
* tree-data-ref.c (analyze_array_indexes): Only estimate when
estimate_only is true.
* tree-flow.h (ref_contains_indirect_ref): New prototype.
* tree-flow-inline.h (ref_contains_indirect_ref): Moved from
tree-ssa-structalias.c
* tree-ssa-loop-niter.c (infer_loop_bounds_from_undefined): Use
ref_contains_indirect_ref.
* tree-ssa-structalias.c (ref_contains_indirect_ref): Moved.
2005-09-21 DJ Delorie <dj@redhat.com> 2005-09-21 DJ Delorie <dj@redhat.com>
* config/mn10300/mn10300.c (TARGET_DEFAULT_TARGET_FLAGS): Add * config/mn10300/mn10300.c (TARGET_DEFAULT_TARGET_FLAGS): Add
......
...@@ -823,7 +823,8 @@ analyze_array_indexes (struct loop *loop, ...@@ -823,7 +823,8 @@ analyze_array_indexes (struct loop *loop,
access_fn = instantiate_parameters access_fn = instantiate_parameters
(loop, analyze_scalar_evolution (loop, opnd1)); (loop, analyze_scalar_evolution (loop, opnd1));
if (chrec_contains_undetermined (loop->estimated_nb_iterations)) if (estimate_only
&& chrec_contains_undetermined (loop->estimated_nb_iterations))
estimate_niter_from_size_of_data (loop, opnd0, access_fn, stmt); estimate_niter_from_size_of_data (loop, opnd0, access_fn, stmt);
if (!estimate_only) if (!estimate_only)
......
...@@ -1414,6 +1414,21 @@ unmodifiable_var_p (tree var) ...@@ -1414,6 +1414,21 @@ unmodifiable_var_p (tree var)
return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var)); return TREE_READONLY (var) && (TREE_STATIC (var) || DECL_EXTERNAL (var));
} }
/* Return true if REF, an ARRAY_REF, has an INDIRECT_REF somewhere in
it. */
static inline bool
ref_contains_indirect_ref (tree ref)
{
while (handled_component_p (ref))
{
if (TREE_CODE (ref) == INDIRECT_REF)
return true;
ref = TREE_OPERAND (ref, 0);
}
return false;
}
/* Return true if REF, a COMPONENT_REF, has an ARRAY_REF somewhere in it. */ /* Return true if REF, a COMPONENT_REF, has an ARRAY_REF somewhere in it. */
static inline bool static inline bool
......
...@@ -614,6 +614,7 @@ extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *, bool *); ...@@ -614,6 +614,7 @@ extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *, bool *);
static inline subvar_t get_subvars_for_var (tree); static inline subvar_t get_subvars_for_var (tree);
static inline tree get_subvar_at (tree, unsigned HOST_WIDE_INT); static inline tree get_subvar_at (tree, unsigned HOST_WIDE_INT);
static inline bool ref_contains_array_ref (tree); static inline bool ref_contains_array_ref (tree);
static inline bool ref_contains_indirect_ref (tree);
extern tree okay_component_ref_for_subvars (tree, unsigned HOST_WIDE_INT *, extern tree okay_component_ref_for_subvars (tree, unsigned HOST_WIDE_INT *,
unsigned HOST_WIDE_INT *); unsigned HOST_WIDE_INT *);
static inline bool var_can_have_subvars (tree); static inline bool var_can_have_subvars (tree);
......
...@@ -2008,12 +2008,12 @@ offset_overlaps_with_access (const unsigned HOST_WIDE_INT fieldpos, ...@@ -2008,12 +2008,12 @@ offset_overlaps_with_access (const unsigned HOST_WIDE_INT fieldpos,
/* Given a COMPONENT_REF T, return the constraint_expr for it. */ /* Given a COMPONENT_REF T, return the constraint_expr for it. */
static struct constraint_expr static struct constraint_expr
get_constraint_for_component_ref (tree t, bool *needs_anyoffset) get_constraint_for_component_ref (tree t, bool *need_anyoffset)
{ {
struct constraint_expr result; struct constraint_expr result;
HOST_WIDE_INT bitsize; HOST_WIDE_INT bitsize = -1;
HOST_WIDE_INT bitpos; HOST_WIDE_INT bitpos;
tree offset; tree offset = NULL_TREE;
enum machine_mode mode; enum machine_mode mode;
int unsignedp; int unsignedp;
int volatilep; int volatilep;
...@@ -2039,7 +2039,7 @@ get_constraint_for_component_ref (tree t, bool *needs_anyoffset) ...@@ -2039,7 +2039,7 @@ get_constraint_for_component_ref (tree t, bool *needs_anyoffset)
t = get_inner_reference (t, &bitsize, &bitpos, &offset, &mode, t = get_inner_reference (t, &bitsize, &bitpos, &offset, &mode,
&unsignedp, &volatilep, false); &unsignedp, &volatilep, false);
result = get_constraint_for (t, needs_anyoffset); result = get_constraint_for (t, need_anyoffset);
/* This can also happen due to weird offsetof type macros. */ /* This can also happen due to weird offsetof type macros. */
if (TREE_CODE (t) != ADDR_EXPR && result.type == ADDRESSOF) if (TREE_CODE (t) != ADDR_EXPR && result.type == ADDRESSOF)
...@@ -2051,10 +2051,10 @@ get_constraint_for_component_ref (tree t, bool *needs_anyoffset) ...@@ -2051,10 +2051,10 @@ get_constraint_for_component_ref (tree t, bool *needs_anyoffset)
{ {
result.offset = bitpos; result.offset = bitpos;
} }
else if (needs_anyoffset) else if (need_anyoffset)
{ {
result.offset = 0; result.offset = 0;
*needs_anyoffset = true; *need_anyoffset = true;
} }
else else
{ {
...@@ -2510,23 +2510,6 @@ do_structure_copy (tree lhsop, tree rhsop) ...@@ -2510,23 +2510,6 @@ do_structure_copy (tree lhsop, tree rhsop)
} }
} }
/* Return true if REF, a COMPONENT_REF, has an INDIRECT_REF somewhere
in it. */
static inline bool
ref_contains_indirect_ref (tree ref)
{
while (handled_component_p (ref))
{
if (TREE_CODE (ref) == INDIRECT_REF)
return true;
ref = TREE_OPERAND (ref, 0);
}
return false;
}
/* Update related alias information kept in AI. This is used when /* Update related alias information kept in AI. This is used when
building name tags, alias sets and deciding grouping heuristics. building name tags, alias sets and deciding grouping heuristics.
STMT is the statement to process. This function also updates STMT is the statement to process. This function also updates
......
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