[all-commits] [llvm/llvm-project] da0f9e: Reland: [MC] output inlined-at debug info (#106230...

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Tue Mar 11 06:43:36 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: da0f9e75d8588bf0adb54060ee77656edfdc1207
      https://github.com/llvm/llvm-project/commit/da0f9e75d8588bf0adb54060ee77656edfdc1207
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2025-03-11 (Tue, 11 Mar 2025)

  Changed paths:
    M llvm/include/llvm/MC/MCObjectStreamer.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCObjectStreamer.cpp
    M llvm/lib/MC/MCStreamer.cpp
    A llvm/test/CodeGen/AMDGPU/dbg-info-inline-at.ll
    M llvm/test/CodeGen/XCore/dwarf_debug.ll
    M llvm/test/DebugInfo/X86/inline-seldag-test.ll

  Log Message:
  -----------
  Reland: [MC] output inlined-at debug info (#106230) (#130306)

Reland https://github.com/llvm/llvm-project/pull/106230

The original PR was reverted due to compilation time regression.

This PR fixed that by adding a condition OutStreamer->isVerboseAsm() to
the generation of extra inlined-at debug info, so that it does not
affect normal compilation time.

Currently MC print source location of instructions in comments in
assembly when debug info is available, however, it does not include
inlined-at locations when a function is inlined.

For example, function foo is defined in header file a.h and is called
multiple times in b.cpp. If foo is inlined, current assembly will only
show its instructions with their line numbers in a.h. With inlined-at
locations, the assembly will also show where foo is called in b.cpp.

This patch adds inlined-at locations to the comments by using
DebugLoc::print. It makes the printed source location info consistent
with those printed by machine passes.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list