diff options
author | Jeremy Morse <jeremy.morse@sony.com> | 2024-07-18 15:22:07 +0100 |
---|---|---|
committer | Jeremy Morse <jeremy.morse@sony.com> | 2024-07-18 15:55:06 +0100 |
commit | 676efd0ffb717215c752f200fe14163732290dcc (patch) | |
tree | c9f01b3a21e1e1df19c88eb497822eb07df2a235 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | f6b06b42a3f4f59ff33da20d42358f2768eaf726 (diff) | |
download | llvm-676efd0ffb717215c752f200fe14163732290dcc.zip llvm-676efd0ffb717215c752f200fe14163732290dcc.tar.gz llvm-676efd0ffb717215c752f200fe14163732290dcc.tar.bz2 |
Reapply 078198f310d5 "Index DebugVariables and some DILocations"
Now revised to actually make the unit test compile, which I'd been
ignoring. No actual functional change, it's a type difference.
Original commit message follows.
[DebugInfo][InstrRef] Index DebugVariables and some DILocations (#99318)
A lot of time in LiveDebugValues is spent computing DenseMap keys for
DebugVariables, and they're made up of three pointers, so are large.
This patch installs an index for them: for the SSA and value-to-location
mapping parts of InstrRefBasedLDV we don't need to access things like
the variable declaration or the inlining site, so just use a uint32_t
identifier for each variable fragment that's tracked. The compile-time
performance improvements are substantial (almost 0.4% on the tracker).
About 80% of this patch is just replacing DebugVariable references with
DebugVariableIDs instead, however there are some larger consequences. We
spend lots of time fetching DILocations when emitting DBG_VALUE
instructions, so index those with the DebugVariables: this means all
DILocations on all new DBG_VALUE instructions will normalise to the
first-seen DILocation for the variable (which should be fine).
We also used to keep an ordering of when each variable was seen first in
a DBG_* instruction, in the AllVarsNumbering collection, so that we can
emit new DBG_* instructions in a stable order. We can hang this off the
DebugVariable index instead, so AllVarsNumbering is deleted.
Finally, rather than ordering by AllVarsNumbering just before DBG_*
instructions are linked into the output MIR, store instructions along
with their DebugVariableID, so that they can be sorted by that instead.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions