forked from OSchip/llvm-project
[DAG] Use getSplatBuildVector in a couple more places [nfc]
This commit is contained in:
parent
b6c24c1619
commit
21f97fdc97
|
@ -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.
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue