Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't pass -fno-inline-functions when -Oz/-Os are used #17843

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Sep 13, 2022

We have no reason not to let clang use its own heuristics here.

As a followup we can consider completely removing the INLINGING_LIMIT setting since it no longer serves any purpose other than to set this clang flag.

@sbc100 sbc100 requested review from kripken and aheejin September 13, 2022 16:55
@kripken
Copy link
Member

kripken commented Sep 13, 2022

This does seem like the right thing to me. However reading the code size changes my impression is the opposite of yours - seems to be more regressions than wins, and some seem significant (e.g. metadce_cxx_noexcept and random_printf). Perhaps it's worth looking into those a little more - might be system libs we should use -Oz over -Os, or even -Oz -fno-inline-functions?

@sbc100
Copy link
Collaborator Author

sbc100 commented Sep 13, 2022

Adding back -fno-inline-functions to system library builds to avoid any code size regressions.

@sbc100 sbc100 force-pushed the implicit_inlining_limit branch from bce4a33 to 653a2c6 Compare September 13, 2022 17:56
@sbc100 sbc100 enabled auto-merge (squash) September 13, 2022 18:10
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, lgtm.

If one of us has time eventually it might be interesting to look into the system lib flags and check if they are optimal. But seems low priority to me.

@sbc100 sbc100 disabled auto-merge September 13, 2022 21:46
We have no reason not to let clang use its own heuristics here.

As a followup we can consider completely removing the `INLINGING_LIMIT`
setting since it no longer serves any purpose other than to set this
clang flag.

This change comes with come code size wins and some losses due to the
fact that some system libraries are compiled with `-Os` or `-Oz`.  The
interesting changes seem to mostly be wins.
@sbc100 sbc100 force-pushed the implicit_inlining_limit branch from 653a2c6 to 8a5c2ca Compare September 13, 2022 21:50
@sbc100 sbc100 enabled auto-merge (squash) September 13, 2022 21:50
@sbc100 sbc100 merged commit fff3775 into main Sep 13, 2022
@sbc100 sbc100 deleted the implicit_inlining_limit branch September 13, 2022 22:53
sbc100 added a commit that referenced this pull request Sep 15, 2022
sbc100 added a commit that referenced this pull request Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants