Is there a way to @NoInline a func or method?


(Karl Pickett) #1

Two use cases:

1. poking around in the asm for learning. Currently one can work around by
putting funcs in different files and not using -whole-module, but it is
time consuming and ugly.
2. Profiling an existing program. When a class method calls another
method in the same class, I don't have a workaround to not inline it.

Also, is there a -fno-optimize-sibling-calls equivalent for swiftc? I
don't have a pressing use but was just wondering, because it was shown in
the WWDC videos as being helpful for profiling.

Thanks,

- Karl


(Mish Awadah) #2

Maybe I don’t understand the depth of your question, but a cursory Google search turns up this: http://stackoverflow.com/questions/27881051/is-there-a-way-in-swift-to-declare-an-inline-function

- mish

···

On Dec 10, 2015, at 8:23 AM, Karl Pickett via swift-users <swift-users@swift.org> wrote:

Two use cases:

1. poking around in the asm for learning. Currently one can work around by putting funcs in different files and not using -whole-module, but it is time consuming and ugly.
2. Profiling an existing program. When a class method calls another method in the same class, I don't have a workaround to not inline it.

Also, is there a -fno-optimize-sibling-calls equivalent for swiftc? I don't have a pressing use but was just wondering, because it was shown in the WWDC videos as being helpful for profiling.

Thanks,

- Karl
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users


(Karl Pickett) #3

Thanks. I filed a bug to have@inline documented.

···

On Thu, Dec 10, 2015 at 12:04 PM, Mish Awadah <mawadah@apple.com> wrote:

Maybe I don’t understand the depth of your question, but a cursory Google
search turns up this:
http://stackoverflow.com/questions/27881051/is-there-a-way-in-swift-to-declare-an-inline-function

- mish

On Dec 10, 2015, at 8:23 AM, Karl Pickett via swift-users < > swift-users@swift.org> wrote:

Two use cases:

1. poking around in the asm for learning. Currently one can work around
by putting funcs in different files and not using -whole-module, but it is
time consuming and ugly.
2. Profiling an existing program. When a class method calls another
method in the same class, I don't have a workaround to not inline it.

Also, is there a -fno-optimize-sibling-calls equivalent for swiftc? I
don't have a pressing use but was just wondering, because it was shown in
the WWDC videos as being helpful for profiling.

Thanks,

- Karl
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users