-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
-C inline-threshold
has no effect with new LLVM pass manager
#89742
Comments
cc @nikic |
Does this flag have an any actual usage? I don't think NewPM supports it directly, but we could map it to |
Not sure what you mean. This is a stable compiler flag and it's documented, so it should either work as intended or be removed.
On a side note, I noticed the new pass manager doing weird things when it comes to function inlining in general in some occasions:
This is when compiled with 1 codegen unit and any LTO. I wonder if it's related to this issue. |
Yes, my question is whether this flag should be removed (read: deprecated and ignored). This seems like rather dubious functionality to expose under a first-class
Probably the closer analogue to the old
I'd suggest filing a separate issue for that, with examples. I don't think this is really related to |
I'm not sure there's an equivalent for this flag in gcc. There's |
For gcc, several That said, this option going from working to doing nothing is user unfriendly -- at the very least, we should be printing a warning that users with a need to tune inlining should investigate LLVM specific flags. My team noticed a binary size increase of > 3% just from updating Rust, which was caused because this flag silently stopped doing anything. At first, we assumed that Rust had just gotten worse, and decided not to update to a newer nightly until the regression was fixed (we work in the embedded space, where a 3% increase exhausted our available ROM). After awhile it became clear it was not getting better, so I dug deeper and found this. Using |
The NewPM needs more love. |
The cited issues regarding binary weight or speed are important, but this only ever controlled a purely advisory instruction, unfortunately, so in a sense these results are "not broken". LLVM always was deciding to multiply the advisory impact of this on its own inlining heuristics by some value, possibly 1, and now LLVM has decided to multiply this directive by 0 instead. It also seems that the future of rustc is probably one that does not have a natural translation for The concerns regarding binary weight and speed are important, but there's no need to error on usage of this. We could start issuing a warning, yes, that it currently doesn't seem to do anything. It's not clear what a final future direction for this flag should be, but that warning, too, would be... well, purely advisory. And is probably fairly easy to implement with a bit of mucking about in T-lang might want to discuss this at their next convenience. |
We discussed this in today's @rust-lang/lang meeting. We feel that anything other than |
This is marked as help wanted, but it doesn't seem clear what the path to solve it is. Is there already a decision on whether to add a warning or deprecate the option? |
I think those are effectively the same thing, just a question of the precise wording for the warning. Support for the legacy pass manager has been removed recently, so
possibly with a
|
Would it make sense to translate |
Rollup merge of rust-lang#124712 - Enselic:deprecate-inline-threshold, r=pnkfelix Deprecate no-op codegen option `-Cinline-threshold=...` This deprecates `-Cinline-threshold` since using it has no effect. This has been the case since the new LLVM pass manager started being used, more than 2 years ago. Recommend using `-Cllvm-args=--inline-threshold=...` instead. Closes rust-lang#89742 which is E-help-wanted.
The compiler produces identical binaries whatever value is set.
In this example:
test_inner
is not inlined when compiled with-C opt-level=3 -C inline-threshold=9000
unless the new pass manager is manually disabled via-Z new-llvm-pass-manager=no
.https://rust.godbolt.org/z/TKGoz3h6n
Related: #61088
The text was updated successfully, but these errors were encountered: