aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-ivopts.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2005-05-17 20:02:56 +0000
committerZdenek Dvorak <dvorakz@suse.cz>2005-05-17 20:02:56 +0000
commit0a9eee3baede3900a48d36554138f62006bf3c28 (patch)
treee43ca90e30d0a349e9725b82bbd8fe83295a552e /gcc/tree-ssa-loop-ivopts.c
parent000d18b881aa2c313bc17c189b41f8eb85f81e42 (diff)
* tree-ssa-loop-ivopts.c (find_bivs, find_givs_in_stmt_scev): Apply
expand_simple_operations to bases of the ivs. (tree_int_cst_sign_bit): Export. * tree-flow.h (expand_simple_operations): Declare. * tree-ssa-loop-niter.c (number_of_iterations_cond): Use tree_int_cst_sign_bit. (expand_simple_operations): Export. * tree.h (tree_int_cst_sign_bit): Declare. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@99853 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r--gcc/tree-ssa-loop-ivopts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 00e7849e7f8..af121c4489d 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -992,6 +992,7 @@ find_bivs (struct ivopts_data *data)
continue;
base = PHI_ARG_DEF_FROM_EDGE (phi, loop_preheader_edge (loop));
+ base = expand_simple_operations (base);
if (contains_abnormal_ssa_name_p (base)
|| contains_abnormal_ssa_name_p (step))
continue;
@@ -1062,6 +1063,7 @@ find_givs_in_stmt_scev (struct ivopts_data *data, tree stmt,
if (!simple_iv (loop, stmt, TREE_OPERAND (stmt, 1), base, step, true))
return false;
+ *base = expand_simple_operations (*base);
if (contains_abnormal_ssa_name_p (*base)
|| contains_abnormal_ssa_name_p (*step))
@@ -2536,7 +2538,7 @@ var_at_stmt (struct loop *loop, struct iv_cand *cand, tree stmt)
/* Return the most significant (sign) bit of T. Similar to tree_int_cst_msb,
but the bit is determined from TYPE_PRECISION, not MODE_BITSIZE. */
-static int
+int
tree_int_cst_sign_bit (tree t)
{
unsigned bitno = TYPE_PRECISION (TREE_TYPE (t)) - 1;