[all-commits] [llvm/llvm-project] c672ba: [DebugInfo][RemoveDIs] Instrument inliner for non-...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Sun Nov 26 13:24:43 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c672ba7dde3a6ec2f6c89fcb207c9a6a8474cedc
      https://github.com/llvm/llvm-project/commit/c672ba7dde3a6ec2f6c89fcb207c9a6a8474cedc
  Author: Jeremy Morse <jeremy.morse at sony.com>
  Date:   2023-11-26 (Sun, 26 Nov 2023)

  Changed paths:
    M llvm/include/llvm/IR/DebugInfo.h
    M llvm/lib/IR/DebugInfo.cpp
    M llvm/lib/Transforms/Scalar/CallSiteSplitting.cpp
    M llvm/lib/Transforms/Scalar/JumpThreading.cpp
    M llvm/lib/Transforms/Utils/CloneFunction.cpp
    M llvm/lib/Transforms/Utils/CloneModule.cpp
    M llvm/lib/Transforms/Utils/InlineFunction.cpp
    A llvm/test/DebugInfo/Generic/inline-alloca-ordering.ll
    A llvm/test/DebugInfo/Generic/inline-dbg-values.ll
    M llvm/test/DebugInfo/Generic/inline-debug-loc.ll
    M llvm/test/Transforms/CallSiteSplitting/callsite-split-preserve-debug.ll
    M llvm/test/Transforms/Inline/alloca-dbgdeclare.ll
    M llvm/test/Transforms/Inline/delete-function-with-metadata-use.ll
    M llvm/test/Transforms/Inline/ignore-debug-info.ll
    M llvm/test/Transforms/Inline/inline-skip-use-empty-alloca.ll
    M llvm/test/Transforms/Inline/local-as-metadata-undominated-use.ll
    M llvm/test/Transforms/Inline/no-inline-line-tables.ll
    A llvm/test/Transforms/JumpThreading/guard-split-debuginfo.ll
    M llvm/test/Transforms/LoopUnroll/debug-info.ll

  Log Message:
  -----------
  [DebugInfo][RemoveDIs] Instrument inliner for non-instr debug-info (#72884)

With intrinsics representing debug-info, we just clone all the
intrinsics when inlining a function and don't think about it any
further. With non-instruction debug-info however we need to be a bit
more careful and manually move the debug-info from one place to another.
For the most part, this means keeping a "cursor" during block cloning of
where we last copied debug-info from, and performing debug-info copying
whenever we successfully clone another instruction.

There are several utilities in LLVM for doing this, all of which now
need to manually call cloneDebugInfo. The testing story for this is not
well covered as we could rely on normal instruction-cloning mechanisms
to do all the hard stuff. Thus, I've added a few tests to explicitly
test dbg.value behaviours, ahead of them becoming not-instructions.




More information about the All-commits mailing list