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

Allow codegen backends to opt-out of parallel codegen #116791

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

WaffleLapkin
Copy link
Member

This makes it a bit easier to write cursed codegen backends.

@rustbot
Copy link
Collaborator

rustbot commented Oct 16, 2023

r? @wesleywiser

(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 Oct 16, 2023
@rust-log-analyzer

This comment has been minimized.

@WaffleLapkin WaffleLapkin marked this pull request as draft October 16, 2023 12:11
@WaffleLapkin
Copy link
Member Author

I did changes against quite an old version and now it does not work, should have checked...

@WaffleLapkin WaffleLapkin 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 Oct 16, 2023
Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

@@ -383,6 +383,12 @@ impl<B: WriteBackendMethods> CodegenContext<B> {
}
}

impl<B: CodegenBackend + WriteBackendMethods> CodegenContext<B> {
pub fn parallel(&self) -> bool {
self.backend.supports_parallel() && !self.opts.unstable_opts.no_parallel_llvm
Copy link
Contributor

Choose a reason for hiding this comment

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

the name about llvm seems suboptimal (or should only be checked in codegen_llvm)

Copy link
Member

Choose a reason for hiding this comment

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

maybe no_parallel_backend?

And backend is one of parameters of start_executing_work so we can call supports_parallel inside it

@WaffleLapkin
Copy link
Member Author

WaffleLapkin commented Oct 16, 2023

(for reference, the problem with the build is that CodegenContext::backend field was removed, so I'll need to find some other way to call supports_parallel...)

@Dylan-DPC
Copy link
Member

@WaffleLapkin any updates on this?

@WaffleLapkin
Copy link
Member Author

@Dylan-DPC I still need to figure a way to fix conflicts

@WaffleLapkin
Copy link
Member Author

Ok, this was easier than I thought. Dunno why I procrastinated fixing conflicts for so long 😅
@rustbot review

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Feb 15, 2024
@WaffleLapkin WaffleLapkin marked this pull request as ready for review February 15, 2024 00:26
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 15, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Mar 11, 2024

r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned wesleywiser Mar 11, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Mar 11, 2024

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 11, 2024

📌 Commit f368922 has been approved by oli-obk

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 Mar 11, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 11, 2024
…r=oli-obk

Allow codegen backends to opt-out of parallel codegen

This makes it a bit easier to write cursed codegen backends.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 11, 2024
…kingjubilee

Rollup of 15 pull requests

Successful merges:

 - rust-lang#116791 (Allow codegen backends to opt-out of parallel codegen)
 - rust-lang#116793 (Allow targets to override default codegen backend)
 - rust-lang#117458 (LLVM Bitcode Linker: A self contained linker for nvptx and other targets)
 - rust-lang#119385 (Fix type resolution of associated const equality bounds (take 2))
 - rust-lang#121438 (std support for wasm32 panic=unwind)
 - rust-lang#121893 (Add tests (and a bit of cleanup) for interior mut handling in promotion and const-checking)
 - rust-lang#122080 (Clarity improvements to `DropTree`)
 - rust-lang#122152 (Improve diagnostics for parenthesized type arguments)
 - rust-lang#122166 (Remove the unused `field_remapping` field from `TypeLowering`)
 - rust-lang#122249 (interpret: do not call machine read hooks during validation)
 - rust-lang#122299 (Store backtrace for `must_produce_diag`)
 - rust-lang#122318 (Revision-related tweaks for next-solver tests)
 - rust-lang#122320 (Use ptradd for vtable indexing)
 - rust-lang#122328 (unix_sigpipe: Replace `inherit` with `sig_dfl` in syntax tests)
 - rust-lang#122330 (bootstrap readme: fix, improve, update)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 88d387b into rust-lang:master Mar 11, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Mar 11, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 11, 2024
Rollup merge of rust-lang#116791 - WaffleLapkin:unparallel-backends, r=oli-obk

Allow codegen backends to opt-out of parallel codegen

This makes it a bit easier to write cursed codegen backends.
TimNN added a commit to TimNN/rustc-dev-guide that referenced this pull request Apr 3, 2024
tshepang pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Apr 5, 2024
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.

8 participants