[PATCH] D141067: [DebugInfo] Do not replace Instruction uses with undef

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 5 08:50:52 PST 2023


Orlando created this revision.
Orlando added reviewers: StephenTozer, scott.linder, jryans, jmorse.
Orlando added a project: debug-info.
Herald added subscribers: hiraditya, qcolombet.
Herald added a project: All.
Orlando requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead.
Herald added a project: LLVM.

The patch series that contains D140901 <https://reviews.llvm.org/D140901> changes empty metadata operands (`!{}`) to mean the same thing as `undef` in debug intrinsics. Therefore, we no longer need this code which performs a RAUW(this, undef/poison) on deletion.

Deleting an Instruction with debug uses will now result in the same behaviour as non-Instruction Values. First, `ValueAsMetadata::handleDeletion` will RAUW(nullptr). For single-operand debug intrinsics `MatadataAsValue::handleChangedMetadata` converts that to an empty tuple `!{}`. For variadic debug intrinsics uses `DIArgList::handleChangedOperand`  converts that to `poison`.


https://reviews.llvm.org/D141067

Files:
  llvm/lib/IR/Instruction.cpp
  llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/phi.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/single-block-alloca.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/mem2reg/single-store-alloca.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/slp-vectorizer/merge-scalars.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/after-inlining.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/complex.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/frag.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/id.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/memcpy.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/rewrite.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/store.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/unspecified-var-size.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/user-memcpy.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-1.ll
  llvm/test/DebugInfo/Generic/assignment-tracking/sroa/vec-2.ll
  llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-di.ll
  llvm/test/Transforms/SROA/alignment.ll
  llvm/test/Transforms/SafeStack/X86/debug-loc2.ll
  llvm/unittests/IR/DebugInfoTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141067.486593.patch
Type: text/x-patch
Size: 30842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230105/fb35c17b/attachment.bin>


More information about the llvm-commits mailing list