[llvm-commits] [LLVM, SwitchInst, case ranges] Auxiliary patch #1

Duncan Sands baldrick at free.fr
Thu Jan 5 10:17:25 PST 2012


Hi Stepan,

> Due to case-ranges feature (PR1255), we want to replace switch cases type: from ConstantInt to APInt. Of course it may be some new type, call it APIntEx. We need "less" comparison for this type, since we need to sort it sometimes. And it also should support initialized property.  I think that two this features will be useful for APInt itself. But of course it is possible to create new type. So, your suggestions. APIntEx for case values?

are you considering switch values to be unsigned?  In C they are signed, while
in Ada they can be either.  As a result you can get signed or unsigned case
ranges coming out of dragonegg.  Better to use wrapping ranges (like in LLVM's
ConstantRange abstraction) for which there is no difference between signed and
unsigned...

I'm not sure why you think you need "initialized" APInt's for case ranges...
As for the ULess struct, I reckon that would be better off in the file that
uses it.

Ciao, Duncan.

>
> -Stepan.
>
> 05.01.2012, 21:39, "Chris Lattner"<clattner at apple.com>:
>> On Jan 5, 2012, at 3:40 AM, Stepan Dyatkovskiy wrote:
>>
>>>   Of course. Two patches. The first one extends APInt. The second one extends SmallSet.
>>
>> I committed the SmallSet patch for you in r147607.  As Duncan points out up-thread, adding an 'initialized' field to APInt isn't appropriate.
>>
>> -Chris
>>
>>>   -Stepan.
>>>
>>>   Evan Cheng wrote:
>>>>   Where is the patch? Can you attach it again?
>>>>
>>>>   Thanks,
>>>>
>>>>   Evan
>>>>
>>>>   On Jan 3, 2012, at 10:51 AM, Stepan Dyatkovskiy wrote:
>>>>>   Ping.
>>>>>   --
>>>>>   Truly yours,
>>>>>   Stepan Dyatkovskiy
>>>>>
>>>>>   02.01.2012, 13:59, "Stepan Dyatkovskiy"<STPWORLD at narod.ru>:
>>>>>>   Ping again and again :-)
>>>>>>   -Stepan.
>>>>>>
>>>>>>   29.12.2011, 21:59, "Stepan Dyatkovskiy"<stpworld at narod.ru>:
>>>>>>>    Ping.
>>>>>>>    -Stepan.
>>>>>>>
>>>>>>>    Stepan Dyatkovskiy wrote:
>>>>>>>>     ping.
>>>>>>>>     Stepan Dyatkovskiy wrote:
>>>>>>>>>     Ping.
>>>>>>>>>
>>>>>>>>>     Stepan Dyatkovskiy wrote:
>>>>>>>>>>     Ping.
>>>>>>>>>>
>>>>>>>>>>     -Stepan.
>>>>>   _______________________________________________
>>>>>   llvm-commits mailing list
>>>>>   llvm-commits at cs.uiuc.edu
>>>>>   http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>>   <cr-apint.patch><cr-smallset.patch>_______________________________________________
>>>   llvm-commits mailing list
>>>   llvm-commits at cs.uiuc.edu
>>>   http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list