[LLVMdev] ConstantRange in PR1255

Duncan Sands baldrick at free.fr
Thu Apr 26 04:18:06 PDT 2012


Hi Stepan,

> unionWith result is differs from set union, since it produces single set always
> while set operations may produce two sets.

this is true, but that's inevitable if the result is to be a single
ConstantRange.  You can of course define methods that returns a pair
of ConstantRanges and does what you want.  But why do you need these
methods anyway?  A "switch" is just going to be a (probably ordered)
list of disjoint ranges.  Where do set operations come in?

Ciao, Duncan.

>
> E.g.:
> For ranges
> [1, 5) and [10,15)
> unionWith produces [1,15), while set union should just keep these sets without
> changing, probably with indication that sets are not intersected. Implementation
> of set union is simple though.
>
> The "symmetric difference" implementation is little bit more complex.
> For two sets
> [1,15) and [7,12)
> symmetric difference is pair of ranges:
> [1,7) and [12,15)
>
> I propose to implement these methods in ConstantRange (I can do it).
>
> -Stepan.
>
>
>
>
>




More information about the llvm-dev mailing list