]> granicus.if.org Git - llvm/commitdiff
[DAGCombine] narrowInsertExtractVectorBinOp - early out for binops that change value...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 29 Jul 2019 11:34:45 +0000 (11:34 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 29 Jul 2019 11:34:45 +0000 (11:34 +0000)
This is implicit in the value type checks in getSubVectorSrc - this just makes it upfront and obvious.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367220 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/DAGCombiner.cpp

index 4b3db73875b0ff1a39527de84bd5d6e6b047bca3..835425021dcb30595b8914b9c929b036ac116591 100644 (file)
@@ -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))