[llvm] [Passes][Inliner] Handle optsize/minsize via attributes only (PR #190168)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 2 07:46:41 PDT 2026
nikic wrote:
> > InlineParams already has separate threshold for OptSize/MinSize functions that get applied based on the corresponding function attributes. As such, we should not also be changing the DefaultThreshold based on the pipeline Os/Oz levels as well.
>
> If I pass `-Os` to the compiler, will it apply those function attributes to all functions?
If by "compiler" you mean clang or any other real frontend, then yes: https://clang.godbolt.org/z/vo8P7Yqsq
`opt -Os` will not apply them (thus the test changes to explicitly add the attribute). I plan to remove `opt -Os` entirely though (or maybe make it expand to `opt -O2 -force-attribute=minsize`).
https://github.com/llvm/llvm-project/pull/190168
More information about the llvm-commits
mailing list