-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Split join_codegen_and_link()
into two steps
#68601
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
r? @tmandry |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments, but looks great otherwise.
src/librustc_interface/queries.rs
Outdated
}) | ||
let codegen_results = codegen_backend.join_codegen(ongoing_codegen, &sess, &dep_graph)?; | ||
let prof = sess.prof.clone(); | ||
prof.generic_activity("drop_dep_graph").run(move || drop(dep_graph)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This drops dep_graph
before linking now, so this should reduce memory consumption during linking.
You will need to update the |
src/librustc_interface/queries.rs
Outdated
ongoing_codegen: ongoing_codegen.take(), | ||
codegen_backend, | ||
}) | ||
let codegen_results = codegen_backend.join_codegen(ongoing_codegen, &sess, &dep_graph)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is introducing a stall inside what looks kind of like an accessor, when there wasn't one before. I think there should be a comment on the function, at least. Also, double check that this doesn't seem like a problem at any call sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, and after a second thought, I think it makes more sense to keep join_codegen
in where join_codegen_and_link
was, so that behavior changes should be minimized.
I add a commit to the PR moving join_codegen
into Linker::link
to demonstrate the change, could you take a look?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, we can still drop dep_graph
before calling backend to link, so we should reduce similar memory consumption during linking, as if we join codegen inside Queries::linker()
.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
@bors r+ |
📌 Commit ff1a5a1f613a9ca42fa0ddcaf23da086f0cae390 has been approved by |
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
@bors r+ |
📌 Commit ae51d2b has been approved by |
Split `join_codegen_and_link()` into two steps `join_codegen_and_link()` is split to `join_codegen()` and `link()`.
☀️ Test successful - checks-azure |
join_codegen_and_link()
is split tojoin_codegen()
andlink()
.