[llvm-dev] llvm-dwarfdump stats for inlined functions
Djordje Todorovic via llvm-dev
llvm-dev at lists.llvm.org
Thu Apr 29 03:25:35 PDT 2021
Hi Paul,
Thanks for your response.
I also think that "inlined function without abstract origin" could be better stats.
>I don’t *think* we ever emit an inlined_subroutine without an abstract origin? If we want to make it an assertion on the emission side, that would be fine. In fact, now that we omit DW_TAG_formal_parameter where the parameter has been optimized away, it’s probably a good idea to have an assertion like that.
Sure, thanks. I am not sure either whether we emit such `inlined_subroutine`, but we can make an assertion within the AsmPrinter, and to see if there is a situation like that.
Best regards,
Djordje
________________________________
From: paul.robinson at sony.com <paul.robinson at sony.com>
Sent: Wednesday, April 28, 2021 5:02 PM
To: Djordje Todorovic <Djordje.Todorovic at syrmia.com>
Cc: asowda at cisco.com <asowda at cisco.com>; llvm-dev at lists.llvm.org <llvm-dev at lists.llvm.org>
Subject: RE: [llvm-dev] llvm-dwarfdump stats for inlined functions
Pedantically, DW_AT_abstract_origin is not required on a DW_TAG_inlined_subroutine; the DWARF spec says a concrete instance “may” omit attributes not specific to that instance, in which case there will be an abstract origin that will have those attributes. It then goes on to point out that declaration coordinates (DW_AT_decl_[file,line,column]) are for the declaration, not the inlining site, which makes them good candidates for hoisting to the abstract origin.
That is, DW_AT_abstract_origin is a way to optimize for size; it isn’t mandatory. So, I think llvm-dwarfdump is correct to allow it. I might prefer that “inlined functions without abstract origin” be what’s called out separately, rather than the “with” case, as the “without” cases represent a likely opportunity for size reduction.
I don’t *think* we ever emit an inlined_subroutine without an abstract origin? If we want to make it an assertion on the emission side, that would be fine. In fact, now that we omit DW_TAG_formal_parameter where the parameter has been optimized away, it’s probably a good idea to have an assertion like that.
--paulr
From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Djordje Todorovic via llvm-dev
Sent: Wednesday, April 28, 2021 7:12 AM
To: llvm-dev <llvm-dev at lists.llvm.org>
Cc: asowda at cisco.com
Subject: [llvm-dev] llvm-dwarfdump stats for inlined functions
Hi,
As discussed on the https://reviews.llvm.org/D101025<https://urldefense.com/v3/__https:/reviews.llvm.org/D101025__;!!JmoZiZGBv3RvKRSx!p1JI3vREt1U9y0e7eU5KzIYOZy_bS-TM7CS1N8x6VtUXLtdwkALSba9mVadBYExR-Q$>, we have noticed that there are two different stat categories for inlined functions when using `llvm-dwarfdump –statistics`:
# inlined functions
# inlined functions with abstract origin
and it was introduced after the D58849. We were wondering if there is a particular motivation of doing so.
Having an inlined_subroutine DIE with no abstract_origin attribute does not have so many benefits, so it might be better if we have an assertion/error (e.g., in the AsmPrinter) when we face such situation (or just to avoid dumping it into the final DWARF).
Any thoughts?
Best regards,
Djordje
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210429/9b3cd72c/attachment.html>
More information about the llvm-dev
mailing list