Skip to content

Pass alloc-variant-zeroed to LLVM #144086

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

clubby789
Copy link
Contributor

@clubby789 clubby789 commented Jul 17, 2025

Makes use of llvm/llvm-project#138299 (once we pull in a version of LLVM with this attribute). Unfortunately also requires llvm/llvm-project#149336 to work.

Closes #104847

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 17, 2025
@clubby789 clubby789 added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Jul 17, 2025
@bors
Copy link
Collaborator

bors commented Jul 22, 2025

☔ The latest upstream changes (presumably #144249) made this pull request unmergeable. Please resolve the merge conflicts.

@clubby789 clubby789 removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Aug 13, 2025
@clubby789 clubby789 marked this pull request as ready for review August 13, 2025 13:30
@rustbot
Copy link
Collaborator

rustbot commented Aug 13, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 13, 2025
@clubby789
Copy link
Contributor Author

clubby789 commented Aug 13, 2025

r? compiler

edit: oops I guess that's automatic 😅

@rustbot rustbot assigned lcnr and unassigned fee1-dead Aug 13, 2025
@nikic
Copy link
Contributor

nikic commented Aug 13, 2025

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 13, 2025
Pass `alloc-variant-zeroed` to LLVM
@rust-bors

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 13, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Aug 13, 2025

💔 Test for f993fda failed: CI. Failed jobs:

@clubby789 clubby789 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 13, 2025
@nikic
Copy link
Contributor

nikic commented Aug 13, 2025

I think the alloc symbols are mangled nowadays, so we need to pass the symbols with the proper mangling.

@clubby789
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Aug 13, 2025
Pass `alloc-variant-zeroed` to LLVM
@rust-bors
Copy link

rust-bors bot commented Aug 13, 2025

☀️ Try build successful (CI)
Build commit: 2217f3f (2217f3f4ed5671c4c8e939f81fa2b0b1e68806d2, parent: 350d0ef0ec0493e6d21cfb265cb8211a0e74d766)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2217f3f): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.5% [0.1%, 14.7%] 67
Regressions ❌
(secondary)
0.3% [0.1%, 1.2%] 29
Improvements ✅
(primary)
-0.5% [-0.9%, -0.1%] 2
Improvements ✅
(secondary)
-0.3% [-0.5%, -0.2%] 12
All ❌✅ (primary) 0.4% [-0.9%, 14.7%] 69

Max RSS (memory usage)

Results (primary 0.7%, secondary 0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.8% [2.8%, 2.8%] 1
Regressions ❌
(secondary)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
-1.4% [-1.4%, -1.4%] 1
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) 0.7% [-1.4%, 2.8%] 2

Cycles

Results (primary 13.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
13.6% [13.6%, 13.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 13.6% [13.6%, 13.6%] 1

Binary size

Results (primary -0.1%, secondary 0.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.1%, 1.7%] 7
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 3
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 2
All ❌✅ (primary) -0.1% [-0.1%, -0.1%] 3

Bootstrap: 468.291s -> 469.62s (0.28%)
Artifact size: 377.36 MiB -> 377.37 MiB (0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Aug 13, 2025
@clubby789
Copy link
Contributor Author

Hmm, I'm surprised at the impact here, given that there isn't a hugely significant amount of work done on LLVM or Rust's side. Maybe this just causes the optimisation to fire much more often and/or the folding allows further optimisations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ER] Sub-optimal allocation of simple zeroed Vec of arrays
8 participants