]> granicus.if.org Git - llvm/commitdiff
[X86][AVX] Remove superfluous insert_subvector(zero, bitcast(x)) -> bitcast(insert_su...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 28 Feb 2019 11:39:52 +0000 (11:39 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 28 Feb 2019 11:39:52 +0000 (11:39 +0000)
This is caught by other existing bitcast folds.

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

lib/Target/X86/X86ISelLowering.cpp

index 76f65782907d54431bb0af4e0f473b9eb9e726fa..4c85267343a7a0532735fd019f7f122eac5e4a9b 100644 (file)
@@ -41888,20 +41888,6 @@ static SDValue combineInsertSubvector(SDNode *N, SelectionDAG &DAG,
                            getZeroVector(OpVT, Subtarget, DAG, dl),
                            Ins.getOperand(1), N->getOperand(2));
     }
-
-    // If we're inserting a bitcast into zeros, rewrite the insert and move the
-    // bitcast to the other side. This helps with detecting zero extending
-    // during isel.
-    // TODO: Is this useful for other indices than 0?
-    if (!IsI1Vector && SubVec.getOpcode() == ISD::BITCAST && IdxVal == 0) {
-      MVT CastVT = SubVec.getOperand(0).getSimpleValueType();
-      unsigned NumElems = OpVT.getSizeInBits() / CastVT.getScalarSizeInBits();
-      MVT NewVT = MVT::getVectorVT(CastVT.getVectorElementType(), NumElems);
-      SDValue Insert = DAG.getNode(ISD::INSERT_SUBVECTOR, dl, NewVT,
-                                   DAG.getBitcast(NewVT, Vec),
-                                   SubVec.getOperand(0), N->getOperand(2));
-      return DAG.getBitcast(OpVT, Insert);
-    }
   }
 
   // Stop here if this is an i1 vector.