diff options
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 13 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 4656bd6e1f8..75b4e8b6d68 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1147,12 +1147,9 @@ SDValue SelectionDAG::getConstant(const ConstantInt &Val, const SDLoc &DL, // This situation occurs in MIPS MSA. SmallVector<SDValue, 8> Ops; - for (unsigned i = 0; i < VT.getVectorNumElements(); ++i) + for (unsigned i = 0, e = VT.getVectorNumElements(); i != e; ++i) Ops.insert(Ops.end(), EltParts.begin(), EltParts.end()); - - SDValue Result = getNode(ISD::BITCAST, DL, VT, - getNode(ISD::BUILD_VECTOR, DL, ViaVecVT, Ops)); - return Result; + return getNode(ISD::BITCAST, DL, VT, getBuildVector(ViaVecVT, DL, Ops)); } assert(Elt->getBitWidth() == EltVT.getSizeInBits() && @@ -3094,7 +3091,7 @@ static SDValue FoldCONCAT_VECTORS(const SDLoc &DL, EVT VT, ? DAG.getZExtOrTrunc(Op, DL, SVT) : DAG.getSExtOrTrunc(Op, DL, SVT); - return DAG.getNode(ISD::BUILD_VECTOR, DL, VT, Elts); + return DAG.getBuildVector(VT, DL, Elts); } /// Gets or creates the specified node. @@ -7129,8 +7126,8 @@ SDValue SelectionDAG::UnrollVectorOp(SDNode *N, unsigned ResNE) { for (; i < ResNE; ++i) Scalars.push_back(getUNDEF(EltVT)); - return getNode(ISD::BUILD_VECTOR, dl, - EVT::getVectorVT(*getContext(), EltVT, ResNE), Scalars); + EVT VecVT = EVT::getVectorVT(*getContext(), EltVT, ResNE); + return getBuildVector(VecVT, dl, Scalars); } bool SelectionDAG::areNonVolatileConsecutiveLoads(LoadSDNode *LD, diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 4cc04f33123..591a37d600c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -3378,7 +3378,7 @@ SDValue TargetLowering::scalarizeVectorLoad(LoadSDNode *LD, } SDValue NewChain = DAG.getNode(ISD::TokenFactor, SL, MVT::Other, LoadChains); - SDValue Value = DAG.getNode(ISD::BUILD_VECTOR, SL, LD->getValueType(0), Vals); + SDValue Value = DAG.getBuildVector(LD->getValueType(0), SL, Vals); return DAG.getMergeValues({ Value, NewChain }, SL); } |

