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 -Z small-data-threshold #117465

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

Conversation

paulmenage
Copy link
Contributor

This flag allows specifying the threshold size above which LLVM should not consider placing small objects in a .sdata or .sbss section.

@rustbot
Copy link
Collaborator

rustbot commented Oct 31, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @b-naber (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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 Oct 31, 2023
@paulmenage
Copy link
Contributor Author

paulmenage commented Oct 31, 2023

This is a more targeted version of what I was trying to achieve with #116555 (which would add -Z llvm-module-flag to enable the same goal on RISCV).

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@b-naber
Copy link
Contributor

b-naber commented Nov 17, 2023

Sorry for the late reply. I think this needs an MCP before it can be merged.

@bors
Copy link
Contributor

bors commented Nov 22, 2023

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

@b-naber
Copy link
Contributor

b-naber commented Dec 9, 2023

This could be merged now. Can you rebase?

@paulmenage
Copy link
Contributor Author

There's still some lack of clarity on the MCP zulip stream whether this is the right way to solve the problem, versus a target feature. I'll push the rebase but it's probably best to not merge it yet.

This flag allows specifying the threshold size above which LLVM should
not consider placing small objects in a .sdata or .sbss section.
@paulmenage
Copy link
Contributor Author

OK, the conclusion on the zulip chat appeared to be that a target feature wasn't the right approach, so I think this is ready.

@apiraino
Copy link
Contributor

@b-naber can you r+? If I understand this patch is ripe for merging. thanks.

@compiler-errors
Copy link
Member

r? compiler-errors @bors r+

@bors
Copy link
Contributor

bors commented Feb 5, 2024

📌 Commit a618f74 has been approved by compiler-errors

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 Feb 5, 2024
@klensy
Copy link
Contributor

klensy commented Feb 5, 2024

Can this emit (at least) warn if flag used with arch that isn't supported?

@compiler-errors
Copy link
Member

Funny because I was going to ask the same thing, but then I removed it. Given that someone else cares about the same thing, let's implement that warning then.

@bors r-

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 5, 2024
@paulmenage
Copy link
Contributor Author

Where would be the most appropriate place to put that check?

@paulmenage
Copy link
Contributor Author

Is there a way to issue a warning if a flag's value isn't used? Given the way LLVM supports small-data thresholds in two completely different ways (arg versus module flag) we'd be duplicating the arch checks if we put a warning at the top level. If we could check after the build that the flag had been used that would be less fragile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants