[PATCH] D142556: [DebugInfo] Merge partially matching chains of inlined locations

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 05:47:08 PST 2023


dstenb added a comment.

In D142556#4080303 <https://reviews.llvm.org/D142556#4080303>, @dblaikie wrote:

> Oh, neat idea - but I wonder what it does to the DIE tree, rather than just the line table? Do we end up with 3 inlined_subroutines? (one for each of the original calls, if tehy have any unique instructions after inlining, then one for this sythesized call? I guess that's not strictly worse - the instructions were from some sort of inlining... )

Yes, we will end up with 3 inlined_subroutines in the example above (as both original calls have unique instructions):

  $ grep -A7 DW_TAG_inlined_subroutine after.txt
  0x00000066:     DW_TAG_inlined_subroutine
                    DW_AT_abstract_origin	(0x0000004a "foo")
                    DW_AT_low_pc	(0x00000000000006d1)
                    DW_AT_high_pc	(0x00000000000006da)
                    DW_AT_call_file	("/upstream/llvm-project/a.c")
                    DW_AT_call_line	(14)
                    DW_AT_call_column	(0x03)
  
  0x00000073:       DW_TAG_inlined_subroutine
                      DW_AT_abstract_origin	(0x0000003d "bar")
                      DW_AT_low_pc	(0x00000000000006d1)
                      DW_AT_high_pc	(0x00000000000006da)
                      DW_AT_call_file	("/upstream/llvm-project/a.c")
                      DW_AT_call_line	(10)
                      DW_AT_call_column	(0x03)
  
  --
  0x00000081:     DW_TAG_inlined_subroutine
                    DW_AT_abstract_origin	(0x0000004a "foo")
                    DW_AT_low_pc	(0x00000000000006da)
                    DW_AT_high_pc	(0x00000000000006e3)
                    DW_AT_call_file	("/upstream/llvm-project/a.c")
                    DW_AT_call_line	(15)
                    DW_AT_call_column	(0x03)
  
  0x0000008e:       DW_TAG_inlined_subroutine
                      DW_AT_abstract_origin	(0x0000003d "bar")
                      DW_AT_low_pc	(0x00000000000006da)
                      DW_AT_high_pc	(0x00000000000006e3)
                      DW_AT_call_file	("/upstream/llvm-project/a.c")
                      DW_AT_call_line	(10)
                      DW_AT_call_column	(0x03)
  
  --
  0x0000009c:     DW_TAG_inlined_subroutine
                    DW_AT_abstract_origin	(0x0000004a "foo")
                    DW_AT_low_pc	(0x00000000000006e7)
                    DW_AT_high_pc	(0x00000000000006ec)
                    DW_AT_call_file	("/upstream/llvm-project/a.c")
                    DW_AT_call_line	(0)
  
  0x000000a8:       DW_TAG_inlined_subroutine
                      DW_AT_abstract_origin	(0x0000003d "bar")
                      DW_AT_low_pc	(0x00000000000006e7)
                      DW_AT_high_pc	(0x00000000000006ec)
                      DW_AT_call_file	("/upstream/llvm-project/a.c")
                      DW_AT_call_line	(10)
                      DW_AT_call_column	(0x03)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142556/new/

https://reviews.llvm.org/D142556



More information about the llvm-commits mailing list