How to interpret the option `-finline-hint-functions`?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to interpret the option `-finline-hint-functions`?

Hans Wennborg via cfe-dev
Hi-

We have following clang options which are related to function inlining.

[1].  -finline-functions:      Inline suitable functions
[2].  -finline-hint-functions:      Inline functions which are (explicitly or implicitly) marked inline

My interpretation of [1] is that we inform the compiler - to take a decision about function inlining on its own discretion, that way, it may chose to inline few functions which are not explicitly marked with the `inline` keyword and may chose not to inline few functions which are explicitly marked with `inline` keyword.

Again, my interpretation of [2] is that we inform the compiler - to take a decision about function inlining on its own discretion, but, in this case, about only the functions which are explicitly marked with the `inline` keyword, nothing else.

Am I correct with my above understanding?

--
Thanks,
Mahesha

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to interpret the option `-finline-hint-functions`?

Hans Wennborg via cfe-dev
I believe you are correct. I think [1] is implied by most -O levels, and it mainly exists so that users can use the negative version of it, -fno-inline-functions. I think [2] exists to give users an in between level when the user finds the compiler's decisions to be too aggressive, either for performance or debugging reasons.

On Thu, Jan 30, 2020 at 9:35 AM Mahesha S via cfe-dev <[hidden email]> wrote:
Hi-

We have following clang options which are related to function inlining.

[1].  -finline-functions:      Inline suitable functions
[2].  -finline-hint-functions:      Inline functions which are (explicitly or implicitly) marked inline

My interpretation of [1] is that we inform the compiler - to take a decision about function inlining on its own discretion, that way, it may chose to inline few functions which are not explicitly marked with the `inline` keyword and may chose not to inline few functions which are explicitly marked with `inline` keyword.

Again, my interpretation of [2] is that we inform the compiler - to take a decision about function inlining on its own discretion, but, in this case, about only the functions which are explicitly marked with the `inline` keyword, nothing else.

Am I correct with my above understanding?

--
Thanks,
Mahesha
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: How to interpret the option `-finline-hint-functions`?

Hans Wennborg via cfe-dev
Thank you. It is even more clear to me now.

On Fri, Jan 31, 2020 at 12:10 AM Reid Kleckner <[hidden email]> wrote:
I believe you are correct. I think [1] is implied by most -O levels, and it mainly exists so that users can use the negative version of it, -fno-inline-functions. I think [2] exists to give users an in between level when the user finds the compiler's decisions to be too aggressive, either for performance or debugging reasons.

On Thu, Jan 30, 2020 at 9:35 AM Mahesha S via cfe-dev <[hidden email]> wrote:
Hi-

We have following clang options which are related to function inlining.

[1].  -finline-functions:      Inline suitable functions
[2].  -finline-hint-functions:      Inline functions which are (explicitly or implicitly) marked inline

My interpretation of [1] is that we inform the compiler - to take a decision about function inlining on its own discretion, that way, it may chose to inline few functions which are not explicitly marked with the `inline` keyword and may chose not to inline few functions which are explicitly marked with `inline` keyword.

Again, my interpretation of [2] is that we inform the compiler - to take a decision about function inlining on its own discretion, but, in this case, about only the functions which are explicitly marked with the `inline` keyword, nothing else.

Am I correct with my above understanding?

--
Thanks,
Mahesha
_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


--
Thanks,
Mahesha

_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev