This is an archive of the discontinued LLVM Phabricator instance.

[DWARF] Add findAttribute to DWARFAbbreviationDeclaration
AbandonedPublic

Authored by ayermolo on Aug 10 2021, 6:19 PM.

Details

Reviewers
dblaikie
Summary

This API is used by BOLT to patch Abbrev section.

Diff Detail

Event Timeline

ayermolo created this revision.Aug 10 2021, 6:19 PM
ayermolo requested review of this revision.Aug 10 2021, 6:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 10 2021, 6:19 PM

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.

ayermolo updated this revision to Diff 365772.Aug 11 2021, 9:21 AM

clang-format

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?

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?

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.

ayermolo abandoned this revision.Sep 1 2021, 12:39 PM
ayermolo added a subscriber: rafaelauler.

Thanks for feedback. Abandoning this diff. @rafaelauler will look on our side how we can change implementation to avoid this.