[all-commits] [llvm/llvm-project] 2ec028: [DebugInfo][RemoveDIs] Emulate inserting insts in ...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Thu Nov 30 04:42:07 PST 2023


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

  Changed paths:
    M llvm/include/llvm/IR/BasicBlock.h
    M llvm/include/llvm/IR/DebugProgramInstruction.h
    M llvm/include/llvm/IR/Instruction.h
    M llvm/lib/IR/BasicBlock.cpp
    M llvm/lib/IR/DebugProgramInstruction.cpp
    M llvm/lib/IR/Instruction.cpp
    M llvm/unittests/IR/BasicBlockDbgInfoTest.cpp

  Log Message:
  -----------
  [DebugInfo][RemoveDIs] Emulate inserting insts in dbg.value sequences (#73350)

Here's a problem for the RemoveDIs project to make debug-info not be
stored in instructions -- in the following sequence:
    dbg.value(foo
    %bar = add i32 ...
    dbg.value(baz
It's possible for rare passes (only CodeGenPrepare) to remove the add
instruction, and then re-insert it back in the same place. When
debug-info is stored in instructions and there's a total order on "when"
things happen this is easy, but by moving that information out of the
instruction stream we start having to do manual maintenance.

This patch adds some utilities for re-inserting an instruction into a
sequence of DPValue objects. Someday we hope to design this away, but
for now it's necessary to support all the things you can do with
dbg.values. The two unit tests show how DPValues get shuffled around
using the relevant function calls. A follow-up patch adds
instrumentation to CodeGenPrepare.




More information about the All-commits mailing list