aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2009-07-31 02:30:03 +0000
committerSebastian Pop <sebastian.pop@amd.com>2009-07-31 02:30:03 +0000
commit564fca4f7f71af226f0a3ba6e08f4a540b6a0a1f (patch)
treed4db5f59ba75d0b935049194fd65c31d5b59c837
parent204cc2f2057a8b3880d47ff6c81001d55b95921b (diff)
Return unknow from scev instantiation if the result is not above instantiate_below.
2009-07-30 Sebastian Pop <sebastian.pop@amd.com> * tree-scalar-evolution.c: Fix comment. (instantiate_scev_1): Return unknow from scev instantiation if the result is not above instantiate_below. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@150290 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/tree-scalar-evolution.c14
2 files changed, 13 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 82f6a919227..ca1cd1ad9bd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2009-07-30 Sebastian Pop <sebastian.pop@amd.com>
+ * tree-scalar-evolution.c: Fix comment.
+ (instantiate_scev_1): Return unknow from scev instantiation if the
+ result is not above instantiate_below.
+
+2009-07-30 Sebastian Pop <sebastian.pop@amd.com>
+
* tree-scalar-evolution.c (compute_overall_effect_of_inner_loop): Not
static anymore. Instantiate the symbols that may have been introduced
by chrec_apply.
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index e817ffe64c3..02a4eed646e 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -1893,18 +1893,16 @@ analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res)
return res;
}
-/* Entry point for the scalar evolution analyzer.
- Analyzes and returns the scalar evolution of the ssa_name VAR.
- LOOP_NB is the identifier number of the loop in which the variable
- is used.
+/* Analyzes and returns the scalar evolution of the ssa_name VAR in
+ LOOP. LOOP is the loop in which the variable is used.
Example of use: having a pointer VAR to a SSA_NAME node, STMT a
pointer to the statement that uses this variable, in order to
determine the evolution function of the variable, use the following
calls:
- unsigned loop_nb = loop_containing_stmt (stmt)->num;
- tree chrec_with_symbols = analyze_scalar_evolution (loop_nb, var);
+ loop_p loop = loop_containing_stmt (stmt);
+ tree chrec_with_symbols = analyze_scalar_evolution (loop, var);
tree chrec_instantiated = instantiate_parameters (loop, chrec_with_symbols);
*/
@@ -2177,7 +2175,9 @@ instantiate_scev_1 (basic_block instantiate_below,
else
res = chrec;
- if (res == NULL_TREE)
+ if (res == NULL_TREE
+ || !dominated_by_p (CDI_DOMINATORS, instantiate_below,
+ gimple_bb (SSA_NAME_DEF_STMT (res))))
res = chrec_dont_know;
}