[PATCH] D80264: [Instruction] Set metadata uses to undef on deletion

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 18:11:13 PDT 2020


vsk created this revision.
vsk added reviewers: jmorse, TWeaver, aprantl, dexonsmith.
Herald added subscribers: sstefan1, jfb, hiraditya, qcolombet, jholewinski.
Herald added a reviewer: jdoerfert.
Herald added a project: LLVM.
vsk updated this revision to Diff 265108.
vsk added a comment.

Remove accidentally included file.


Replace any extant metadata uses of a dying instruction with undef to
preserve debug info accuracy. Some alternatives include:

- Treat Instruction like any other Value, and point its extant metadata uses to an empty ValueAsMetadata node. This makes extant dbg.value uses trivially dead (i.e. fair game for deletion in many passes), leading to stale dbg.values being in effect for too long.

- Call salvageDebugInfoOrMarkUndef. Not needed to make instruction removal correct. OTOH results in wasted work in some common cases (e.g. when all instructions in a BasicBlock are deleted).

This came up while discussing some basic cases in
https://reviews.llvm.org/D80052.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80264

Files:
  llvm/lib/IR/Instruction.cpp
  llvm/test/DebugInfo/NVPTX/debug-addr-class.ll
  llvm/test/DebugInfo/NVPTX/debug-info.ll
  llvm/test/Transforms/SLPVectorizer/AArch64/spillcost-di.ll
  llvm/test/Transforms/SafeStack/X86/debug-loc2.ll
  llvm/unittests/IR/DebugInfoTest.cpp





More information about the llvm-commits mailing list