summaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.h
diff options
context:
space:
mode:
authorSebastian Pop <pop@cri.ensmp.fr>2006-04-02 06:27:40 +0200
committerSebastian Pop <spop@gcc.gnu.org>2006-04-02 04:27:40 +0000
commite2157b49e6ebff6aff00a3868aef4c56bb09052c (patch)
tree83a4359437b9ecf688ad5a570bc8501f4db08ebd /gcc/tree-chrec.h
parenta84481aacbf798637896bf82b7992872421691e1 (diff)
tree-scalar-evolution.c (add_to_evolution_1): Pass an extra argument at_stmt.
* tree-scalar-evolution.c (add_to_evolution_1): Pass an extra argument at_stmt. Convert the type of operands before calling build_polynomial_chrec. (add_to_evolution): Pass an extra argument at_stmt. Adjust the call to add_to_evolution_1. (follow_ssa_edge_in_rhs): Adjust call to add_to_evolution. (instantiate_parameters_1): Convert the type of operands before calling build_polynomial_chrec. * tree-chrec.c (chrec_fold_poly_cst, chrec_fold_plus_poly_poly, chrec_fold_multiply_poly_poly, chrec_replace_initial_condition, reset_evolution_in_loop): Insert asserts to check the types of the operands. (chrec_type): Moved... (eq_evolutions_p): Use operand_equal_p. * tree-chrec.h (build_polynomial_chrec): Insert an assert to check the types of the operands. (chrec_type): ...here. * tree-data-ref.c (create_data_ref): Convert the operands before calling chrec_replace_initial_condition. (same_access_functions, analyze_subscript_affine_affine, analyze_miv_subscript, all_chrecs_equal_p): Use eq_evolutions_p. (compute_subscript_distance, analyze_ziv_subscript, analyze_siv_subscript_cst_affine, compute_overlap_steps_for_affine_1_2, analyze_miv_subscript): Convert the operands before calling chrec_fold_minus or chrec_fold_plus. From-SVN: r112621
Diffstat (limited to 'gcc/tree-chrec.h')
-rw-r--r--gcc/tree-chrec.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h
index 55f6e978545..bc5c7782201 100644
--- a/gcc/tree-chrec.h
+++ b/gcc/tree-chrec.h
@@ -69,7 +69,6 @@ extern tree chrec_fold_minus (tree, tree, tree);
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);
@@ -106,6 +105,8 @@ build_polynomial_chrec (unsigned loop_num,
|| 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);
}
@@ -208,4 +209,16 @@ no_evolution_in_loop_p (tree chrec, unsigned loop_num, bool *res)
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 */