summaryrefslogtreecommitdiff
path: root/isl_band.c
diff options
context:
space:
mode:
Diffstat (limited to 'isl_band.c')
-rw-r--r--isl_band.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/isl_band.c b/isl_band.c
index a0ecd675..6ca853f7 100644
--- a/isl_band.c
+++ b/isl_band.c
@@ -55,12 +55,12 @@ __isl_give isl_band *isl_band_dup(__isl_keep isl_band *band)
return NULL;
dup->n = band->n;
- dup->zero = isl_alloc_array(ctx, int, band->n);
- if (!dup->zero)
+ dup->coincident = isl_alloc_array(ctx, int, band->n);
+ if (band->n && !dup->coincident)
goto error;
for (i = 0; i < band->n; ++i)
- dup->zero[i] = band->zero[i];
+ dup->coincident[i] = band->coincident[i];
dup->pma = isl_union_pw_multi_aff_copy(band->pma);
dup->schedule = band->schedule;
@@ -96,17 +96,19 @@ __isl_give isl_band *isl_band_copy(__isl_keep isl_band *band)
* schedule), then we also need to decrement the reference count of the
* containing schedule as it was incremented in isl_band_copy.
*/
-void *isl_band_free(__isl_take isl_band *band)
+__isl_null isl_band *isl_band_free(__isl_take isl_band *band)
{
if (!band)
return NULL;
- if (--band->ref > 0)
- return isl_schedule_free(band->schedule);
+ if (--band->ref > 0) {
+ isl_schedule_free(band->schedule);
+ return NULL;
+ }
isl_union_pw_multi_aff_free(band->pma);
isl_band_list_free(band->children);
- free(band->zero);
+ free(band->coincident);
free(band);
return NULL;
@@ -136,10 +138,10 @@ int isl_band_n_member(__isl_keep isl_band *band)
return band ? band->n : 0;
}
-/* Is the given scheduling dimension zero distance within the band and
- * with respect to the proximity dependences.
+/* Is the given scheduling dimension coincident within the band and
+ * with respect to the coincidence constraints.
*/
-int isl_band_member_is_zero_distance(__isl_keep isl_band *band, int pos)
+int isl_band_member_is_coincident(__isl_keep isl_band *band, int pos)
{
if (!band)
return -1;
@@ -148,7 +150,7 @@ int isl_band_member_is_zero_distance(__isl_keep isl_band *band, int pos)
isl_die(isl_band_get_ctx(band), isl_error_invalid,
"invalid member position", return -1);
- return band->zero[pos];
+ return band->coincident[pos];
}
/* Return the schedule that leads up to this band.
@@ -654,7 +656,7 @@ static int isl_band_drop(__isl_keep isl_band *band, int pos, int n)
band->pma = sched;
for (i = pos + n; i < band->n; ++i)
- band->zero[i - n] = band->zero[i];
+ band->coincident[i - n] = band->coincident[i];
band->n -= n;