[PATCH] D36596: [InstCombine] Don't convert all dbg.declares to dbg.values

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 10 15:48:23 PDT 2017


rnk created this revision.
Herald added a reviewer: dberlin.
Herald added a subscriber: hiraditya.

Only insert dbg.value calls when the alloca would be removed. This
ensures that debug info doesn't regress for the test case that Devang
added when this logic was originally added in 2011.

This should improve optimized debug info for address-taken variables.
It should really help so for C++ aggregates like std::string and
std::vector, which are typically address-taken, even after inlining, and
cannot be SROA-ed.

Helps address PR34136

It is possible that this change could regress debug info quality when
other passes like GVN delete stores to locals. In this case, the debug
info will say that the variable lives in memory, but there will be no
update. It can also be problematic if stack coloring arranges to reuse
the stack memory for other data.

This makes CoroFrame.cpp the only remaining caller of LowerDbgDeclares.


https://reviews.llvm.org/D36596

Files:
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/DebugInfo/X86/formal_parameter.ll
  llvm/test/DebugInfo/X86/instcombine-instrinsics.ll
  llvm/test/Transforms/InstCombine/debuginfo-skip.ll
  llvm/test/Transforms/InstCombine/debuginfo.ll
  llvm/test/Transforms/Util/simplify-dbg-declare-load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36596.110643.patch
Type: text/x-patch
Size: 17065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170810/01443918/attachment.bin>


More information about the llvm-commits mailing list