summaryrefslogtreecommitdiff
path: root/gcc/tree-chrec.h
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-02 04:27:40 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-02 04:27:40 +0000
commitf84a688a6b56c057f6fea740c87d9618880e4c2d (patch)
tree83a4359437b9ecf688ad5a570bc8501f4db08ebd /gcc/tree-chrec.h
parent2af73e54863b22653f079af0f2e75ef47dcd0685 (diff)
downloadgcc-f84a688a6b56c057f6fea740c87d9618880e4c2d.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112621 138bc75d-0d04-0410-961f-82ee72b054a4
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 */