aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorJames A. Morrison <phython@gcc.gnu.org>2005-08-17 03:56:20 +0000
committerJames A. Morrison <phython@gcc.gnu.org>2005-08-17 03:56:20 +0000
commitf457cf402e8d2ba9a9ac27c74e4af5f9b6259b1e (patch)
treebf56b200973247a5d5406c02f3422ef6f6a55621 /gcc/tree-data-ref.c
parent0cbe2a6862df066e1ba207bbba418b1a5e6bd429 (diff)
downloadgcc-f457cf402e8d2ba9a9ac27c74e4af5f9b6259b1e.zip
gcc-f457cf402e8d2ba9a9ac27c74e4af5f9b6259b1e.tar.gz
gcc-f457cf402e8d2ba9a9ac27c74e4af5f9b6259b1e.tar.bz2
fold-const.c (optimize_bit_field_compare): Remove extra fold call.
2005-08-16 James A. Morrison <phython@gcc.gnu.org> * fold-const.c (optimize_bit_field_compare): Remove extra fold call. (try_move_mult_to_index): Call fold_build2 instead of build2. (fold_binary): Don't call fold after calls to try_move_mult_to_index. * tree-ssa-loop-niter.c (inverse): Call int_const_binop instead of fold_binary_to_constant. (infer_loop_bounds_from_undefined): Call fold_build2 instead of fold (build. * tree-data-ref.c (tree_fold_divides_p): Use tree_int_cst_equal to check if A == gcd (A, B). Remove TYPE argument. (analyze_offset) Use fold_build2 instead of fold (build. (create_data_ref): Likewise. (analyze_siv_subscript_cst_affine): Update calls to tree_fold_divides_p. * tree-ssa-ccp.c (widen_bitfield): Call fold_build2 instead of build2 then fold. From-SVN: r103200
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 1848128..568de38 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -479,13 +479,11 @@ base_addr_differ_p (struct data_reference *dra,
/* Returns true iff A divides B. */
static inline bool
-tree_fold_divides_p (tree type,
- tree a,
+tree_fold_divides_p (tree a,
tree b)
{
/* Determines whether (A == gcd (A, B)). */
- return integer_zerop
- (fold_build2 (MINUS_EXPR, type, a, tree_fold_gcd (a, b)));
+ return tree_int_cst_equal (a, tree_fold_gcd (a, b));
}
/* Compute the greatest common denominator of two numbers using
@@ -1723,7 +1721,7 @@ analyze_offset (tree offset, tree *invariant, tree *constant)
*constant = constant_0 ? constant_0 : constant_1;
if (invariant_0 && invariant_1)
*invariant =
- fold (build (code, TREE_TYPE (invariant_0), invariant_0, invariant_1));
+ fold_build2 (code, TREE_TYPE (invariant_0), invariant_0, invariant_1);
else
*invariant = invariant_0 ? invariant_0 : invariant_1;
}
@@ -1805,8 +1803,8 @@ create_data_ref (tree memref, tree stmt, bool is_read)
if (constant)
{
DR_INIT (dr) = fold_convert (ssizetype, constant);
- init_cond = fold (build (TRUNC_DIV_EXPR, TREE_TYPE (constant),
- constant, type_size));
+ init_cond = fold_build2 (TRUNC_DIV_EXPR, TREE_TYPE (constant),
+ constant, type_size);
}
else
DR_INIT (dr) = init_cond = ssize_int (0);;
@@ -2186,8 +2184,7 @@ analyze_siv_subscript_cst_affine (tree chrec_a,
chrec_b = {10, +, 1}
*/
- if (tree_fold_divides_p
- (integer_type_node, CHREC_RIGHT (chrec_b), difference))
+ if (tree_fold_divides_p (CHREC_RIGHT (chrec_b), difference))
{
*overlaps_a = integer_zero_node;
*overlaps_b = fold_build2 (EXACT_DIV_EXPR, integer_type_node,
@@ -2199,7 +2196,7 @@ analyze_siv_subscript_cst_affine (tree chrec_a,
return;
}
- /* When the step does not divides the difference, there are
+ /* When the step does not divide the difference, there are
no overlaps. */
else
{
@@ -2241,13 +2238,12 @@ analyze_siv_subscript_cst_affine (tree chrec_a,
chrec_a = 3
chrec_b = {10, +, -1}
*/
- if (tree_fold_divides_p
- (integer_type_node, CHREC_RIGHT (chrec_b), difference))
+ if (tree_fold_divides_p (CHREC_RIGHT (chrec_b), difference))
{
*overlaps_a = integer_zero_node;
- *overlaps_b = fold
- (build (EXACT_DIV_EXPR, integer_type_node, difference,
- CHREC_RIGHT (chrec_b)));
+ *overlaps_b = fold_build2 (EXACT_DIV_EXPR,
+ integer_type_node, difference,
+ CHREC_RIGHT (chrec_b));
*last_conflicts = integer_one_node;
return;
}
@@ -2816,7 +2812,7 @@ chrec_steps_divide_constant_p (tree chrec,
switch (TREE_CODE (chrec))
{
case POLYNOMIAL_CHREC:
- return (tree_fold_divides_p (integer_type_node, CHREC_RIGHT (chrec), cst)
+ return (tree_fold_divides_p (CHREC_RIGHT (chrec), cst)
&& chrec_steps_divide_constant_p (CHREC_LEFT (chrec), cst));
default: