/* Chains of recurrences.
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
- Contributed by Sebastian Pop <s.pop@laposte.net>
+ Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ Contributed by Sebastian Pop <pop@cri.ensmp.fr>
This file is part of GCC.
#ifndef GCC_TREE_CHREC_H
#define GCC_TREE_CHREC_H
-/* Accessors for the chains of recurrences. */
-#define CHREC_VAR(NODE) TREE_OPERAND (NODE, 0)
-#define CHREC_LEFT(NODE) TREE_OPERAND (NODE, 1)
-#define CHREC_RIGHT(NODE) TREE_OPERAND (NODE, 2)
-#define CHREC_VARIABLE(NODE) TREE_INT_CST_LOW (CHREC_VAR (NODE))
-
-\f
-
/* The following trees are unique elements. Thus the comparison of another
element to these elements should be done on the pointer to these trees,
and not on their value. */
extern tree chrec_fold_multiply (tree, tree, tree);
extern tree chrec_convert (tree, tree, tree);
extern tree chrec_convert_aggressive (tree, tree);
-extern tree chrec_type (tree);
/* Operations. */
extern tree chrec_apply (unsigned, tree, tree);
extern tree chrec_merge (tree, tree);
/* Observers. */
+extern bool eq_evolutions_p (tree, tree);
extern bool is_multivariate_chrec (tree);
extern bool chrec_is_positive (tree, bool *);
extern bool chrec_contains_symbols (tree);
|| right == chrec_dont_know)
return chrec_dont_know;
+ gcc_assert (TREE_TYPE (left) == TREE_TYPE (right));
+
return build3 (POLYNOMIAL_CHREC, TREE_TYPE (left),
build_int_cst (NULL_TREE, loop_num), left, right);
}
return true;
}
+/* Returns the type of the chrec. */
+
+static inline tree
+chrec_type (tree chrec)
+{
+ if (automatically_generated_chrec_p (chrec))
+ return NULL_TREE;
+
+ return TREE_TYPE (chrec);
+}
+
+
#endif /* GCC_TREE_CHREC_H */