mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Use SelectionDAG::getBuildVector helper function where possible. NFCI.
llvm-svn: 293532
This commit is contained in:
parent
799a9da4e4
commit
a7086940dd
@ -3091,7 +3091,7 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
|
||||
TLI.getVectorIdxTy(DAG.getDataLayout()))));
|
||||
}
|
||||
|
||||
Tmp1 = DAG.getNode(ISD::BUILD_VECTOR, dl, VT, Ops);
|
||||
Tmp1 = DAG.getBuildVector(VT, dl, Ops);
|
||||
// We may have changed the BUILD_VECTOR type. Cast it back to the Node type.
|
||||
Tmp1 = DAG.getNode(ISD::BITCAST, dl, Node->getValueType(0), Tmp1);
|
||||
Results.push_back(Tmp1);
|
||||
@ -3790,8 +3790,8 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
|
||||
Scalars.push_back(DAG.getNode(Node->getOpcode(), dl,
|
||||
VT.getScalarType(), Ex, Sh));
|
||||
}
|
||||
SDValue Result =
|
||||
DAG.getNode(ISD::BUILD_VECTOR, dl, Node->getValueType(0), Scalars);
|
||||
|
||||
SDValue Result = DAG.getBuildVector(Node->getValueType(0), dl, Scalars);
|
||||
ReplaceNode(SDValue(Node, 0), Result);
|
||||
break;
|
||||
}
|
||||
@ -4424,8 +4424,7 @@ void SelectionDAGLegalize::PromoteNode(SDNode *Node) {
|
||||
NewOps.push_back(Elt);
|
||||
}
|
||||
|
||||
SDValue NewVec = DAG.getNode(ISD::BUILD_VECTOR, SL, MidVT, NewOps);
|
||||
|
||||
SDValue NewVec = DAG.getBuildVector(MidVT, SL, NewOps);
|
||||
Results.push_back(DAG.getNode(ISD::BITCAST, SL, EltVT, NewVec));
|
||||
break;
|
||||
}
|
||||
|
@ -487,7 +487,7 @@ SDValue DAGTypeLegalizer::ScalarizeVecOp_CONCAT_VECTORS(SDNode *N) {
|
||||
SmallVector<SDValue, 8> Ops(N->getNumOperands());
|
||||
for (unsigned i = 0, e = N->getNumOperands(); i < e; ++i)
|
||||
Ops[i] = GetScalarizedVector(N->getOperand(i));
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, SDLoc(N), N->getValueType(0), Ops);
|
||||
return DAG.getBuildVector(N->getValueType(0), SDLoc(N), Ops);
|
||||
}
|
||||
|
||||
/// If the input is a vector that needs to be scalarized, it must be <1 x ty>,
|
||||
@ -783,10 +783,10 @@ void DAGTypeLegalizer::SplitVecRes_BUILD_VECTOR(SDNode *N, SDValue &Lo,
|
||||
std::tie(LoVT, HiVT) = DAG.GetSplitDestVTs(N->getValueType(0));
|
||||
unsigned LoNumElts = LoVT.getVectorNumElements();
|
||||
SmallVector<SDValue, 8> LoOps(N->op_begin(), N->op_begin()+LoNumElts);
|
||||
Lo = DAG.getNode(ISD::BUILD_VECTOR, dl, LoVT, LoOps);
|
||||
Lo = DAG.getBuildVector(LoVT, dl, LoOps);
|
||||
|
||||
SmallVector<SDValue, 8> HiOps(N->op_begin()+LoNumElts, N->op_end());
|
||||
Hi = DAG.getNode(ISD::BUILD_VECTOR, dl, HiVT, HiOps);
|
||||
Hi = DAG.getBuildVector(HiVT, dl, HiOps);
|
||||
}
|
||||
|
||||
void DAGTypeLegalizer::SplitVecRes_CONCAT_VECTORS(SDNode *N, SDValue &Lo,
|
||||
@ -1374,7 +1374,7 @@ void DAGTypeLegalizer::SplitVecRes_VECTOR_SHUFFLE(ShuffleVectorSDNode *N,
|
||||
}
|
||||
|
||||
// Construct the Lo/Hi output using a BUILD_VECTOR.
|
||||
Output = DAG.getNode(ISD::BUILD_VECTOR, dl, NewVT, SVOps);
|
||||
Output = DAG.getBuildVector(NewVT, dl, SVOps);
|
||||
} else if (InputUsed[0] == -1U) {
|
||||
// No input vectors were used! The result is undefined.
|
||||
Output = DAG.getUNDEF(NewVT);
|
||||
@ -1618,7 +1618,7 @@ SDValue DAGTypeLegalizer::SplitVecOp_EXTRACT_VECTOR_ELT(SDNode *N) {
|
||||
EltVT = MVT::i8;
|
||||
VecVT = EVT::getVectorVT(*DAG.getContext(), EltVT,
|
||||
VecVT.getVectorNumElements());
|
||||
Vec = DAG.getNode(ISD::BUILD_VECTOR, dl, VecVT, ElementOps);
|
||||
Vec = DAG.getBuildVector(VecVT, dl, ElementOps);
|
||||
}
|
||||
|
||||
// Store the vector to the stack.
|
||||
@ -1884,7 +1884,7 @@ SDValue DAGTypeLegalizer::SplitVecOp_CONCAT_VECTORS(SDNode *N) {
|
||||
}
|
||||
}
|
||||
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, DL, N->getValueType(0), Elts);
|
||||
return DAG.getBuildVector(N->getValueType(0), DL, Elts);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::SplitVecOp_TruncateHelper(SDNode *N) {
|
||||
@ -2387,7 +2387,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_Convert(SDNode *N) {
|
||||
for (; i < WidenNumElts; ++i)
|
||||
Ops[i] = UndefVal;
|
||||
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, DL, WidenVT, Ops);
|
||||
return DAG.getBuildVector(WidenVT, DL, Ops);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::WidenVecRes_EXTEND_VECTOR_INREG(SDNode *N) {
|
||||
@ -2442,7 +2442,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_EXTEND_VECTOR_INREG(SDNode *N) {
|
||||
while (Ops.size() != WidenNumElts)
|
||||
Ops.push_back(DAG.getUNDEF(WidenSVT));
|
||||
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, DL, WidenVT, Ops);
|
||||
return DAG.getBuildVector(WidenVT, DL, Ops);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::WidenVecRes_FCOPYSIGN(SDNode *N) {
|
||||
@ -2605,7 +2605,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_BUILD_VECTOR(SDNode *N) {
|
||||
assert(WidenNumElts >= NumElts && "Shrinking vector instead of widening!");
|
||||
NewOps.append(WidenNumElts - NumElts, DAG.getUNDEF(EltVT));
|
||||
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, dl, WidenVT, NewOps);
|
||||
return DAG.getBuildVector(WidenVT, dl, NewOps);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::WidenVecRes_CONCAT_VECTORS(SDNode *N) {
|
||||
@ -2675,7 +2675,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_CONCAT_VECTORS(SDNode *N) {
|
||||
SDValue UndefVal = DAG.getUNDEF(EltVT);
|
||||
for (; Idx < WidenNumElts; ++Idx)
|
||||
Ops[Idx] = UndefVal;
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, dl, WidenVT, Ops);
|
||||
return DAG.getBuildVector(WidenVT, dl, Ops);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::WidenVecRes_EXTRACT_SUBVECTOR(SDNode *N) {
|
||||
@ -2716,7 +2716,7 @@ SDValue DAGTypeLegalizer::WidenVecRes_EXTRACT_SUBVECTOR(SDNode *N) {
|
||||
SDValue UndefVal = DAG.getUNDEF(EltVT);
|
||||
for (; i < WidenNumElts; ++i)
|
||||
Ops[i] = UndefVal;
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, dl, WidenVT, Ops);
|
||||
return DAG.getBuildVector(WidenVT, dl, Ops);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::WidenVecRes_INSERT_VECTOR_ELT(SDNode *N) {
|
||||
@ -3105,7 +3105,7 @@ SDValue DAGTypeLegalizer::WidenVecOp_Convert(SDNode *N) {
|
||||
ISD::EXTRACT_VECTOR_ELT, dl, InEltVT, InOp,
|
||||
DAG.getConstant(i, dl, TLI.getVectorIdxTy(DAG.getDataLayout()))));
|
||||
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, Ops);
|
||||
return DAG.getBuildVector(VT, dl, Ops);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::WidenVecOp_BITCAST(SDNode *N) {
|
||||
@ -3156,7 +3156,7 @@ SDValue DAGTypeLegalizer::WidenVecOp_CONCAT_VECTORS(SDNode *N) {
|
||||
ISD::EXTRACT_VECTOR_ELT, dl, EltVT, InOp,
|
||||
DAG.getConstant(j, dl, TLI.getVectorIdxTy(DAG.getDataLayout())));
|
||||
}
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, Ops);
|
||||
return DAG.getBuildVector(VT, dl, Ops);
|
||||
}
|
||||
|
||||
SDValue DAGTypeLegalizer::WidenVecOp_EXTRACT_SUBVECTOR(SDNode *N) {
|
||||
@ -3577,10 +3577,9 @@ DAGTypeLegalizer::GenWidenVectorExtLoads(SmallVectorImpl<SDValue> &LdChain,
|
||||
for (; i != WidenNumElts; ++i)
|
||||
Ops[i] = UndefVal;
|
||||
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, dl, WidenVT, Ops);
|
||||
return DAG.getBuildVector(WidenVT, dl, Ops);
|
||||
}
|
||||
|
||||
|
||||
void DAGTypeLegalizer::GenWidenVectorStores(SmallVectorImpl<SDValue> &StChain,
|
||||
StoreSDNode *ST) {
|
||||
// The strategy assumes that we can efficiently store power-of-two widths.
|
||||
@ -3749,5 +3748,5 @@ SDValue DAGTypeLegalizer::ModifyToType(SDValue InOp, EVT NVT,
|
||||
DAG.getUNDEF(EltVT);
|
||||
for ( ; Idx < WidenNumElts; ++Idx)
|
||||
Ops[Idx] = FillVal;
|
||||
return DAG.getNode(ISD::BUILD_VECTOR, dl, NVT, Ops);
|
||||
return DAG.getBuildVector(NVT, dl, Ops);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user