aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-affine.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-12-20 12:55:45 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-12-20 12:55:45 +0000
commitcc8bea091633989bef6d665c40193a9e255ceb81 (patch)
tree0198dc636ad0b00daedf03723bb5e7349e3373a3 /gcc/tree-affine.h
parenta90c88042b29b16ecadc2f0560f4d3581bcf9ad6 (diff)
downloadgcc-cc8bea091633989bef6d665c40193a9e255ceb81.zip
gcc-cc8bea091633989bef6d665c40193a9e255ceb81.tar.gz
gcc-cc8bea091633989bef6d665c40193a9e255ceb81.tar.bz2
poly_int: aff_tree
This patch changes the type of aff_tree::offset from widest_int to poly_widest_int and adjusts the function interfaces in the same way. 2017-12-20 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * tree-affine.h (aff_tree::offset): Change from widest_int to poly_widest_int. (wide_int_ext_for_comb): Delete. (aff_combination_const, aff_comb_cannot_overlap_p): Take the constants as poly_widest_int rather than widest_int. (aff_combination_constant_multiple_p): Return the multiplier as a poly_widest_int. (aff_combination_zero_p, aff_combination_singleton_var_p): Handle polynomial offsets. * tree-affine.c (wide_int_ext_for_comb): Make original widest_int version static and add an overload for poly_widest_int. (aff_combination_const, aff_combination_add_cst) (wide_int_constant_multiple_p, aff_comb_cannot_overlap_p): Take the constants as poly_widest_int rather than widest_int. (tree_to_aff_combination): Generalize INTEGER_CST case to poly_int_tree_p. (aff_combination_to_tree): Track offsets as poly_widest_ints. (aff_combination_add_product, aff_combination_mult): Handle polynomial offsets. (aff_combination_constant_multiple_p): Return the multiplier as a poly_widest_int. * tree-predcom.c (determine_offset): Return the offset as a poly_widest_int. (split_data_refs_to_components, suitable_component_p): Update accordingly. (valid_initializer_p): Update call to aff_combination_constant_multiple_p. * tree-ssa-address.c (addr_to_parts): Handle polynomial offsets. * tree-ssa-loop-ivopts.c (get_address_cost_ainc): Take the step as a poly_int64 rather than a HOST_WIDE_INT. (get_address_cost): Handle polynomial offsets. (iv_elimination_compare_lt): Likewise. (rewrite_use_nonlinear_expr): Likewise. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r255888
Diffstat (limited to 'gcc/tree-affine.h')
-rw-r--r--gcc/tree-affine.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/tree-affine.h b/gcc/tree-affine.h
index c775ad8..d6802eb 100644
--- a/gcc/tree-affine.h
+++ b/gcc/tree-affine.h
@@ -43,7 +43,7 @@ struct aff_tree
tree type;
/* Constant offset. */
- widest_int offset;
+ poly_widest_int offset;
/* Number of elements of the combination. */
unsigned n;
@@ -64,8 +64,7 @@ struct aff_tree
struct name_expansion;
-widest_int wide_int_ext_for_comb (const widest_int &, aff_tree *);
-void aff_combination_const (aff_tree *, tree, const widest_int &);
+void aff_combination_const (aff_tree *, tree, const poly_widest_int &);
void aff_combination_elt (aff_tree *, tree, tree);
void aff_combination_scale (aff_tree *, const widest_int &);
void aff_combination_mult (aff_tree *, aff_tree *, aff_tree *);
@@ -76,14 +75,15 @@ void aff_combination_convert (aff_tree *, tree);
void tree_to_aff_combination (tree, tree, aff_tree *);
tree aff_combination_to_tree (aff_tree *);
void unshare_aff_combination (aff_tree *);
-bool aff_combination_constant_multiple_p (aff_tree *, aff_tree *, widest_int *);
+bool aff_combination_constant_multiple_p (aff_tree *, aff_tree *,
+ poly_widest_int *);
void aff_combination_expand (aff_tree *, hash_map<tree, name_expansion *> **);
void tree_to_aff_combination_expand (tree, tree, aff_tree *,
hash_map<tree, name_expansion *> **);
tree get_inner_reference_aff (tree, aff_tree *, widest_int *);
void free_affine_expand_cache (hash_map<tree, name_expansion *> **);
-bool aff_comb_cannot_overlap_p (aff_tree *, const widest_int &,
- const widest_int &);
+bool aff_comb_cannot_overlap_p (aff_tree *, const poly_widest_int &,
+ const poly_widest_int &);
/* Debugging functions. */
void debug_aff (aff_tree *);
@@ -102,7 +102,7 @@ aff_combination_zero_p (aff_tree *aff)
if (!aff)
return true;
- if (aff->n == 0 && aff->offset == 0)
+ if (aff->n == 0 && known_eq (aff->offset, 0))
return true;
return false;
@@ -121,7 +121,7 @@ inline bool
aff_combination_singleton_var_p (aff_tree *aff)
{
return (aff->n == 1
- && aff->offset == 0
+ && known_eq (aff->offset, 0)
&& (aff->elts[0].coef == 1 || aff->elts[0].coef == -1));
}
#endif /* GCC_TREE_AFFINE_H */