[PATCH] D55513: [DeadArgElim] Fixes for dbg.values using dead arg/return values

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 10 07:56:23 PST 2018


dstenb created this revision.
dstenb added reviewers: dblaikie, aprantl, vsk, djtodoro.
dstenb added a project: debug-info.
Herald added a subscriber: llvm-commits.

When eliminating a dead argument or return value in a function with
local linkage, all uses, including in dbg.value intrinsics, would be
replaced with null constants. This would mean that, for example for an
integer argument, the debug info would incorrectly express that the
value is 0. Instead, replace all uses with undef to indicate that the
argument/return value is optimized out.

Also, make sure that metadata uses of return values are rewritten even
if there are no non-metadata uses of the value.

As a bit of historical curiosity, the code that emitted null constants
was introduced in the initial check-in of the pass in 2003, before
'undef' values even existed in LLVM.

This fixes PR23260.


Repository:
  rL LLVM

https://reviews.llvm.org/D55513

Files:
  lib/Transforms/IPO/DeadArgumentElimination.cpp
  test/Transforms/DeadArgElim/dbginfo-update-dbgval-local.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55513.177514.patch
Type: text/x-patch
Size: 5206 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181210/d4fbf74d/attachment.bin>


More information about the llvm-commits mailing list