diff options
author | Adrian Prantl <aprantl@apple.com> | 2018-01-11 18:35:12 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2018-01-11 18:35:12 +0000 |
commit | 29102b30023991ec1f15af5fd371d9504ed24ad5 (patch) | |
tree | 3c2cb0f479358de23a3f0b6984eb2732b2b42fc6 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 240df6faa4f6f8ea13b3006f2808b64b6d647b02 (diff) | |
download | bcm5719-llvm-29102b30023991ec1f15af5fd371d9504ed24ad5.tar.gz bcm5719-llvm-29102b30023991ec1f15af5fd371d9504ed24ad5.zip |
dag-combine: Transfer debug information when folding (zext (truncate x))
-> (zext (truncate x))
This patch adds debug info support to the dagcombine rule (zext
(truncate x)) -> (zext (truncate x)).
Differential Revision: https://reviews.llvm.org/D41924
llvm-svn: 322304
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 4ae22d69eaf..093a20057c6 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -7800,7 +7800,10 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) { SDValue Op = N0.getOperand(0); Op = DAG.getZeroExtendInReg(Op, SDLoc(N), MinVT.getScalarType()); AddToWorklist(Op.getNode()); - return DAG.getZExtOrTrunc(Op, SDLoc(N), VT); + SDValue ZExtOrTrunc = DAG.getZExtOrTrunc(Op, SDLoc(N), VT); + // Transfer the debug info; the new node is equivalent to N0. + DAG.transferDbgValues(N0, ZExtOrTrunc); + return ZExtOrTrunc; } } |