aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-niter.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2004-10-27 22:27:20 +0200
committerZdenek Dvorak <rakdver@gcc.gnu.org>2004-10-27 20:27:20 +0000
commit38b0dcb81effec70e61bb1e652c0cab254245115 (patch)
tree36323e61beca852219425c346a9efad5a6b0dfb5 /gcc/tree-ssa-loop-niter.c
parent89e73849fd8fe510b1e5b8b91b5ce1211d377f95 (diff)
downloadgcc-38b0dcb81effec70e61bb1e652c0cab254245115.zip
gcc-38b0dcb81effec70e61bb1e652c0cab254245115.tar.gz
gcc-38b0dcb81effec70e61bb1e652c0cab254245115.tar.bz2
re PR tree-optimization/18048 (mgrid loop performance regression with ivopts (register pressure))
PR tree-optimization/18048 * fold-const.c (try_move_mult_to_index): New function. (fold): Use try_move_mult_to_index. * tree-ssa-loop-ivopts.c (try_add_cand_for): Prefer common candidates. * tree-ssa-loop-niter.c (number_of_iterations_cond): Produce an all-ones unsigned constant without extra bits. * tree.c (build_low_bits_mask): New function. * tree.h (build_low_bits_mask): Declare. From-SVN: r89708
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r--gcc/tree-ssa-loop-niter.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index b879b9e..496b3f3 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -419,9 +419,10 @@ number_of_iterations_cond (tree type, tree base0, tree step0,
d = EXEC_BINARY (LSHIFT_EXPR, niter_type,
build_int_cst_type (niter_type, 1), bits);
s = EXEC_BINARY (RSHIFT_EXPR, niter_type, step0, bits);
- bound = EXEC_BINARY (RSHIFT_EXPR, niter_type,
- build_int_cst (niter_type, -1),
- bits);
+
+ bound = build_low_bits_mask (niter_type,
+ (TYPE_PRECISION (niter_type)
+ - tree_low_cst (bits, 1)));
assumption = fold (build2 (FLOOR_MOD_EXPR, niter_type, base1, d));
assumption = fold (build2 (EQ_EXPR, boolean_type_node,