summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorIgor Breger <igor.breger@intel.com>2016-08-29 09:12:31 +0000
committerIgor Breger <igor.breger@intel.com>2016-08-29 09:12:31 +0000
commit24281b4740799108fe935e3478dfbe3f27c2d36c (patch)
tree2a124a2a969c309ee5e7f58279b0e0919170b25b /llvm/lib/CodeGen/SelectionDAG
parent1a388871b923362e041eb238f2a67794cd85786d (diff)
downloadbcm5719-llvm-24281b4740799108fe935e3478dfbe3f27c2d36c.tar.gz
bcm5719-llvm-24281b4740799108fe935e3478dfbe3f27c2d36c.zip
Fixed a bug in type legalizer for masked gather.
The problem occurs when the Node doesn't updated in place , UpdateNodeOperation() return the node that already exist. In this case assert fail in PromoteIntegerOperand() , N have 2 results ( val + chain). Differential Revision: http://reviews.llvm.org/D23756 llvm-svn: 279961
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
index a4ab37e7f8e..a4496c80a41 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
@@ -1235,7 +1235,15 @@ SDValue DAGTypeLegalizer::PromoteIntOp_MGATHER(MaskedGatherSDNode *N,
NewOps[OpNo] = PromoteTargetBoolean(N->getOperand(OpNo), DataVT);
} else
NewOps[OpNo] = GetPromotedInteger(N->getOperand(OpNo));
- return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
+
+ SDValue Res = SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
+ // updated in place.
+ if (Res.getNode() == N)
+ return Res;
+
+ ReplaceValueWith(SDValue(N, 0), Res.getValue(0));
+ ReplaceValueWith(SDValue(N, 1), Res.getValue(1));
+ return SDValue();
}
SDValue DAGTypeLegalizer::PromoteIntOp_MSCATTER(MaskedScatterSDNode *N,
OpenPOWER on IntegriCloud