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

Add -Zcross-crate-inline-threshold=yes #117650

Merged
merged 1 commit into from Nov 8, 2023

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Nov 7, 2023

@thomcc says this would be useful for

seeing if it makes a difference in some code if i do it when building the sysroot, since -Zbuild-std + lto helps more than it seems like it should

And I've changed the possible values as a reference to @Manishearth saying

LLVM's inlining heuristic is "yes".

@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2023

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 7, 2023
@rustbot
Copy link
Collaborator

rustbot commented Nov 7, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

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

I think this makes sense, and it's a change to a nightly flag so I don't think it needs any team sign-off.

@davidtwco
Copy link
Member

Are there any tests for -Zcross-crate-inline-threshold which you could add to?

@saethlin
Copy link
Member Author

saethlin commented Nov 7, 2023

No, and there ought to be. I'll add that.

@nikic
Copy link
Contributor

nikic commented Nov 7, 2023

I don't really understand why this would be a useful option, but the option name/value combination doesn't make sense to me. This looks to me like it enables the cross crate inline threshold, not that it sets it to infinity. Should this be s/yes/always?

@saethlin
Copy link
Member Author

saethlin commented Nov 7, 2023

I don't really understand why this would be a useful option

The point is to compare with a build where enabling LTO produces a significant perf improvement. If this flag produces a similar improvement, then it is possible to get that improvement by applying #[inline]. If this flag does not, then there is something else about LTO which is responsible.

This looks to me like it enables the cross crate inline threshold, not that it sets it to infinity

Well currently, it isn't the same as setting the threshold to infinity, because no matter what numeric value you pass, non-leaf functions will never be made cross-crate-inlinable. Cross-crate-inlining does not have a proper cost model yet because so far all my attempts to develop one have resulted in significant regressions in incremental build times.

@davidtwco
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 8, 2023

📌 Commit fcdd99e has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 8, 2023
fmease added a commit to fmease/rust that referenced this pull request Nov 8, 2023
…twco

Add -Zcross-crate-inline-threshold=yes

`@thomcc` says this would be useful for

>  seeing if it makes a difference in some code if i do it when building the sysroot, since -Zbuild-std + lto helps more than it seems like it should

And I've changed the possible values as a reference to `@Manishearth` saying

> LLVM's inlining heuristic is "yes".
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#114316 (Add AIX platform support document)
 - rust-lang#117531 (rustdoc: properly elide cross-crate host effect args)
 - rust-lang#117650 (Add -Zcross-crate-inline-threshold=yes)
 - rust-lang#117663 (bump some deps)
 - rust-lang#117667 (Document clippy_config in nightly-rustc docs)
 - rust-lang#117698 (Clarify `space_between`)
 - rust-lang#117700 (coverage: Rename the `run-coverage` test mode to `coverage-run`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8198864 into rust-lang:master Nov 8, 2023
11 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Nov 8, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 8, 2023
Rollup merge of rust-lang#117650 - saethlin:inline-me-please, r=davidtwco

Add -Zcross-crate-inline-threshold=yes

``@thomcc`` says this would be useful for

>  seeing if it makes a difference in some code if i do it when building the sysroot, since -Zbuild-std + lto helps more than it seems like it should

And I've changed the possible values as a reference to ``@Manishearth`` saying

> LLVM's inlining heuristic is "yes".
@saethlin saethlin deleted the inline-me-please branch November 8, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants