aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2005-05-17 22:02:56 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2005-05-17 20:02:56 +0000
commitd7bf3bcf99126e5d554a6121d79344a6f3c7bdf2 (patch)
treee43ca90e30d0a349e9725b82bbd8fe83295a552e /gcc/tree-ssa-loop-niter.c
parent98273e5afbb86bdbe6b2c8164ad674c14e51700d (diff)
downloadgcc-d7bf3bcf99126e5d554a6121d79344a6f3c7bdf2.zip
gcc-d7bf3bcf99126e5d554a6121d79344a6f3c7bdf2.tar.gz
gcc-d7bf3bcf99126e5d554a6121d79344a6f3c7bdf2.tar.bz2
tree-ssa-loop-ivopts.c (find_bivs, [...]): Apply expand_simple_operations to bases of the ivs.
* 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. From-SVN: r99853
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index b3bde28..38f7b42 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -189,10 +189,10 @@ number_of_iterations_cond (tree type, tree base0, tree step0,
/* Ignore loops of while (i-- < 10) type. */
if (code != NE_EXPR)
{
- if (step0 && !tree_expr_nonnegative_p (step0))
+ if (step0 && tree_int_cst_sign_bit (step0))
return;
- if (!zero_p (step1) && tree_expr_nonnegative_p (step1))
+ if (!zero_p (step1) && !tree_int_cst_sign_bit (step1))
return;
}
@@ -366,7 +366,7 @@ number_of_iterations_cond (tree type, tree base0, tree step0,
if (!zero_p (step1))
step0 = fold_unary_to_constant (NEGATE_EXPR, type, step1);
step1 = NULL_TREE;
- if (!tree_expr_nonnegative_p (fold_convert (signed_niter_type, step0)))
+ if (tree_int_cst_sign_bit (fold_convert (signed_niter_type, step0)))
{
step0 = fold_unary_to_constant (NEGATE_EXPR, type, step0);
base1 = fold_build1 (NEGATE_EXPR, type, base1);
@@ -627,7 +627,7 @@ simplify_replace_tree (tree expr, tree old, tree new)
/* Expand definitions of ssa names in EXPR as long as they are simple
enough, and return the new expression. */
-static tree
+tree
expand_simple_operations (tree expr)
{
unsigned i, n;