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

[do not merge] Use LLD ICF=safe for compiling rustc #99455

Closed
wants to merge 1 commit into from

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Jul 19, 2022

Since #99062, which used icf=all, had to be reverted because of linker errors, I want to see if using icf=safe provides any cycle/binary size benefits.

r? @ghost

@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jul 19, 2022
@Kobzol
Copy link
Contributor Author

Kobzol commented Jul 19, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 19, 2022
@bors
Copy link
Contributor

bors commented Jul 19, 2022

⌛ Trying commit 889afe2 with merge 7d5533de50ff92ab3569671a9d08d30453c9ca2e...

@bors
Copy link
Contributor

bors commented Jul 19, 2022

☀️ Try build successful - checks-actions
Build commit: 7d5533de50ff92ab3569671a9d08d30453c9ca2e (7d5533de50ff92ab3569671a9d08d30453c9ca2e)

@rust-timer
Copy link
Collaborator

Queued 7d5533de50ff92ab3569671a9d08d30453c9ca2e with parent 96c2df8, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7d5533de50ff92ab3569671a9d08d30453c9ca2e): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
0.3% 0.3% 2
Regressions 😿
(secondary)
2.5% 2.5% 3
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-0.4% -0.4% 1
All 😿🎉 (primary) 0.3% 0.3% 2

Max RSS (memory usage)

Results
  • Primary benchmarks: mixed results
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
8.5% 8.5% 1
Regressions 😿
(secondary)
2.9% 5.4% 10
Improvements 🎉
(primary)
-1.8% -2.3% 7
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -0.5% 8.5% 8

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-2.9% -7.4% 18
Improvements 🎉
(secondary)
-3.5% -6.1% 44
All 😿🎉 (primary) -2.9% -7.4% 18

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 19, 2022
@Kobzol
Copy link
Contributor Author

Kobzol commented Jul 19, 2022

Interesting! icf=safe doesn't really improve binary size, but the cycle wins are still there. I guess that most of the cycle wins actually come from lld itself, as they were also present when only lld without ICF was used. @matthiaskrgr could you please try if rustc 7d5533de50ff92ab3569671a9d08d30453c9ca2e works for you?

@matthiaskrgr
Copy link
Member

./toolchains/7d5533de50ff92ab3569671a9d08d30453c9ca2e/bin/rustc: symbol lookup error: ./toolchains/7d5533de50ff92ab3569671a9d08d30453c9ca2e/bin/rustc: undefined symbol: _ZN3std2rt19lang_start_internal17hc4ce26e998d6538dE

:(

@Kobzol
Copy link
Contributor Author

Kobzol commented Jul 19, 2022

@matthiaskrgr Could you please also try 986e50fc1e83d611bf485cf02723d7bd89a093b8? That one is lld only, without ICF.

@matthiaskrgr
Copy link
Member

same

/home/matthias/.rustup/toolchains/986e50fc1e83d611bf485cf02723d7bd89a093b8/bin/rustc: symbol lookup error: /home/matthias/.rustup/toolchains/986e50fc1e83d611bf485cf02723d7bd89a093b8/bin/../lib/librustc_driver-8fd17062f1c0f9c7.so: undefined symbol: _ZN9hashbrown3raw11Fallibility17capacity_overflow17hb2863c36cff2e6c5E

@Kobzol
Copy link
Contributor Author

Kobzol commented Jul 19, 2022

Then it seems like a lld issue. @lqd Have you met similar lld errors while compiling Rust programs with lld? Maybe the problem is that we use the "stock" lld instead of the rust-lld? I'm not sure how (if) they differ though.

@Mark-Simulacrum
Copy link
Member

Closing, since we figured out what was wrong here. (LD_LIBRARY_PATH set in environment).

@Kobzol Kobzol deleted the lld-icf-safe branch July 25, 2022 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants