> On Dec 17, 2015, at 3:37 AM, Emanuel Zephir via swift-dev 
> <swift-dev@swift.org> wrote:
> 
> Okay, that works.
> 
> I have a few questions about SR-210:
> 
> 1) The attached patch adds support for undefined integer value-cases in the 
> switch_value instruction. What is the runtime meaning of this construct?

SIL 'undef' has the same meaning as LLVM's 'undef'. It means that the exact 
value isn't important and can be substituted with an arbitrary bit pattern. 
It's UB if the behavior of the program depends on the value of an undef, but 
safe if the undef can be eliminated, such as if it's dead, or eliminated by an 
operation like 'x & 0' or 'x - x' that's invariant of 'x'.

> 2) Are there any other SIL instructions in the select/switch family that need 
> modifications? If yes, which? At least some of them (e.g. select_value) don't 
> support this either.

'undef' ought to be parsed as part of the SIL value grammar. It'd be worth 
doing a pass to make sure we consistently use the same parsing rule everywhere 
we accept a value.

-Joe

> 3) Are there any areas that need special attention when writing tests and 
> otherwise validating this change?
> 
> 
> --Emanuel
> 
> On Wed, Dec 16, 2015 at 10:15 AM, Michael Gottesman <mgottes...@apple.com 
> <mailto:mgottes...@apple.com>> wrote:
> SGTM. If you want as you finish these, I have a list of them = ).
> 
> I just filed another one:
> 
> https://bugs.swift.org/browse/SR-247 <https://bugs.swift.org/browse/SR-247>
> 
> Michael
> 
>> On Dec 16, 2015, at 5:30 AM, Emanuel Zephir <emanuelzep...@gmail.com 
>> <mailto:emanuelzep...@gmail.com>> wrote:
>> 
>> Unless anyone objects, I'd like to claim this. I've assigned issue SR-210 to 
>> myself.
>> 
>> --Emanuel
>> 
>> On Sun, Dec 13, 2015 at 1:29 PM, Michael Gottesman via swift-dev 
>> <swift-dev@swift.org <mailto:swift-dev@swift.org>>wrote:
>> This is a small starter project for those who are interested in working with 
>> SIL.
>> 
>> The SIL Parser currently is unable to parse switch_enum of undef. I wrote a 
>> patch that does the work some time ago, but I never have had time to finish 
>> it (i.e. make sure everything works ok/write tests). I posted the patch in 
>> this issue:
>> 
>> https://bugs.swift.org/browse/SR-210 <https://bugs.swift.org/browse/SR-210>
>> 
>> My hope is that even though a lot of the work is already done this may serve 
>> as good starting point for someone who wants to poke at the SIL Parser (a 
>> part of the code base that has not gotten as much attention as others).
>> 
>> Michael
>> 
>> 
>> _______________________________________________
>> swift-dev mailing list
>> swift-dev@swift.org <mailto:swift-dev@swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-dev 
>> <https://lists.swift.org/mailman/listinfo/swift-dev>
>> 
>> 
> 
> 
>  _______________________________________________
> swift-dev mailing list
> swift-dev@swift.org <mailto:swift-dev@swift.org>
> https://lists.swift.org/mailman/listinfo/swift-dev 
> <https://lists.swift.org/mailman/listinfo/swift-dev>
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to