[PATCH] D93662: [SimplifyCFG] Keep !dgb metadata of moved instruction, if they match.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 4 03:31:43 PST 2021
fhahn added a comment.
In D93662#2476793 <https://reviews.llvm.org/D93662#2476793>, @vsk wrote:
> In its current form, the rule for preserving debug locs doesn't seem to apply here (https://llvm.org/docs/HowToUpdateDebugInfo.html#when-to-preserve-an-instruction-location). Imho we ought to revise the guidance there before proceeding with this patch (e.g. by adding some carveout for when the destination debug loc is the same). If you can share, it might also help to have a little context - unless there's some intervening optimization, the dwarf generator's location cascade should kick in in this situation?
The use case I am looking at is optimization remarks, which use `!dbg` to tie remarks back to the high-level source code. I am working on remarks that use `!dbg` to group together instructions that originated from the same place in the original source. For that, it is very convenient if all instructions have accurate `!dbg` metadata. With what you said earlier, it might be good to also scan forwards/backwards to the next instruction with `!dbg` and use that.
I don't know much about how `!dbg` is actually used by the debuggers, but it seems like a rule like `if an instruction is moved to a new insert point and the instruction at the insert point has the same debug location as the moved instruction the location can be preserved on the moved instruction` should not regress the debug experience. And in some cases, it might be beneficial, e.g. in case later optimization move the same instructions around again. What do you think?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93662/new/
https://reviews.llvm.org/D93662
More information about the llvm-commits
mailing list