[all-commits] [llvm/llvm-project] c23608: [DebugInfo][RemoveDIs] Don't pointlessly scan func...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Fri Jan 26 01:53:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c23608b8d58bdeb0134d99168e6d0335da2c8366
      https://github.com/llvm/llvm-project/commit/c23608b8d58bdeb0134d99168e6d0335da2c8366
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2024-01-26 (Fri, 26 Jan 2024)

  Changed paths:
    M llvm/include/llvm/IR/BasicBlock.h
    M llvm/lib/IR/BasicBlock.cpp
    M llvm/lib/IR/Function.cpp

  Log Message:
  -----------
  [DebugInfo][RemoveDIs] Don't pointlessly scan funcs for debug-info (#79327)

The utility functions this patch modifies are part of cleanly
transitioning from a context where we use dbg.value intrinsics to one
where we use DPValue objects to record debug-info, and back again.
However, this is a waste of time in non-debug builds (i.e. no -g on the
command line). We still have to call the function on all blocks though
to set the IsNewDbgInfoFormat flag.

To reduce the overhead of this, test whether there's any debug-info in
the function by checking whether the function has a DISubprogram, and
pass a flag down to the utility functions indicating whether they can
skip the scan.

It feels a bit dumb to me now that we're scanning and setting a flag in
a load of blocks when we don't have to -- however it's been really
valuable during development for working out where spurious dbg.value
intrinsics leak into a RemoveDIs context. Happily we'll be able to just
delete this flag entirely when RemoveDIs lands and sticks, and the
conversion routines will eventually be pushed down into the debug-info
autoupgrade path.




More information about the All-commits mailing list