isl_map_union: special case obviously equal inputs
commit1a5d6c3c78b3bcd5c3c46f0268557a84bfb5185c
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 4 Feb 2014 10:20:45 +0000 (4 11:20 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Mar 2014 19:02:10 +0000 (2 20:02 +0100)
tree71bcdb1bbd37fdffdae1d7c60540e46e59bbcca6
parentff3486c2252241572490b774dd79e0bbeeb0ee2a
isl_map_union: special case obviously equal inputs

The original implementation of isl_map_union simply collects
the basic maps in both input maps, even if some of these basic
maps or even the entire two inputs maps are essentially the same.
Repeatedly calling isl_map_union on pairs of equal input maps
would therefore result in an explosion in the number of basic maps.

If the inputs are obviously equal, we now simply return one of the inputs
rather than duplicating the basic maps.  In future, we may also like
to add special cases for indentical basic maps inside the inputs,
even when those inputs are not completely identical.

As a side effect, this commit also modifies some of the test cases because
the check for obviously equal inputs normalizes the constraints of those inputs.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c
test_inputs/codegen/cloog/classen.c
test_inputs/codegen/cloog/reservoir-liu-zhuge1.c
test_inputs/codegen/cloog/vasilache.c
test_inputs/codegen/cloog/vivien.c
test_inputs/codegen/cloog/vivien2.c
test_inputs/codegen/omega/wak1-0.c
test_inputs/codegen/omega/wak1-1.c
test_inputs/codegen/omega/x-0.c
test_inputs/codegen/omega/x-1.c
test_inputs/codegen/shift2.c