[llvm] r367220 - [DAGCombine] narrowInsertExtractVectorBinOp - early out for binops that change value type. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 04:34:45 PDT 2019


Author: rksimon
Date: Mon Jul 29 04:34:45 2019
New Revision: 367220

URL: http://llvm.org/viewvc/llvm-project?rev=367220&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=367220&r1=367219&r2=367220&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Jul 29 04:34:45 2019
@@ -18020,7 +18020,11 @@ static SDValue narrowInsertExtractVector
   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))




More information about the llvm-commits mailing list