[llvm-commits] [patch][pr12251] Add range metadata to llvm. Make clang produce it.

Duncan Sands baldrick at free.fr
Fri Mar 23 09:57:54 PDT 2012


Hi Rafael,

>> I don't think that's a reason to not use the ConstantRange class, it is a
>> reason to have the verifier reject attempts to form an empty or a full range
>> though.  So I think you should have ranges be [A, B) but explain that empty
>> and full ranges are not allowed.  Indeed forming one of these probably means
>> that the front-end writer made a mistake.
>
> Note that I do want to use ConstantRange in the implementation, I am
> just not sure about exposing that in the IL.

OK, that's fair.  One good thing about [A, B) is that someone working with i32
who wants to represent [0, 2^32-1] will say to themselves: "oh no, I need to
output [0, 2^32) but I can't represent that in 32 bits", and then realize that
they were being silly wanting to output this range in the first place :)

Ciao, Duncan.



More information about the llvm-commits mailing list