diff options
author | Aaron Smith <aaron.smith@microsoft.com> | 2018-05-07 20:15:50 +0000 |
---|---|---|
committer | Aaron Smith <aaron.smith@microsoft.com> | 2018-05-07 20:15:50 +0000 |
commit | 47589e09dd6cfd731a257bbcdf06a34878cd2656 (patch) | |
tree | 57e7cc5bb669f7bf6e7f47d4daa0114f26b76ad4 /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | fb807d4dd49f912313ea2fde4fd3acac271a09cb (diff) | |
download | bcm5719-llvm-47589e09dd6cfd731a257bbcdf06a34878cd2656.tar.gz bcm5719-llvm-47589e09dd6cfd731a257bbcdf06a34878cd2656.zip |
[SelectionDAG] Transfer DbgValues when casts are optimized in SelectionDAG::getNode
Summary:
getNode optimizes (ext (trunc x)) to x and the dbgvalue node on trunc is lost. The fix calls transferDbgValues to add the dbgvalue to x.
Add DebugInfo/AArch64/dbg-value-i16.ll
Patch by Sejong Oh!
Reviewers: aprantl, javed.absar, llvm-commits, vsk
Reviewed By: aprantl, vsk
Subscribers: kristof.beyls, JDevlieghere, llvm-commits
Differential Revision: https://reviews.llvm.org/D46348
llvm-svn: 331665
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index cf6993baef3..715bf859246 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3962,11 +3962,13 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, else if (OpOpcode == ISD::UNDEF) return getUNDEF(VT); - // (ext (trunx x)) -> x + // (ext (trunc x)) -> x if (OpOpcode == ISD::TRUNCATE) { SDValue OpOp = Operand.getOperand(0); - if (OpOp.getValueType() == VT) + if (OpOp.getValueType() == VT) { + transferDbgValues(Operand, OpOp); return OpOp; + } } break; case ISD::TRUNCATE: |