From f8a7e9de065904e3d799d4eeb10c738e160dcea9 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 29 Jul 2019 11:34:45 +0000 Subject: [DAGCombine] narrowInsertExtractVectorBinOp - early out for binops that change value type. NFCI. This is implicit in the value type checks in getSubVectorSrc - this just makes it upfront and obvious. llvm-svn: 367220 --- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 4b3db73875b..835425021dc 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -18020,7 +18020,11 @@ static SDValue narrowInsertExtractVectorBinOp(SDNode *Extract, if (!TLI.isBinOp(BinOpcode) || BinOp.getNode()->getNumValues() != 1) return SDValue(); + EVT VecVT = BinOp.getValueType(); SDValue Bop0 = BinOp.getOperand(0), Bop1 = BinOp.getOperand(1); + if (VecVT != Bop0.getValueType() || VecVT != Bop1.getValueType()) + return SDValue(); + SDValue Index = Extract->getOperand(1); EVT SubVT = Extract->getValueType(0); if (!TLI.isOperationLegalOrCustom(BinOpcode, SubVT)) -- cgit v1.2.3