[all-commits] [llvm/llvm-project] 80d3a4: [DebugInfo][RemoveDIs] Add local-utility plumbing ...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Mon Nov 20 08:56:47 PST 2023


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

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/Local.h
    M llvm/lib/IR/BasicBlock.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/test/DebugInfo/salvage-cast-debug-info.ll
    M llvm/test/DebugInfo/salvage-gep.ll
    M llvm/test/Transforms/InstCombine/debuginfo-dce.ll
    M llvm/test/Transforms/InstCombine/salvage-dbg-declare.ll
    M llvm/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
    M llvm/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
    M llvm/test/Transforms/Mem2Reg/dbg-inline-scope-for-phi.ll
    M llvm/test/Transforms/Mem2Reg/dbg_declare_to_value_conversions.ll
    M llvm/test/Transforms/Mem2Reg/debug-alloca-phi-2.ll
    M llvm/test/Transforms/Mem2Reg/debug-alloca-phi.ll
    M llvm/test/Transforms/Mem2Reg/debug-alloca-vla-1.ll
    M llvm/test/Transforms/Mem2Reg/debug-alloca-vla-2.ll
    M llvm/test/Transforms/Reassociate/undef_intrinsics_when_deleting_instructions.ll
    M llvm/test/Transforms/SROA/dbg-inline.ll
    M llvm/test/Transforms/SROA/dbg-single-piece.ll
    M llvm/test/Transforms/SafeStack/X86/debug-loc-dynamic.ll
    M llvm/test/Transforms/SafeStack/X86/debug-loc.ll
    M llvm/test/Transforms/SafeStack/X86/debug-loc2.ll
    M llvm/test/Transforms/SimplifyCFG/tail-merge-noreturn.ll
    M llvm/test/Transforms/Util/salvage-debuginfo.ll

  Log Message:
  -----------
  [DebugInfo][RemoveDIs] Add local-utility plumbing for DPValues (#72276)

This patch re-implements a variety of debug-info maintenence functions
to use DPValues instead of DbgValueInst's: supporting the "new"
non-intrinsic representation of debug-info. As per [0], we need to have
parallel implementations of various utilities for a time, and these are
the most fundamental utilities used throughout the compiler.

I've added --try-experimental-debuginfo-iterators to a variety of RUN
lines: this is a flag that turns on "new debug-info" if it's built into
LLVM, and not otherwise. This should ensure that we have the same
behaviour for the same IR inputs, but using a different internal
representation. For the most part these changes affect SROA/Mem2Reg
promotion of dbg.declares into dbg.value intrinsics (now DPValues),
we're leaving dbg.declares as instructions until later in the day.
There's also some salvaging changes made.

I believe the tests that I've added cover almost all the code being
updated here. The only thing I'm not confident about is SimplifyCFG,
which calls rewriteDebugUsers down a variety of code paths. Those
changes can't immediately get full coverage as an additional patch is
needed that updates handling of Unreachable instructions, will upload
that shortly.

[0]
https://discourse.llvm.org/t/rfc-instruction-api-changes-needed-to-eliminate-debug-intrinsics-from-ir/68939/9




More information about the All-commits mailing list