Commit b7b5203d by Bin Cheng Committed by Bin Cheng

tree-affine.h (aff_combination_type): New interface.

	* tree-affine.h (aff_combination_type): New interface.
	(aff_combination_zero_p): Remove static.
	(aff_combination_const_p): New interface.
	(aff_combination_singleton_var_p): New interfaces.

From-SVN: r247883
parent 7581ce9a
2017-05-11 Bin Cheng <bin.cheng@arm.com>
* tree-affine.h (aff_combination_type): New interface.
(aff_combination_zero_p): Remove static.
(aff_combination_const_p): New interface.
(aff_combination_singleton_var_p): New interfaces.
2017-05-11 Richard Biener <rguenther@suse.de> 2017-05-11 Richard Biener <rguenther@suse.de>
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children): * tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
......
...@@ -88,8 +88,15 @@ bool aff_comb_cannot_overlap_p (aff_tree *, const widest_int &, ...@@ -88,8 +88,15 @@ bool aff_comb_cannot_overlap_p (aff_tree *, const widest_int &,
/* Debugging functions. */ /* Debugging functions. */
void debug_aff (aff_tree *); void debug_aff (aff_tree *);
/* Return AFF's type. */
inline tree
aff_combination_type (aff_tree *aff)
{
return aff->type;
}
/* Return true if AFF is actually ZERO. */ /* Return true if AFF is actually ZERO. */
static inline bool inline bool
aff_combination_zero_p (aff_tree *aff) aff_combination_zero_p (aff_tree *aff)
{ {
if (!aff) if (!aff)
...@@ -101,4 +108,20 @@ aff_combination_zero_p (aff_tree *aff) ...@@ -101,4 +108,20 @@ aff_combination_zero_p (aff_tree *aff)
return false; return false;
} }
/* Return true if AFF is actually const. */
inline bool
aff_combination_const_p (aff_tree *aff)
{
return (aff == NULL || aff->n == 0);
}
/* Return true iff AFF contains one (negated) singleton variable. Users need
to make sure AFF points to a valid combination. */
inline bool
aff_combination_singleton_var_p (aff_tree *aff)
{
return (aff->n == 1
&& aff->offset == 0
&& (aff->elts[0].coef == 1 || aff->elts[0].coef == -1));
}
#endif /* GCC_TREE_AFFINE_H */ #endif /* GCC_TREE_AFFINE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment