[Local] Do not ignore zexts in salvageDebugInfo, PR45923
authorVedant Kumar <vsk@apple.com>
Fri, 15 May 2020 20:58:40 +0000 (13:58 -0700)
committerVedant Kumar <vsk@apple.com>
Mon, 18 May 2020 16:52:02 +0000 (09:52 -0700)
commit623b2542446a1873fb7ea3904c4fb50e2e77fe41
treee738f12c54d872ad1403b9edd0be958c12d1bae6
parent23dc948d362018a8257d8288fe9beb0d27fc9b35
[Local] Do not ignore zexts in salvageDebugInfo, PR45923

Summary:
When salvaging a dead zext instruction, append a convert operation to
the DIExpressions of the debug uses of the instruction, to prevent the
salvaged value from being sign-extended.

I confirmed that lldb prints out the correct unsigned result for "f" in
the example from PR45923 with this changed applied.

rdar://63246143

Reviewers: aprantl, jmorse, chrisjackson, davide

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80034
llvm/lib/Transforms/Utils/Local.cpp
llvm/test/Transforms/InstCombine/cast-mul-select.ll