This API is used by BOLT to patch Abbrev section.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Some profiling of an internal service:
llvm-dwarfdump --debug-abbrev
Internal service
[46] .debug_abbrev PROGBITS 0000000000000000 11f847d18 11698d3 00 0 0 1
0:03.31 real, 2.98 user, 0.32 sys, 0 amem, 408924 mmem
BASE
0:03.11 real, 2.85 user, 0.25 sys, 0 amem, 308392 mmem
I tried on clang-14 but it was too noisy.
These values could be computed from the index in AttributeSpecs, right? Maybe that'd be better, rather than adding memory overhead to every use of libDebugInfoDWARF?
Sorry it's not clear to me how it can be calculated index in AttributeSpecs.
You mean like iterate over abbrev section and build a map?
Sorry, no, I mean this data is computed by the for loop in DWARFAbbreviationDeclaration::getAttributeValue, for instance - so the patch seems like it's proposing a shift in the time/space tradeoff (adding more memory usage to avoid having to do the compute/time work done by that loop in getAttributeValue) & I'm not sure that shift is necessarily justified - I'd be inclined to keep with the status quo and suggest these values should be recomputed when needed by walking the AttributeSpecs in a DWARFAbbreviationDeclaration.
Thanks for feedback. Abandoning this diff. @rafaelauler will look on our side how we can change implementation to avoid this.