[unittests] Derive Occupied from Unused when given.

When both, OccupiedAndKnown and Unused are given, use the former only
for the Known values. The relation Unused \union Occupied must always
hold.

This allows us to specify Known independently of Occupied. It is needed
for an artificial test case in https://reviews.llvm.org/D32025.

llvm-svn: 301284
This commit is contained in:
Michael Kruse 2017-04-25 00:30:42 +00:00
parent b745b740f9
commit a8b0be819a
1 changed files with 9 additions and 7 deletions

View File

@ -38,12 +38,19 @@ void completeLifetime(isl::union_set Universe, isl::union_map OccupiedAndKnown,
isl::union_set &Undef) {
auto ParamSpace = give(isl_union_set_get_space(Universe.keep()));
if (OccupiedAndKnown) {
if (Undef && !Occupied) {
assert(!Occupied);
Occupied = give(isl_union_set_subtract(Universe.copy(), Undef.copy()));
}
if (OccupiedAndKnown) {
assert(!Known);
Known = isl::union_map::empty(ParamSpace);
Occupied = OccupiedAndKnown.domain();
if (!Occupied)
Occupied = OccupiedAndKnown.domain();
OccupiedAndKnown.foreach_map([&Known](isl::map Map) -> isl::stat {
if (isl_map_has_tuple_name(Map.keep(), isl_dim_out) != isl_bool_true)
return isl::stat::ok;
@ -52,11 +59,6 @@ void completeLifetime(isl::union_set Universe, isl::union_map OccupiedAndKnown,
});
}
if (!Occupied) {
assert(Undef);
Occupied = give(isl_union_set_subtract(Universe.copy(), Undef.copy()));
}
if (!Undef) {
assert(Occupied);
Undef = give(isl_union_set_subtract(Universe.copy(), Occupied.copy()));