Hmmm... why? Duncan Sands wrote:> Hi Stepan, > >> Well... each case is represented as pair<BB, vector<Range> >. Right? > > after thinking about this some more I think you are right to not use > ConstantRange, and instead to build your own set abstraction. > > Ciao, Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Hi Stepan,> Hmmm... why?because you basically want pairs (set, destination) where set could be a arbitrary set of integers. As in practice these sets are a union of a small number of intervals, the set abstraction should efficiently represent unions of intervals, but that's more of an optimization than anything else. Probably for the needs of switch lowering you will need to expose the underlying intervals, but the basic abstraction is a set. You could build it on top of ConstantRange if you like, but as most of ConstantRange is not very relevant, you could also quite reasonably build it some other way. In fact I was assuming that that's what you had in mind... Ciao, Duncan.> Duncan Sands wrote: >> Hi Stepan, >> >>> Well... each case is represented as pair<BB, vector<Range> >. Right? >> >> after thinking about this some more I think you are right to not use >> ConstantRange, and instead to build your own set abstraction. >> >> Ciao, Duncan. >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Hi Duncan, Yes. ConstantRange has a little bit different purposes instead. OK. I'll build another Range class then. -Stepan. Duncan Sands wrote:> Hi Stepan, > >> Hmmm... why? > > because you basically want pairs (set, destination) where set could be a > arbitrary set of integers. As in practice these sets are a union of a > small number of intervals, the set abstraction should efficiently represent > unions of intervals, but that's more of an optimization than anything else. > Probably for the needs of switch lowering you will need to expose the > underlying intervals, but the basic abstraction is a set. You could > build it > on top of ConstantRange if you like, but as most of ConstantRange is not > very > relevant, you could also quite reasonably build it some other way. In > fact I > was assuming that that's what you had in mind... > > Ciao, Duncan. > >> Duncan Sands wrote: >>> Hi Stepan, >>> >>>> Well... each case is represented as pair<BB, vector<Range> >. Right? >>> >>> after thinking about this some more I think you are right to not use >>> ConstantRange, and instead to build your own set abstraction. >>> >>> Ciao, Duncan. >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >