codegen: create DIVariables ahead of using them with llvm.dbg.declare.#68665
codegen: create DIVariables ahead of using them with llvm.dbg.declare.#68665bors merged 3 commits intorust-lang:masterfrom
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_llvmbundle creation of aDIVariableandllvm.dbg.declareinto a single operation, they are now two separate methods, and theDIVariableis created earlier, specifically whenmir::VarDebugInfos are being partitioned into locals.While this isn't currently needed, it's a prerequisite for #48300, which adds fragmented debuginfo, where one
mir::VarDebugInfohas multiple parts of itself mapped to differentmir::Places.For debuggers to see one composite variable instead of several ones with the same name, we need to create a single
DIVariableand share it between multiplellvm.dbg.declarecalls, which are likely pointing to different MIR locals.That makes the
per_local_var_debug_infopartitioning a good spot to do this in, as we can create exactly oneDIVariablepermir::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