-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Describe lifetime of call argument temporaries passed indirectly #138489
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in compiler/rustc_codegen_ssa |
5e8a92c
to
dad5f19
Compare
dad5f19
to
653bbb9
Compare
r? codegen |
@@ -1049,7 +1049,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { | |||
(args, None) | |||
}; | |||
|
|||
let mut copied_constant_arguments = vec![]; | |||
// Keeps track of temporary allocas whose liftime need to be ended after the call. |
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.
typo, also slightly confusing wording to me, and often comments like this are written in the imperative, so perhaps this could be more like
// Keeps track of temporary allocas whose liftime need to be ended after the call. | |
// Keep track of temporary allocas with lifetimes that end after this call |
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.
The exact phrasing isn't too important tho' and I don't necessarily insist on the imperative, please feel free to revise as you see fit.
@@ -1049,7 +1049,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { | |||
(args, None) | |||
}; | |||
|
|||
let mut copied_constant_arguments = vec![]; | |||
// Keeps track of temporary allocas whose liftime need to be ended after the call. | |||
let mut lifetime_ends_after_call: Vec<(Bx::Value, Size)> = Vec::new(); |
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.
also comments should generally prefer to include "why": probably this?
let mut lifetime_ends_after_call: Vec<(Bx::Value, Size)> = Vec::new(); | |
// because we want to later emit things like `@llvm.lifetime.end` for them. | |
let mut lifetime_ends_after_call: Vec<(Bx::Value, Size)> = Vec::new(); |
let mut copied_constant_arguments = vec![]; | ||
// Keeps track of temporary allocas whose liftime need to be ended after the call. | ||
let mut lifetime_ends_after_call: Vec<(Bx::Value, Size)> = Vec::new(); |
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.
Also one thing we kinda lose here with this rename is that most of the entities in this list are arguments or owned by the effective arguments: that's why we accumulate them through codegen_argument
calls, then actually handle emitting llvm.lifetime.end
intrinsics and the like in do_call
. Without this explicitly being called out in the identifier's name, you have to then go read another few hundred lines of code to extract that. We could probably spare a line of commentary here on that subject.
I wonder |
This comment has been minimized.
This comment has been minimized.
Describe lifetime of call argument temporaries passed indirectly Fixes rust-lang#132014.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (9f0b7ad): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (primary 1.8%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: missing data |
Cool. I was just checking for regressions in other cases. |
Fixes #132014.