[all-commits] [llvm/llvm-project] eaffcc: [DebugInfo][RemoveDIs] Make dropping variable loca...

Jeremy Morse via All-commits all-commits at lists.llvm.org
Mon Nov 20 16:01:14 PST 2023


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

  Changed paths:
    M llvm/lib/IR/DebugInfo.cpp
    M llvm/lib/Transforms/Scalar/ADCE.cpp
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    M llvm/test/Transforms/ADCE/adce-salvage-dbg-value.ll
    M llvm/test/Transforms/ADCE/debug-info-intrinsic.ll
    M llvm/test/Transforms/SimplifyCFG/return-merge.ll
    M llvm/test/Transforms/SimplifyCFG/speculate-dbgvalue.ll

  Log Message:
  -----------
  [DebugInfo][RemoveDIs] Make dropping variable locations explicit (#72399)

In present-day debug-info, when you delete all instructions, you delete
all their debug-info with it because debug-info is stored in
instructions. With debug-info stored in DPValue objects however,
deleting instructions causes DPValue objects to clump together into a
large blob of debug-info that hangs around in the block, as nothing has
explicitly deleted it.

To restore this behaviour, scatter calls to dropDbgValues around in
places that used to delete chunks of dbg.values, for example during
stripDebugInfo and in the code that deletes everything after an
Unreachable instruction. DCE is another example.

The tests with --try... added to them are new scenarios where we can now
correctly replicate the "normal" debug-info behaviour. Alas, there's no
explicit test for the opt -strip-debug option though (in dbg.value mode
or DPValue mode).




More information about the All-commits mailing list