The constructed constraint may be a tautology in which case it needs
to be simplified away, especially if it is an equality.
We probably want to perform this simplification in
isl_basic_set_from_constraint instead, but CLooG currently depends
on the resulting basic set not being simplified.
We would have to fix CLooG first before we can change this behavior.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
__isl_give isl_basic_set *isl_aff_nonneg_basic_set(__isl_take isl_aff *aff)
{
isl_constraint *ineq;
+ isl_basic_set *bset;
ineq = isl_inequality_from_aff(aff);
- return isl_basic_set_from_constraint(ineq);
+ bset = isl_basic_set_from_constraint(ineq);
+ bset = isl_basic_set_simplify(bset);
+ return bset;
}
/* Return a basic set containing those elements in the space
__isl_give isl_basic_set *isl_aff_zero_basic_set(__isl_take isl_aff *aff)
{
isl_constraint *ineq;
+ isl_basic_set *bset;
ineq = isl_equality_from_aff(aff);
- return isl_basic_set_from_constraint(ineq);
+ bset = isl_basic_set_from_constraint(ineq);
+ bset = isl_basic_set_simplify(bset);
+ return bset;
}
/* Return a basic set containing those elements in the shared space