isl_map_intersect: special case obviously equal inputs
When operating on functions on a shared domain, it is not uncommon
for this domain to get intersected with itself.
If the domain is described by multiple disjuncts and
if these disjuncts are not mutually disjoint, then each
such intersection will result in a doubling of the number
of disjuncts.
Detect this special case and simply return one of the inputs
if the two inputs are obviously equal.
Do so after the special casing for adding a single constraint
introduced in
isl-0.01-131-ged3b444376 (isl_map_intersect:
add special case for adding a single constraint,
Sun Dec 6 11:54:41 2009 +0100). The motivation for that change
is rather terse, but it was presumably meant to speed up
the successive addition of individual constraints.
Introducing an implicit normalization in this process
can slow it down without bringing any significant benefits.
This is similar to the change in
isl-0.12.1-222-g1a5d6c3c78
(isl_map_union: special case obviously equal inputs,
Tue Feb 4 11:20:45 2014 +0100).
As in that commit, this commit also ends up modifying
some of the AST generation test cases because
the check for obviously equal inputs normalizes
the constraints of those inputs.
Signed-off-by: Sven Verdoolaege <sven.verdoolaege@gmail.com>