[DAG] Use getSplatBuildVector in a couple more places [nfc]

This commit is contained in:
Philip Reames 2022-10-03 09:47:21 -07:00 committed by Philip Reames
parent b6c24c1619
commit 21f97fdc97
2 changed files with 3 additions and 9 deletions

View File

@ -19781,9 +19781,7 @@ SDValue DAGCombiner::visitINSERT_VECTOR_ELT(SDNode *N) {
if (InVec.isUndef() && TLI.shouldSplatInsEltVarIndex(VT)) {
if (VT.isScalableVector())
return DAG.getSplatVector(VT, DL, InVal);
SmallVector<SDValue, 8> Ops(VT.getVectorNumElements(), InVal);
return DAG.getBuildVector(VT, DL, Ops);
return DAG.getSplatBuildVector(VT, DL, InVal);
}
return SDValue();
}
@ -23821,8 +23819,7 @@ static SDValue scalarizeBinOpOfSplats(SDNode *N, SelectionDAG &DAG,
// bo (splat X, Index), (splat Y, Index) --> splat (bo X, Y), Index
if (VT.isScalableVector())
return DAG.getSplatVector(VT, DL, ScalarBO);
SmallVector<SDValue, 8> Ops(VT.getVectorNumElements(), ScalarBO);
return DAG.getBuildVector(VT, DL, Ops);
return DAG.getSplatBuildVector(VT, DL, ScalarBO);
}
/// Visit a binary vector operation, like ADD.

View File

@ -1697,10 +1697,7 @@ SDValue SelectionDAGBuilder::getValueImpl(const Value *V) {
if (isa<ScalableVectorType>(VecTy))
return NodeMap[V] = DAG.getSplatVector(VT, getCurSDLoc(), Op);
SmallVector<SDValue, 16> Ops;
Ops.assign(cast<FixedVectorType>(VecTy)->getNumElements(), Op);
return NodeMap[V] = DAG.getBuildVector(VT, getCurSDLoc(), Ops);
return NodeMap[V] = DAG.getSplatBuildVector(VT, getCurSDLoc(), Op);
}
llvm_unreachable("Unknown vector constant");