summaryrefslogtreecommitdiff
path: root/gcc/graphite-ppl.h
diff options
context:
space:
mode:
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-21 22:57:59 +0000
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-21 22:57:59 +0000
commit4c48fb0e5fd4cc75add17a1c88aa74608faff390 (patch)
treeab76d08fcdd37605200b9cce9a27a5b59935ea1f /gcc/graphite-ppl.h
parente45543a044c82ce9f537ef8b3e5504c4d164e32d (diff)
downloadgcc-4c48fb0e5fd4cc75add17a1c88aa74608faff390.tar.gz
Infer types based on lb and ub.
2011-07-21 Sebastian Pop <sebastian.pop@amd.com> PR middle-end/47654 PR middle-end/49649 * graphite-clast-to-gimple.c (type_for_clast_term): Pass v1 and v2 in parameter. Initialize v1 and v2 based on the values returned by clast_name_to_lb_ub. (type_for_clast_red): Pass v1 and v2 in parameter, and set their values. (type_for_clast_bin): Same. (type_for_clast_expr): Same. (type_for_clast_eq): Update calls to type_for_clast_expr. (type_for_clast_for): Same. (build_iv_mapping): Same. * graphite-ppl.h (value_min): New. * gcc.dg/graphite/run-id-pr47654.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176605 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/graphite-ppl.h')
-rw-r--r--gcc/graphite-ppl.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/graphite-ppl.h b/gcc/graphite-ppl.h
index 49bde618f47..5820e19927d 100644
--- a/gcc/graphite-ppl.h
+++ b/gcc/graphite-ppl.h
@@ -124,6 +124,17 @@ ppl_set_coef_tree (ppl_Linear_Expression_t e, ppl_dimension_type i, tree x)
mpz_clear (v);
}
+/* Sets RES to the min of V1 and V2. */
+
+static inline void
+value_min (mpz_t res, mpz_t v1, mpz_t v2)
+{
+ if (mpz_cmp (v1, v2) < 0)
+ mpz_set (res, v1);
+ else
+ mpz_set (res, v2);
+}
+
/* Sets RES to the max of V1 and V2. */
static inline void