llvm.org GIT mirror llvm / 7ae9b5f
Use makeArrayRef insted of calling ArrayRef<T> constructor directly. I introduced most of these recently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207616 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 6 years ago
13 changed file(s) with 37 addition(s) and 44 deletion(s). Raw diff Collapse all Expand all
15621562
15631563 if (N->getOpcode() == ISD::ADD) {
15641564 Lo = DAG.getNode(ISD::ADD, dl, NVT, LoOps);
1565 Hi = DAG.getNode(ISD::ADD, dl, NVT, ArrayRef(HiOps, 2));
1565 Hi = DAG.getNode(ISD::ADD, dl, NVT, makeArrayRef(HiOps, 2));
15661566 SDValue Cmp1 = DAG.getSetCC(dl, getSetCCResultType(NVT), Lo, LoOps[0],
15671567 ISD::SETULT);
15681568 SDValue Carry1 = DAG.getSelect(dl, NVT, Cmp1,
15751575 Hi = DAG.getNode(ISD::ADD, dl, NVT, Hi, Carry2);
15761576 } else {
15771577 Lo = DAG.getNode(ISD::SUB, dl, NVT, LoOps);
1578 Hi = DAG.getNode(ISD::SUB, dl, NVT, ArrayRef(HiOps, 2));
1578 Hi = DAG.getNode(ISD::SUB, dl, NVT, makeArrayRef(HiOps, 2));
15791579 SDValue Cmp =
15801580 DAG.getSetCC(dl, getSetCCResultType(LoOps[0].getValueType()),
15811581 LoOps[0], LoOps[1], ISD::SETULT);
354354 IntegerToVector(N->getOperand(0), NumElts, Ops, NVT.getVectorElementType());
355355
356356 SDValue Vec = DAG.getNode(ISD::BUILD_VECTOR, dl, NVT,
357 ArrayRef(&Ops[0], NumElts));
357 makeArrayRef(Ops.data(), NumElts));
358358 return DAG.getNode(ISD::BITCAST, dl, N->getValueType(0), Vec);
359359 }
360360
17441744 ConcatOps[j] = UndefVal;
17451745 }
17461746 return DAG.getNode(ISD::CONCAT_VECTORS, dl, WidenVT,
1747 ArrayRef(&ConcatOps[0], NumOps));
1747 makeArrayRef(ConcatOps.data(), NumOps));
17481748 }
17491749
17501750 SDValue DAGTypeLegalizer::WidenVecRes_Convert(SDNode *N) {
27232723 if (NewLdTy != LdTy) {
27242724 // Create a larger vector
27252725 ConcatOps[End-1] = DAG.getNode(ISD::CONCAT_VECTORS, dl, NewLdTy,
2726 ArrayRef(&ConcatOps[Idx],
2727 End - Idx));
2726 makeArrayRef(&ConcatOps[Idx], End - Idx));
27282727 Idx = End - 1;
27292728 LdTy = NewLdTy;
27302729 }
27332732
27342733 if (WidenWidth == LdTy.getSizeInBits()*(End - Idx))
27352734 return DAG.getNode(ISD::CONCAT_VECTORS, dl, WidenVT,
2736 ArrayRef(&ConcatOps[Idx], End - Idx));
2735 makeArrayRef(&ConcatOps[Idx], End - Idx));
27372736
27382737 // We need to fill the rest with undefs to build the vector
27392738 unsigned NumOps = WidenWidth / LdTy.getSizeInBits();
526526 // Add the return value info.
527527 AddNodeIDValueTypes(ID, N->getVTList());
528528 // Add the operand info.
529 AddNodeIDOperands(ID, ArrayRef(N->op_begin(), N->op_end()));
529 AddNodeIDOperands(ID, makeArrayRef(N->op_begin(), N->op_end()));
530530
531531 // Handle SDNode leafs with special info.
532532 AddNodeIDCustom(ID, N);
34793479 if (ChainI == MaxParallelChains) {
34803480 assert(PendingLoads.empty() && "PendingLoads must be serialized first");
34813481 SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurSDLoc(), MVT::Other,
3482 ArrayRef(Chains.data(), ChainI));
3482 makeArrayRef(Chains.data(), ChainI));
34833483 Root = Chain;
34843484 ChainI = 0;
34853485 }
34973497
34983498 if (!ConstantMemory) {
34993499 SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurSDLoc(), MVT::Other,
3500 ArrayRef(Chains.data(), ChainI));
3500 makeArrayRef(Chains.data(), ChainI));
35013501 if (isVolatile)
35023502 DAG.setRoot(Chain);
35033503 else
35423542 // See visitLoad comments.
35433543 if (ChainI == MaxParallelChains) {
35443544 SDValue Chain = DAG.getNode(ISD::TokenFactor, getCurSDLoc(), MVT::Other,
3545 ArrayRef(Chains.data(), ChainI));
3545 makeArrayRef(Chains.data(), ChainI));
35463546 Root = Chain;
35473547 ChainI = 0;
35483548 }
35563556 }
35573557
35583558 SDValue StoreNode = DAG.getNode(ISD::TokenFactor, getCurSDLoc(), MVT::Other,
3559 ArrayRef(Chains.data(), ChainI));
3559 makeArrayRef(Chains.data(), ChainI));
35603560 DAG.setRoot(StoreNode);
35613561 }
35623562
74957495 dyn_cast(ArgValues[0].getNode()))
74967496 FuncInfo->setArgumentFrameIndex(I, FI->getIndex());
74977497
7498 SDValue Res = DAG.getMergeValues(ArrayRef(ArgValues.data(),
7499 NumValues),
7498 SDValue Res = DAG.getMergeValues(makeArrayRef(ArgValues.data(), NumValues),
75007499 SDB->getCurSDLoc());
75017500
75027501 SDB->setValue(I, Res);
7272 SrcOff += VTSize;
7373 }
7474 Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
75 ArrayRef(TFOps, i));
75 makeArrayRef(TFOps, i));
7676
7777 for (i = 0;
7878 i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; ++i) {
8484 DstOff += VTSize;
8585 }
8686 Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
87 ArrayRef(TFOps, i));
87 makeArrayRef(TFOps, i));
8888
8989 EmittedNumMemOps += i;
9090 }
115115 BytesLeft -= VTSize;
116116 }
117117 Chain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
118 ArrayRef(TFOps, i));
118 makeArrayRef(TFOps, i));
119119
120120 i = 0;
121121 BytesLeft = BytesLeftSave;
137137 BytesLeft -= VTSize;
138138 }
139139 return DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
140 ArrayRef(TFOps, i));
140 makeArrayRef(TFOps, i));
141141 }
142142
143143 // Adjust parameters for memset, EABI uses format (ptr, size, value),
43574357 ISD::INTRINSIC_WO_CHAIN, DL, IndexVT,
43584358 DAG.getConstant(Intrinsic::arm64_neon_tbl1, MVT::i32), V1Cst,
43594359 DAG.getNode(ISD::BUILD_VECTOR, DL, IndexVT,
4360 ArrayRef(TBLMask.data(), IndexLen)));
4360 makeArrayRef(TBLMask.data(), IndexLen)));
43614361 } else {
43624362 if (IndexLen == 8) {
43634363 V1Cst = DAG.getNode(ISD::CONCAT_VECTORS, DL, MVT::v16i8, V1Cst, V2Cst);
43654365 ISD::INTRINSIC_WO_CHAIN, DL, IndexVT,
43664366 DAG.getConstant(Intrinsic::arm64_neon_tbl1, MVT::i32), V1Cst,
43674367 DAG.getNode(ISD::BUILD_VECTOR, DL, IndexVT,
4368 ArrayRef(TBLMask.data(), IndexLen)));
4368 makeArrayRef(TBLMask.data(), IndexLen)));
43694369 } else {
43704370 // FIXME: We cannot, for the moment, emit a TBL2 instruction because we
43714371 // cannot currently represent the register constraints on the input
43774377 ISD::INTRINSIC_WO_CHAIN, DL, IndexVT,
43784378 DAG.getConstant(Intrinsic::arm64_neon_tbl2, MVT::i32), V1Cst, V2Cst,
43794379 DAG.getNode(ISD::BUILD_VECTOR, DL, IndexVT,
4380 ArrayRef(TBLMask.data(), IndexLen)));
4380 makeArrayRef(TBLMask.data(), IndexLen)));
43814381 }
43824382 }
43834383 return DAG.getNode(ISD::BITCAST, DL, Op.getValueType(), Shuffle);
488488 SDValue Ops[] = { Op0->getOperand(0), Op0->getOperand(1), Op0Op2 };
489489 DAG.MorphNodeTo(Op0.getNode(), MipsISD::VEXTRACT_ZEXT_ELT,
490490 Op0->getVTList(),
491 ArrayRef(Ops, Op0->getNumOperands()));
491 makeArrayRef(Ops, Op0->getNumOperands()));
492492 return Op0;
493493 }
494494 }
833833 Op0Op0->getOperand(2) };
834834 DAG.MorphNodeTo(Op0Op0.getNode(), MipsISD::VEXTRACT_SEXT_ELT,
835835 Op0Op0->getVTList(),
836 ArrayRef(Ops, Op0Op0->getNumOperands()));
836 makeArrayRef(Ops, Op0Op0->getNumOperands()));
837837 return Op0Op0;
838838 }
839839 }
12831283 LaneA, LaneB, LaneA, LaneB, LaneA, LaneB, LaneA, LaneB };
12841284
12851285 SDValue Result = DAG.getNode(ISD::BUILD_VECTOR, DL, ViaVecTy,
1286 ArrayRef(Ops, ViaVecTy.getVectorNumElements()));
1286 makeArrayRef(Ops, ViaVecTy.getVectorNumElements()));
12871287
12881288 if (ViaVecTy != ResVecTy)
12891289 Result = DAG.getNode(ISD::BITCAST, DL, ResVecTy, Result);
13231323 SplatValueA, SplatValueB, SplatValueA, SplatValueB };
13241324
13251325 SDValue Result = DAG.getNode(ISD::BUILD_VECTOR, DL, ViaVecTy,
1326 ArrayRef(Ops, ViaVecTy.getVectorNumElements()));
1326 makeArrayRef(Ops, ViaVecTy.getVectorNumElements()));
13271327
13281328 if (VecTy != ViaVecTy)
13291329 Result = DAG.getNode(ISD::BITCAST, DL, VecTy, Result);
10831083 }
10841084
10851085 SDValue Ops[] = { Addr, Chain };
1086 LD = CurDAG->getMachineNode(Opcode, DL, N->getVTList(),
1087 ArrayRef(Ops, 2));
1086 LD = CurDAG->getMachineNode(Opcode, DL, N->getVTList(), Ops);
10881087 } else if (Subtarget.is64Bit()
10891088 ? SelectADDRri64(Op1.getNode(), Op1, Base, Offset)
10901089 : SelectADDRri(Op1.getNode(), Op1, Base, Offset)) {
12701269
12711270 SDValue Ops[] = { Base, Offset, Chain };
12721271
1273 LD = CurDAG->getMachineNode(Opcode, DL, N->getVTList(),
1274 ArrayRef(Ops, 3));
1272 LD = CurDAG->getMachineNode(Opcode, DL, N->getVTList(), Ops);
12751273 } else {
12761274 if (Subtarget.is64Bit()) {
12771275 switch (N->getOpcode()) {
14541452 }
14551453
14561454 SDValue Ops[] = { Op1, Chain };
1457 LD = CurDAG->getMachineNode(Opcode, DL, N->getVTList(),
1458 ArrayRef(Ops, 2));
1455 LD = CurDAG->getMachineNode(Opcode, DL, N->getVTList(), Ops);
14591456 }
14601457
14611458 MachineSDNode::mmo_iterator MemRefs0 = MF->allocateMemRefsArray(1);
34733473 // descriptor.
34743474 SDVTList VTs = DAG.getVTList(MVT::i64, MVT::Other, MVT::Glue);
34753475 SDValue LoadFuncPtr = DAG.getNode(PPCISD::LOAD, dl, VTs,
3476 ArrayRef(MTCTROps, InFlag.getNode() ? 3 : 2));
3476 makeArrayRef(MTCTROps, InFlag.getNode() ? 3 : 2));
34773477 Chain = LoadFuncPtr.getValue(1);
34783478 InFlag = LoadFuncPtr.getValue(2);
34793479
35103510 }
35113511
35123512 Chain = DAG.getNode(PPCISD::MTCTR, dl, NodeTys,
3513 ArrayRef(MTCTROps, InFlag.getNode() ? 3 : 2));
3513 makeArrayRef(MTCTROps, InFlag.getNode() ? 3 : 2));
35143514 InFlag = Chain.getValue(1);
35153515
35163516 NodeTys.clear();
39393939 SDValue Ops[] = { Chain, InFlag };
39403940
39413941 Chain = DAG.getNode(seenFloatArg ? PPCISD::CR6SET : PPCISD::CR6UNSET,
3942 dl, VTs,
3943 ArrayRef(Ops, InFlag.getNode() ? 2 : 1));
3942 dl, VTs, makeArrayRef(Ops, InFlag.getNode() ? 2 : 1));
39443943
39453944 InFlag = Chain.getValue(1);
39463945 }
52815280 MVT::f64, // return register
52825281 MVT::Glue // unused in this context
52835282 };
5284 SDValue Chain = DAG.getNode(PPCISD::MFFS, dl, NodeTys, ArrayRef());
5283 SDValue Chain = DAG.getNode(PPCISD::MFFS, dl, NodeTys, None);
52855284
52865285 // Save FP register to stack slot
52875286 int SSFI = MF.getFrameInfo()->CreateStackObject(8, 8, false);
12791279 NumElements = VT.getVectorNumElements();
12801280 }
12811281 Result = DAG.getNode(ISD::BUILD_VECTOR, DL, NewVT,
1282 ArrayRef(Slots, NumElements));
1282 makeArrayRef(Slots, NumElements));
12831283 } else {
12841284 // non-constant ptr can't be folded, keeps it as a v4f32 load
12851285 Result = DAG.getNode(AMDGPUISD::CONST_ADDRESS, DL, MVT::v4i32,
771771 }
772772 // Join the stores, which are independent of one another.
773773 Chain = DAG.getNode(ISD::TokenFactor, DL, MVT::Other,
774 ArrayRef(&MemOps[NumFixedFPRs],
775 SystemZ::NumArgFPRs-NumFixedFPRs));
774 makeArrayRef(&MemOps[NumFixedFPRs],
775 SystemZ::NumArgFPRs-NumFixedFPRs));
776776 }
777777 }
778778
8484 // If the input is a buildvector just emit a smaller one.
8585 if (Vec.getOpcode() == ISD::BUILD_VECTOR)
8686 return DAG.getNode(ISD::BUILD_VECTOR, dl, ResultVT,
87 ArrayRef(Vec->op_begin()+NormalizedIdxVal,
88 ElemsPerChunk));
87 makeArrayRef(Vec->op_begin()+NormalizedIdxVal,
88 ElemsPerChunk));
8989
9090 SDValue VecIdx = DAG.getIntPtrConstant(NormalizedIdxVal);
9191 SDValue Result = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, ResultVT, Vec,
61396139
61406140 // Build both the lower and upper subvector.
61416141 SDValue Lower = DAG.getNode(ISD::BUILD_VECTOR, dl, HVT,
6142 ArrayRef(&V[0], NumElems/2));
6142 makeArrayRef(&V[0], NumElems/2));
61436143 SDValue Upper = DAG.getNode(ISD::BUILD_VECTOR, dl, HVT,
6144 ArrayRef(&V[NumElems / 2],
6145 NumElems/2));
6144 makeArrayRef(&V[NumElems / 2], NumElems/2));
61466145
61476146 // Recreate the wider vector with the lower and upper part.
61486147 if (VT.is256BitVector())