[swift-evolution] [REVIEW] SE-0193 - Cross-module inlining and specialization

Slava Pestov spestov at apple.com
Wed Dec 20 21:32:29 CST 2017


Hi Xiaodi,

Thanks for taking the time to look over the proposal.

> On Dec 20, 2017, at 7:01 PM, Xiaodi Wu via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Does this proposal fit well with the feel and direction of Swift?
> 
> Yes, with a caveat. It seems a little unfortunate that @inline(never) is spelled so differently from @inlinable. Probably too late to rename the former @noninlinable though. It'd be lovely though.

So @inline(never) is not the opposite of @inlinable, it is something completely different:

- @inline(never) impacts the optimizer’s behavior inside the module, where as @inlinable has no effect on callees inside a module.
- You can in fact define a function that is @inline(never) and @inlinable. This would allow the function to be specialized or otherwise emitted inside a client module, but neither the specialization nor the original function would ever be inlined.

I’d like the swift-evolution community to discuss @inline(never) and @inline(__always) at some point, but I think they’re sufficiently unrelated to this proposal that we should probably not try to fit them in.

Slava
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171220/1f63161e/attachment.html>


More information about the swift-evolution mailing list