Clean up the processing of dbg.value in various places
authorKeno Fischer <kfischer@college.harvard.edu>
Sat, 19 Dec 2015 02:02:44 +0000 (02:02 +0000)
committerKeno Fischer <kfischer@college.harvard.edu>
Sat, 19 Dec 2015 02:02:44 +0000 (02:02 +0000)
commitbae90264170cd5d18f89ed5c2bca8ff1e0eb41a6
tree8b431f2d3c36d4163632eb3a2e68b0801539095f
parent7aed0ccd46f547e87a750051265c8c3faeaf4a33
Clean up the processing of dbg.value in various places

Summary:
First up is instcombine, where in the dbg.declare -> dbg.value conversion,
the llvm.dbg.value needs to be called on the actual loaded value, rather
than the address (since the whole point of this transformation is to be
able to get rid of the alloca). Further, now that that's cleaned up, we
can remove a hack in the backend, that would add an implicit OP_deref if
the argument to dbg.value was an alloca. This stems from before the
existence of DIExpression and is no longer necessary since the deref can
be expressed explicitly.

Now, in order to make sure that the tests pass with this change, we need to
correct the printing of DEBUG_VALUE comments to take into account the
expression, which wasn't taken into account before.

Unfortunately, for both these changes, there were a number of incorrect
test cases (mostly the wrong number of DW_OP_derefs, but also a couple
where the test itself was broken more badly). aprantl and I have gone
through and adjusted these test case in order to make them pass with
these fixes and in some cases to make sure they're actually testing
what they are meant to test.

Reviewers: aprantl

Subscribers: dsanders

Differential Revision: http://reviews.llvm.org/D14186

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256077 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Transforms/Utils/Local.cpp
test/CodeGen/ARM/debug-info-blocks.ll
test/DebugInfo/AArch64/coalescing.ll
test/DebugInfo/Mips/dsr-fixed-objects.ll
test/DebugInfo/X86/array.ll
test/DebugInfo/X86/dbg-value-const-byref.ll
test/DebugInfo/X86/debug-loc-asan.ll
test/DebugInfo/X86/op_deref.ll
test/DebugInfo/X86/reference-argument.ll
test/DebugInfo/X86/vla.ll
test/Transforms/Util/simplify-dbg-declare-load.ll [new file with mode: 0644]