[llvm-commits] [llvm] r39851 - in /llvm/trunk: include/llvm/Support/ConstantRange.h lib/Support/ConstantRange.cpp

Duncan Sands baldrick at free.fr
Sat Jul 14 10:28:48 PDT 2007


Hi Nick,

> +  /// maximalIntersectWith - Return the range that results from the intersection
> +  /// of this range with another range.  The resultant range is guaranteed to
> +  /// include all elements contained in both input ranges, and is also
> +  /// guaranteed to be the smallest possible set that does so.

this should really be "a smallest possible set" since there can be two.
I guess by "smallest" you mean "with the minimal number of elements".
[The other possible definition, "smallest" = "contained in every interval
that contains the intersection", doesn't work on the circle].  There are
cases in which two intervals contain the intersection and have the smallest
possible number of elements (they go around the circle in different
directions) and then you presumably make an arbitrary choice.  Unfortunately
this means that maximalIntersection(A,B) and maximalIntersection(B,A) may
not be equal.  Probably this doesn't matter much.

Ciao,

Duncan.



More information about the llvm-commits mailing list