[Salvage] Change salvage debug info implementation to use DW_OP_LLVM_convert where...
authorStephen Tozer <stephen.tozer@sony.com>
Wed, 15 May 2019 13:15:48 +0000 (13:15 +0000)
committerStephen Tozer <stephen.tozer@sony.com>
Wed, 15 May 2019 13:15:48 +0000 (13:15 +0000)
commit17dd4d7403770bd683675e45f5517e0cdb8f9b2b
treefa91160e0f36541ec4e806e645078f576aacf24b
parent157ae639fa646c59ad6cb2c39a389264d5cb3e6a
[Salvage] Change salvage debug info implementation to use DW_OP_LLVM_convert where needed

Fixes issue: https://bugs.llvm.org/show_bug.cgi?id=40645

Previously, LLVM had no functional way of performing casts inside of a
DIExpression(), which made salvaging cast instructions other than Noop
casts impossible. With the recent addition of DW_OP_LLVM_convert this
salvaging is now possible, and so can be used to fix the attached bug as
well as any cases where SExt instruction results are lost in the
debugging metadata. This patch introduces this fix by expanding the
salvage debug info method to cover these cases using the new operator.

Differential revision: https://reviews.llvm.org/D61184

llvm-svn: 360772
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/DebugInfo/salvage-cast-debug-info.ll [new file with mode: 0755]
llvm/test/Transforms/InstCombine/cast-mul-select.ll