Lines 537-542
Link Here
|
537 |
(isl_local_space_from_space (isl_map_get_space (pbb->schedule))); |
537 |
(isl_local_space_from_space (isl_map_get_space (pbb->schedule))); |
538 |
|
538 |
|
539 |
val = isl_aff_get_coefficient_val (static_sched, isl_dim_in, i / 2); |
539 |
val = isl_aff_get_coefficient_val (static_sched, isl_dim_in, i / 2); |
|
|
540 |
gcc_assert (val && isl_val_is_int (val)); |
540 |
|
541 |
|
541 |
val = isl_val_neg (val); |
542 |
val = isl_val_neg (val); |
542 |
c = isl_constraint_set_constant_val (c, val); |
543 |
c = isl_constraint_set_constant_val (c, val); |
Lines 759-772
Link Here
|
759 |
|
760 |
|
760 |
/* Compute pwaff mod 2^width. */ |
761 |
/* Compute pwaff mod 2^width. */ |
761 |
|
762 |
|
762 |
extern isl_ctx *the_isl_ctx; |
|
|
763 |
|
764 |
static isl_pw_aff * |
763 |
static isl_pw_aff * |
765 |
wrap (isl_pw_aff *pwaff, unsigned width) |
764 |
wrap (isl_pw_aff *pwaff, unsigned width) |
766 |
{ |
765 |
{ |
767 |
isl_val *mod; |
766 |
isl_val *mod; |
768 |
|
767 |
|
769 |
mod = isl_val_int_from_ui(the_isl_ctx, width); |
768 |
mod = isl_val_int_from_ui (isl_pw_aff_get_ctx (pwaff), width); |
770 |
mod = isl_val_2exp (mod); |
769 |
mod = isl_val_2exp (mod); |
771 |
pwaff = isl_pw_aff_mod_val (pwaff, mod); |
770 |
pwaff = isl_pw_aff_mod_val (pwaff, mod); |
772 |
|
771 |
|
Lines 1045-1051
Link Here
|
1045 |
(isl_local_space_from_space (isl_space_copy (space))); |
1044 |
(isl_local_space_from_space (isl_space_copy (space))); |
1046 |
c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); |
1045 |
c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); |
1047 |
tree_int_to_gmp (nb_iters, g); |
1046 |
tree_int_to_gmp (nb_iters, g); |
1048 |
v = isl_val_int_from_gmp (the_isl_ctx, g); |
1047 |
v = isl_val_int_from_gmp (scop->ctx, g); |
1049 |
c = isl_constraint_set_constant_val (c, v); |
1048 |
c = isl_constraint_set_constant_val (c, v); |
1050 |
inner = isl_set_add_constraint (inner, c); |
1049 |
inner = isl_set_add_constraint (inner, c); |
1051 |
} |
1050 |
} |
Lines 1100-1106
Link Here
|
1100 |
c = isl_inequality_alloc |
1099 |
c = isl_inequality_alloc |
1101 |
(isl_local_space_from_space (isl_space_copy (space))); |
1100 |
(isl_local_space_from_space (isl_space_copy (space))); |
1102 |
c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); |
1101 |
c = isl_constraint_set_coefficient_si (c, isl_dim_set, pos, -1); |
1103 |
v = isl_val_int_from_gmp (the_isl_ctx, g); |
1102 |
v = isl_val_int_from_gmp (scop->ctx, g); |
1104 |
mpz_clear (g); |
1103 |
mpz_clear (g); |
1105 |
c = isl_constraint_set_constant_val (c, v); |
1104 |
c = isl_constraint_set_constant_val (c, v); |
1106 |
inner = isl_set_add_constraint (inner, c); |
1105 |
inner = isl_set_add_constraint (inner, c); |
Lines 1364-1370
Link Here
|
1364 |
c = isl_inequality_alloc (isl_local_space_from_space (space)); |
1363 |
c = isl_inequality_alloc (isl_local_space_from_space (space)); |
1365 |
mpz_init (g); |
1364 |
mpz_init (g); |
1366 |
tree_int_to_gmp (lb, g); |
1365 |
tree_int_to_gmp (lb, g); |
1367 |
v = isl_val_int_from_gmp (the_isl_ctx, g); |
1366 |
v = isl_val_int_from_gmp (scop->ctx, g); |
1368 |
v = isl_val_neg (v); |
1367 |
v = isl_val_neg (v); |
1369 |
mpz_clear (g); |
1368 |
mpz_clear (g); |
1370 |
c = isl_constraint_set_constant_val (c, v); |
1369 |
c = isl_constraint_set_constant_val (c, v); |
Lines 1384-1390
Link Here
|
1384 |
|
1383 |
|
1385 |
mpz_init (g); |
1384 |
mpz_init (g); |
1386 |
tree_int_to_gmp (ub, g); |
1385 |
tree_int_to_gmp (ub, g); |
1387 |
v = isl_val_int_from_gmp (the_isl_ctx, g); |
1386 |
v = isl_val_int_from_gmp (scop->ctx, g); |
1388 |
mpz_clear (g); |
1387 |
mpz_clear (g); |
1389 |
c = isl_constraint_set_constant_val (c, v); |
1388 |
c = isl_constraint_set_constant_val (c, v); |
1390 |
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1); |
1389 |
c = isl_constraint_set_coefficient_si (c, isl_dim_param, p, -1); |
Lines 1520-1539
Link Here
|
1520 |
domain. */ |
1519 |
domain. */ |
1521 |
|
1520 |
|
1522 |
static isl_set * |
1521 |
static isl_set * |
1523 |
pdr_add_data_dimensions (isl_set *extent, scop_p scop, data_reference_p dr) |
1522 |
pdr_add_data_dimensions (isl_set *subscript_sizes, scop_p scop, |
|
|
1523 |
data_reference_p dr) |
1524 |
{ |
1524 |
{ |
1525 |
tree ref = DR_REF (dr); |
1525 |
tree ref = DR_REF (dr); |
1526 |
int i, nb_subscripts = DR_NUM_DIMENSIONS (dr); |
|
|
1527 |
|
1526 |
|
1528 |
for (i = nb_subscripts - 1; i >= 0; i--, ref = TREE_OPERAND (ref, 0)) |
1527 |
int nb_subscripts = DR_NUM_DIMENSIONS (dr); |
|
|
1528 |
for (int i = nb_subscripts - 1; i >= 0; i--, ref = TREE_OPERAND (ref, 0)) |
1529 |
{ |
1529 |
{ |
1530 |
tree low, high; |
|
|
1531 |
|
1532 |
if (TREE_CODE (ref) != ARRAY_REF) |
1530 |
if (TREE_CODE (ref) != ARRAY_REF) |
1533 |
break; |
1531 |
return subscript_sizes; |
1534 |
|
1532 |
|
1535 |
low = array_ref_low_bound (ref); |
1533 |
tree low = array_ref_low_bound (ref); |
1536 |
high = array_ref_up_bound (ref); |
1534 |
tree high = array_ref_up_bound (ref); |
1537 |
|
1535 |
|
1538 |
/* XXX The PPL code dealt separately with |
1536 |
/* XXX The PPL code dealt separately with |
1539 |
subscript - low >= 0 and high - subscript >= 0 in case one of |
1537 |
subscript - low >= 0 and high - subscript >= 0 in case one of |
Lines 1551-1560
Link Here
|
1551 |
isl_aff *aff; |
1549 |
isl_aff *aff; |
1552 |
isl_set *univ, *lbs, *ubs; |
1550 |
isl_set *univ, *lbs, *ubs; |
1553 |
isl_pw_aff *index; |
1551 |
isl_pw_aff *index; |
1554 |
isl_space *space; |
|
|
1555 |
isl_set *valid; |
1552 |
isl_set *valid; |
1556 |
isl_pw_aff *lb = extract_affine_int (low, isl_set_get_space (extent)); |
1553 |
isl_space *space = isl_set_get_space (subscript_sizes); |
1557 |
isl_pw_aff *ub = extract_affine_int (high, isl_set_get_space (extent)); |
1554 |
isl_pw_aff *lb = extract_affine_int (low, isl_space_copy (space)); |
|
|
1555 |
isl_pw_aff *ub = extract_affine_int (high, isl_space_copy (space)); |
1558 |
|
1556 |
|
1559 |
/* high >= 0 */ |
1557 |
/* high >= 0 */ |
1560 |
valid = isl_pw_aff_nonneg_set (isl_pw_aff_copy (ub)); |
1558 |
valid = isl_pw_aff_nonneg_set (isl_pw_aff_copy (ub)); |
Lines 1562-1586
Link Here
|
1562 |
isl_set_dim (valid, isl_dim_set)); |
1560 |
isl_set_dim (valid, isl_dim_set)); |
1563 |
scop->context = isl_set_intersect (scop->context, valid); |
1561 |
scop->context = isl_set_intersect (scop->context, valid); |
1564 |
|
1562 |
|
1565 |
space = isl_set_get_space (extent); |
|
|
1566 |
aff = isl_aff_zero_on_domain (isl_local_space_from_space (space)); |
1563 |
aff = isl_aff_zero_on_domain (isl_local_space_from_space (space)); |
1567 |
aff = isl_aff_add_coefficient_si (aff, isl_dim_in, i + 1, 1); |
1564 |
aff = isl_aff_add_coefficient_si (aff, isl_dim_in, i + 1, 1); |
1568 |
univ = isl_set_universe (isl_space_domain (isl_aff_get_space (aff))); |
1565 |
univ = isl_set_universe (isl_space_domain (isl_aff_get_space (aff))); |
1569 |
index = isl_pw_aff_alloc (univ, aff); |
1566 |
index = isl_pw_aff_alloc (univ, aff); |
1570 |
|
1567 |
|
1571 |
id = isl_set_get_tuple_id (extent); |
1568 |
id = isl_set_get_tuple_id (subscript_sizes); |
1572 |
lb = isl_pw_aff_set_tuple_id (lb, isl_dim_in, isl_id_copy (id)); |
1569 |
lb = isl_pw_aff_set_tuple_id (lb, isl_dim_in, isl_id_copy (id)); |
1573 |
ub = isl_pw_aff_set_tuple_id (ub, isl_dim_in, id); |
1570 |
ub = isl_pw_aff_set_tuple_id (ub, isl_dim_in, id); |
1574 |
|
1571 |
|
1575 |
/* low <= sub_i <= high */ |
1572 |
/* low <= sub_i <= high */ |
1576 |
lbs = isl_pw_aff_ge_set (isl_pw_aff_copy (index), lb); |
1573 |
lbs = isl_pw_aff_ge_set (isl_pw_aff_copy (index), lb); |
1577 |
ubs = isl_pw_aff_le_set (index, ub); |
1574 |
ubs = isl_pw_aff_le_set (index, ub); |
1578 |
extent = isl_set_intersect (extent, lbs); |
1575 |
subscript_sizes = isl_set_intersect (subscript_sizes, lbs); |
1579 |
extent = isl_set_intersect (extent, ubs); |
1576 |
subscript_sizes = isl_set_intersect (subscript_sizes, ubs); |
1580 |
} |
1577 |
} |
1581 |
} |
1578 |
} |
1582 |
|
1579 |
|
1583 |
return extent; |
1580 |
return subscript_sizes; |
1584 |
} |
1581 |
} |
1585 |
|
1582 |
|
1586 |
/* Build data accesses for DR in PBB. */ |
1583 |
/* Build data accesses for DR in PBB. */ |
Lines 1590-1596
Link Here
|
1590 |
{ |
1587 |
{ |
1591 |
int dr_base_object_set; |
1588 |
int dr_base_object_set; |
1592 |
isl_map *acc; |
1589 |
isl_map *acc; |
1593 |
isl_set *extent; |
1590 |
isl_set *subscript_sizes; |
1594 |
scop_p scop = PBB_SCOP (pbb); |
1591 |
scop_p scop = PBB_SCOP (pbb); |
1595 |
|
1592 |
|
1596 |
{ |
1593 |
{ |
Lines 1617-1625
Link Here
|
1617 |
alias_set_num = *(bap->alias_set); |
1614 |
alias_set_num = *(bap->alias_set); |
1618 |
|
1615 |
|
1619 |
space = isl_space_set_tuple_id (space, isl_dim_set, id); |
1616 |
space = isl_space_set_tuple_id (space, isl_dim_set, id); |
1620 |
extent = isl_set_nat_universe (space); |
1617 |
subscript_sizes = isl_set_nat_universe (space); |
1621 |
extent = isl_set_fix_si (extent, isl_dim_set, 0, alias_set_num); |
1618 |
subscript_sizes = isl_set_fix_si (subscript_sizes, isl_dim_set, 0, |
1622 |
extent = pdr_add_data_dimensions (extent, scop, dr); |
1619 |
alias_set_num); |
|
|
1620 |
subscript_sizes = pdr_add_data_dimensions (subscript_sizes, scop, dr); |
1623 |
} |
1621 |
} |
1624 |
|
1622 |
|
1625 |
gcc_assert (dr->aux); |
1623 |
gcc_assert (dr->aux); |
Lines 1627-1633
Link Here
|
1627 |
|
1625 |
|
1628 |
new_poly_dr (pbb, dr_base_object_set, |
1626 |
new_poly_dr (pbb, dr_base_object_set, |
1629 |
DR_IS_READ (dr) ? PDR_READ : PDR_WRITE, |
1627 |
DR_IS_READ (dr) ? PDR_READ : PDR_WRITE, |
1630 |
dr, DR_NUM_DIMENSIONS (dr), acc, extent); |
1628 |
dr, DR_NUM_DIMENSIONS (dr), acc, subscript_sizes); |
1631 |
} |
1629 |
} |
1632 |
|
1630 |
|
1633 |
/* Write to FILE the alias graph of data references in DIMACS format. */ |
1631 |
/* Write to FILE the alias graph of data references in DIMACS format. */ |