diff options
author | Nirav Dave <niravd@google.com> | 2017-03-23 15:01:50 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2017-03-23 15:01:50 +0000 |
commit | e9ca32ae52613a94b622f5cdb57f5b7533cc1d35 (patch) | |
tree | f76a29573fbb652854232571d7f37bdd7c0ee90f /llvm/lib | |
parent | a2285ebd4faee4b610017b11d48febdbb7963784 (diff) | |
download | bcm5719-llvm-e9ca32ae52613a94b622f5cdb57f5b7533cc1d35.tar.gz bcm5719-llvm-e9ca32ae52613a94b622f5cdb57f5b7533cc1d35.zip |
[SDAG] Fix zeroExtend assertion error
Move CombineTo preventing deleted node from being returned in
visitZERO_EXTEND.
Fixes PR32284.
Reviewers: RKSimon, bogner
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31254
llvm-svn: 298604
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index dd0abd15daf..d527a0e15af 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -7277,13 +7277,14 @@ SDValue DAGCombiner::visitZERO_EXTEND(SDNode *N) { LN0->getChain(), LN0->getBasePtr(), N0.getValueType(), LN0->getMemOperand()); - CombineTo(N, ExtLoad); + SDValue Trunc = DAG.getNode(ISD::TRUNCATE, SDLoc(N0), N0.getValueType(), ExtLoad); CombineTo(N0.getNode(), Trunc, ExtLoad.getValue(1)); ExtendSetCCUses(SetCCs, Trunc, ExtLoad, SDLoc(N), ISD::ZERO_EXTEND); + CombineTo(N, ExtLoad); return SDValue(N, 0); // Return N so it doesn't get rechecked! } } |