-
Notifications
You must be signed in to change notification settings - Fork 13.3k
codegen: create DIVariables ahead of using them with llvm.dbg.declare. #68665
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
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit f397140 with merge e90b4ff2541f55c702a0fc68a959ef37bc8722a2... |
☀️ Try build successful - checks-azure |
r=me on implementation, pending timing results. |
@rust-timer build e90b4ff2541f55c702a0fc68a959ef37bc8722a2 |
@rust-timer build e90b4ff2541f55c702a0fc68a959ef37bc8722a2 I think I was just unlucky |
Queued e90b4ff2541f55c702a0fc68a959ef37bc8722a2 with parent 3024c4e, future comparison URL. |
@bjorn3 That looks like the same thing we saw on #48300 (comment).
|
(regressions marked bold) This PR seems to have the opposite effect of the SROA PR. The slow get faster, while the fast get slower. |
Actually, it should be impossible for this PR to have an effect for I just checked a hunch and we don't seem to be creating |
f397140
to
e35dfad
Compare
Assuming we're mostly seeing noise: |
📌 Commit e35dfad has been approved by |
codegen: create DIVariables ahead of using them with llvm.dbg.declare. Instead of having `rustc_codegen_llvm` bundle creation of a `DIVariable` and `llvm.dbg.declare` into a single operation, they are now two separate methods, and the `DIVariable` is created earlier, specifically when `mir::VarDebugInfo`s are being partitioned into locals. While this isn't currently needed, it's a prerequisite for #48300, which adds fragmented debuginfo, where one `mir::VarDebugInfo` has multiple parts of itself mapped to different `mir::Place`s. For debuggers to see one composite variable instead of several ones with the same name, we need to create a single `DIVariable` and share it between multiple `llvm.dbg.declare` calls, which are likely pointing to different MIR locals. That makes the `per_local_var_debug_info` partitioning a good spot to do this in, as we can create *exactly* one `DIVariable` per `mir::VarDebugInfo`, and refer to it as many things as needed. I'm opening this PR separately because I want to test its perf impact in isolation (see #48300 (comment)). r? @nagisa or @oli-obk cc @michaelwoerister @nikomatsakis
☀️ Test successful - checks-azure |
Instead of having
rustc_codegen_llvm
bundle creation of aDIVariable
andllvm.dbg.declare
into a single operation, they are now two separate methods, and theDIVariable
is created earlier, specifically whenmir::VarDebugInfo
s are being partitioned into locals.While this isn't currently needed, it's a prerequisite for #48300, which adds fragmented debuginfo, where one
mir::VarDebugInfo
has multiple parts of itself mapped to differentmir::Place
s.For debuggers to see one composite variable instead of several ones with the same name, we need to create a single
DIVariable
and share it between multiplellvm.dbg.declare
calls, which are likely pointing to different MIR locals.That makes the
per_local_var_debug_info
partitioning a good spot to do this in, as we can create exactly oneDIVariable
permir::VarDebugInfo
, and refer to it as many things as needed.I'm opening this PR separately because I want to test its perf impact in isolation (see #48300 (comment)).
r? @nagisa or @oli-obk cc @michaelwoerister @nikomatsakis