[swift-dev] [swift] master: Turn on dynamic super method dispatch by default (bd8d85d)

David Farler dfarler at apple.com
Mon Jan 18 20:36:45 CST 2016


> On Jan 18, 2016, at 11:33 AM, Chris Lattner <clattner at apple.com> wrote:
> 
> 
>> On Jan 17, 2016, at 2:49 PM, David Farler <dfarler at apple.com <mailto:dfarler at apple.com>> wrote:
>> 
>>>>   Turn on dynamic super method dispatch by default
>>>> 
>>>>   This removes the -use-native-super-method flag and turns on dynamic
>>>>   dispatch for native method invocations on super by default.
>>>> 
>>>>   rdar://problem/22749732 <rdar://problem/22749732>
>>> 
>>> Random question: does this still use static dispatch when the superclass is within the same resilience domain, or is it the SIL optimizer’s job to handle that?
>>> 
>>> -Chris
>> 
>> In SILGen, when the method isn't final, it does always emits a super_method instruction, but Roman added devirtualizer support for these, and it does look like they are getting optimized down to static dispatch when the nearest implementation is in the same module.
> 
> Good news, thanks.  Would it make sense for -O0 perf to have SILGen generate the static dispatch when possible, or is it too much trouble for the benefit?
> 
> -Chris

Actually it looks like it would be trivial to do it during SILGen, although looking at some generated code with TOT the devirtualizer is already kicking in for these at -Onone. Is there still a benefit from doing it earlier on? 

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160118/c6da68f1/attachment.html>


More information about the swift-dev mailing list