Lines Matching refs:dag
36 SelectionDAG& DAG;
83 VectorLegalizer(SelectionDAG& dag) :
84 DAG(dag), TLI(dag.getTargetLoweringInfo()), Changed(false) {}
90 for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
91 E = prior(DAG.allnodes_end()); I != llvm::next(E); ++I) {
113 DAG.AssignTopologicalOrder();
114 for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(),
115 E = prior(DAG.allnodes_end()); I != llvm::next(E); ++I)
119 SDValue OldRoot = DAG.getRoot();
121 DAG.setRoot(LegalizedNodes[OldRoot]);
126 DAG.RemoveDeadNodes();
152 SDValue(DAG.UpdateNodeOperands(Op.getNode(), Ops.data(), Ops.size()), 0);
174 return LegalizeOp(TLI.LowerOperation(Result, DAG));
278 SDValue Tmp1 = TLI.LowerOperation(Op, DAG);
299 Result = DAG.UnrollVectorOp(Op.getNode());
328 Operands[j] = DAG.getNode(ISD::BITCAST, dl, NVT, Op.getOperand(j));
333 Op = DAG.getNode(Op.getOpcode(), dl, NVT, &Operands[0], Operands.size());
335 return DAG.getNode(ISD::BITCAST, dl, VT, Op);
354 EltVT = EVT::getIntegerVT(*DAG.getContext(), 2 * EltVT.getSizeInBits());
367 Operands[j] = DAG.getNode(Opc, dl, NVT, Op.getOperand(j));
372 return DAG.getNode(Op.getOpcode(), dl, Op.getValueType(), &Operands[0],
416 ScalarLoad = DAG.getLoad(WideVT, dl, Chain, BasePTR,
424 LoadVT = EVT::getIntegerVT(*DAG.getContext(), LoadBytes << 3);
426 ScalarLoad = DAG.getExtLoad(ISD::EXTLOAD, dl, WideVT, Chain, BasePTR,
434 BasePTR = DAG.getNode(ISD::ADD, dl, BasePTR.getValueType(), BasePTR,
435 DAG.getIntPtrConstant(LoadBytes));
443 SDValue SrcEltBitMask = DAG.getConstant((1U << SrcEltBits) - 1, WideVT);
453 ShAmt = DAG.getConstant(BitOffset, TLI.getShiftAmountTy(WideVT));
454 Lo = DAG.getNode(ISD::SRL, dl, WideVT, LoadVals[WideIdx], ShAmt);
455 DAG.getNode(ISD::AND, dl, WideVT, Lo, SrcEltBitMask);
463 ShAmt = DAG.getConstant(SrcEltBits - Offset,
465 Hi = DAG.getNode(ISD::SHL, dl, WideVT, LoadVals[WideIdx], ShAmt);
466 Hi = DAG.getNode(ISD::AND, dl, WideVT, Hi, SrcEltBitMask);
471 Lo = DAG.getNode(ISD::OR, dl, WideVT, Lo, Hi);
476 Lo = DAG.getAnyExtOrTrunc(Lo, dl, DstEltVT);
479 Lo = DAG.getZExtOrTrunc(Lo, dl, DstEltVT);
482 ShAmt = DAG.getConstant(WideBits - SrcEltBits,
484 Lo = DAG.getNode(ISD::SHL, dl, WideVT, Lo, ShAmt);
485 Lo = DAG.getNode(ISD::SRA, dl, WideVT, Lo, ShAmt);
486 Lo = DAG.getSExtOrTrunc(Lo, dl, DstEltVT);
495 SDValue ScalarLoad = DAG.getExtLoad(ExtType, dl,
502 BasePTR = DAG.getNode(ISD::ADD, dl, BasePTR.getValueType(), BasePTR,
503 DAG.getIntPtrConstant(Stride));
510 SDValue NewChain = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
512 SDValue Value = DAG.getNode(ISD::BUILD_VECTOR, dl,
553 SDValue Ex = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl,
554 RegSclVT, Value, DAG.getConstant(Idx, TLI.getVectorIdxTy()));
557 SDValue Store = DAG.getTruncStore(Chain, dl, Ex, BasePTR,
561 BasePTR = DAG.getNode(ISD::ADD, dl, BasePTR.getValueType(), BasePTR,
562 DAG.getIntPtrConstant(Stride));
566 SDValue TF = DAG.getNode(ISD::TokenFactor, dl, MVT::Other,
597 return DAG.UnrollVectorOp(Op.getNode());
600 EVT MaskTy = TLI.getSetCCResultType(*DAG.getContext(), VT);
608 Mask = DAG.getSelect(DL, BitTy, Mask,
609 DAG.getConstant(APInt::getAllOnesValue(BitTy.getSizeInBits()), BitTy),
610 DAG.getConstant(0, BitTy));
614 Mask = DAG.getNode(ISD::BUILD_VECTOR, DL, MaskTy, &Ops[0], Ops.size());
619 Op1 = DAG.getNode(ISD::BITCAST, DL, MaskTy, Op1);
620 Op2 = DAG.getNode(ISD::BITCAST, DL, MaskTy, Op2);
622 SDValue AllOnes = DAG.getConstant(
624 SDValue NotMask = DAG.getNode(ISD::XOR, DL, MaskTy, Mask, AllOnes);
626 Op1 = DAG.getNode(ISD::AND, DL, MaskTy, Op1, Mask);
627 Op2 = DAG.getNode(ISD::AND, DL, MaskTy, Op2, NotMask);
628 SDValue Val = DAG.getNode(ISD::OR, DL, MaskTy, Op1, Op2);
629 return DAG.getNode(ISD::BITCAST, DL, Op.getValueType(), Val);
638 return DAG.UnrollVectorOp(Op.getNode());
645 SDValue ShiftSz = DAG.getConstant(BW - OrigBW, VT);
648 Op = DAG.getNode(ISD::SHL, DL, VT, Op, ShiftSz);
649 return DAG.getNode(ISD::SRA, DL, VT, Op, ShiftSz);
675 return DAG.UnrollVectorOp(Op.getNode());
681 return DAG.UnrollVectorOp(Op.getNode());
686 Op1 = DAG.getNode(ISD::BITCAST, DL, VT, Op1);
687 Op2 = DAG.getNode(ISD::BITCAST, DL, VT, Op2);
689 SDValue AllOnes = DAG.getConstant(
691 SDValue NotMask = DAG.getNode(ISD::XOR, DL, VT, Mask, AllOnes);
693 Op1 = DAG.getNode(ISD::AND, DL, VT, Op1, Mask);
694 Op2 = DAG.getNode(ISD::AND, DL, VT, Op2, NotMask);
695 SDValue Val = DAG.getNode(ISD::OR, DL, VT, Op1, Op2);
696 return DAG.getNode(ISD::BITCAST, DL, Op.getValueType(), Val);
706 return DAG.UnrollVectorOp(Op.getNode());
713 SDValue HalfWord = DAG.getConstant(BW/2, VT);
719 SDValue HalfWordMask = DAG.getConstant(HWMask, VT);
722 SDValue TWOHW = DAG.getConstantFP((1<<(BW/2)), Op.getValueType());
725 SDValue HI = DAG.getNode(ISD::SRL, DL, VT, Op.getOperand(0), HalfWord);
726 SDValue LO = DAG.getNode(ISD::AND, DL, VT, Op.getOperand(0), HalfWordMask);
730 SDValue fHI = DAG.getNode(ISD::SINT_TO_FP, DL, Op.getValueType(), HI);
731 fHI = DAG.getNode(ISD::FMUL, DL, Op.getValueType(), fHI, TWOHW);
732 SDValue fLO = DAG.getNode(ISD::SINT_TO_FP, DL, Op.getValueType(), LO);
735 return DAG.getNode(ISD::FADD, DL, Op.getValueType(), fHI, fLO);
741 SDValue Zero = DAG.getConstantFP(-0.0, Op.getValueType());
742 return DAG.getNode(ISD::FSUB, SDLoc(Op), Op.getValueType(),
745 return DAG.UnrollVectorOp(Op.getNode());
757 SDValue LHSElem = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, TmpEltVT, LHS,
758 DAG.getConstant(i, TLI.getVectorIdxTy()));
759 SDValue RHSElem = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, dl, TmpEltVT, RHS,
760 DAG.getConstant(i, TLI.getVectorIdxTy()));
761 Ops[i] = DAG.getNode(ISD::SETCC, dl,
762 TLI.getSetCCResultType(*DAG.getContext(), TmpEltVT),
764 Ops[i] = DAG.getSelect(dl, EltVT, Ops[i],
765 DAG.getConstant(APInt::getAllOnesValue
767 DAG.getConstant(0, EltVT));
769 return DAG.getNode(ISD::BUILD_VECTOR, dl, VT, &Ops[0], NumElems);