Home | History | Annotate | Download | only in SelectionDAG

Lines Matching defs:DAG

998 /// type of the given function.  This does not require a DAG or a return value,
1080 SelectionDAG &DAG) const {
1086 return DAG.getGLOBAL_OFFSET_TABLE(getPointerTy());
1146 SDValue New = DAG.getNode(Op.getOpcode(), dl, VT, Op.getOperand(0),
1147 DAG.getConstant(Demanded &
1181 const TargetLowering &TLI = DAG.getTargetLoweringInfo();
1186 EVT SmallVT = EVT::getIntegerVT(*DAG.getContext(), SmallVTBits);
1190 SDValue X = DAG.getNode(Op.getOpcode(), dl, SmallVT,
1191 DAG.getNode(ISD::TRUNCATE, dl, SmallVT,
1193 DAG.getNode(ISD::TRUNCATE, dl, SmallVT,
1195 SDValue Z = DAG.getNode(ISD::ZERO_EXTEND, dl, Op.getValueType(), X);
1204 /// use this information to simplify Op, create a new simplified DAG node and
1229 TLO.DAG.ComputeMaskedBits(Op, KnownZero, KnownOne, Depth);
1238 return TLO.CombineTo(Op, TLO.DAG.getUNDEF(Op.getValueType()));
1259 TLO.DAG
1286 return TLO.CombineTo(Op, TLO.DAG.getConstant(0, Op.getValueType()));
1357 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::OR, dl, Op.getValueType(),
1374 SDValue ANDC = TLO.DAG.getConstant(~KnownOne & NewMask, VT);
1375 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::AND, dl, VT,
1389 SDValue New = TLO.DAG.getNode(Op.getOpcode(), dl,VT, Op.getOperand(0),
1390 TLO.DAG.getConstant(Expanded, VT));
1463 TLO.DAG.getConstant(Diff, Op.getOperand(1).getValueType());
1465 return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, dl, VT,
1486 TLO.DAG.getNode(ISD::SHL, dl, InnerVT, InnerOp,
1487 TLO.DAG.getConstant(ShAmt, ShTy));
1490 TLO.DAG.getNode(ISD::ANY_EXTEND, dl, Op.getValueType(),
1527 TLO.DAG.getConstant(Diff, Op.getOperand(1).getValueType());
1528 return TLO.CombineTo(Op, TLO.DAG.getNode(Opc, dl, VT,
1552 TLO.DAG.getNode(ISD::SRL, dl, Op.getValueType(),
1584 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, dl, VT,
1607 SDValue ShiftAmt = TLO.DAG.getConstant(BitWidth - ShAmt, ShiftAmtTy);
1608 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SHL, dl,
1644 TLO.DAG.getZeroExtendInReg(Op.getOperand(0),dl,ExVT));
1664 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::ANY_EXTEND, dl,
1686 return TLO.CombineTo(Op,TLO.DAG.getNode(ISD::ANY_EXTEND, dl,
1704 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::ZERO_EXTEND, dl,
1763 TLO.DAG.getConstant(ShVal, getShiftAmountTy(Op.getValueType()));
1773 SDValue NewTrunc = TLO.DAG.getNode(ISD::TRUNCATE, dl,
1776 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SRL, dl,
1816 SDValue Sign = TLO.DAG.getNode(ISD::FGETSIGN, dl, Ty, Op.getOperand(0));
1819 Sign = TLO.DAG.getNode(ISD::ZERO_EXTEND, dl, Op.getValueType(), Sign);
1821 SDValue ShAmt = TLO.DAG.getConstant(ShVal, Op.getValueType());
1822 return TLO.CombineTo(Op, TLO.DAG.getNode(ISD::SHL, dl,
1848 TLO.DAG.ComputeMaskedBits(Op, KnownZero, KnownOne, Depth);
1855 return TLO.CombineTo(Op, TLO.DAG.getConstant(KnownOne, Op.getValueType()));
1866 const SelectionDAG &DAG,
1879 /// DAG Combiner.
1895 static bool ValueHasExactlyOneBitSet(SDValue Val, const SelectionDAG &DAG) {
1919 DAG.ComputeMaskedBits(Val, KnownZero, KnownOne);
1930 SelectionDAG &DAG = DCI.DAG;
1936 case ISD::SETFALSE2: return DAG.getConstant(0, VT);
1938 case ISD::SETTRUE2: return DAG.getConstant(1, VT);
1944 return DAG.getSetCC(dl, VT, N1, N0, ISD::getSetCCSwappedOperands(Cond));
1968 SDValue Zero = DAG.getConstant(0, N0.getValueType());
1969 return DAG.getSetCC(dl, VT, N0.getOperand(0).getOperand(0),
1988 SDValue Sub = DAG.getNode(ISD::SUB, dl, CTVT, CTOp,
1989 DAG.getConstant(1, CTVT));
1990 SDValue And = DAG.getNode(ISD::AND, dl, CTVT, CTOp, Sub);
1992 return DAG.getSetCC(dl, VT, And, DAG.getConstant(0, CTVT), CC);
2024 EVT MinVT = EVT::getIntegerVT(*DAG.getContext(), MinBits);
2027 SDValue Trunc = DAG.getNode(ISD::TRUNCATE, dl, MinVT, PreZExt);
2028 SDValue C = DAG.getConstant(C1.trunc(MinBits), MinVT);
2029 return DAG.getSetCC(dl, VT, Trunc, C, Cond);
2072 EVT newVT = EVT::getIntegerVT(*DAG.getContext(), bestWidth);
2077 Ptr = DAG.getNode(ISD::ADD, dl, PtrType, Lod->getBasePtr(),
2078 DAG.getConstant(bestOffset, PtrType));
2080 SDValue NewLoad = DAG.getLoad(newVT, dl, Lod->getChain(), Ptr,
2083 return DAG.getSetCC(dl, VT,
2084 DAG.getNode(ISD::AND, dl, newVT, NewLoad,
2085 DAG.getConstant(bestMask.trunc(bestWidth),
2087 DAG.getConstant(0LL, newVT), Cond);
2103 case ISD::SETEQ: return DAG.getConstant(0, VT);
2106 case ISD::SETNE: return DAG.getConstant(1, VT);
2110 return DAG.getConstant(C1.isNegative(), VT);
2114 return DAG.getConstant(C1.isNonNegative(), VT);
2132 return DAG.getSetCC(dl, VT, N0.getOperand(0),
2133 DAG.getConstant(C1.trunc(InSize), newVT),
2150 return DAG.getConstant(Cond == ISD::SETNE, VT);
2158 ZextOp = DAG.getNode(ISD::AND, dl, Op0Ty, N0.getOperand(0),
2159 DAG.getConstant(Imm, Op0Ty));
2164 return DAG.getSetCC(dl, VT, ZextOp,
2165 DAG.getConstant(C1 & APInt::getLowBitsSet(
2177 return DAG.getNode(ISD::TRUNCATE, dl, VT, N0);
2182 return DAG.getSetCC(dl, VT, N0.getOperand(0), N0.getOperand(1), CC);
2194 if (DAG.MaskedValueIsZero(N0,
2205 Val = DAG.getNode(ISD::AND, dl, N0.getValueType(),
2210 return DAG.getSetCC(dl, VT, Val, N1,
2225 return DAG.getSetCC(dl, VT, Op0.getOperand(0), Op0.getOperand(1),
2232 Op0 = DAG.getNode(ISD::AND, dl, VT,
2233 DAG.getNode(ISD::TRUNCATE, dl, VT, Op0.getOperand(0)),
2234 DAG.getConstant(1, VT));
2236 Op0 = DAG.getNode(ISD::AND, dl, VT,
2237 DAG.getNode(ISD::ANY_EXTEND, dl, VT, Op0.getOperand(0)),
2238 DAG.getConstant(1, VT));
2240 return DAG.getSetCC(dl, VT, Op0,
2241 DAG.getConstant(0, Op0.getValueType()),
2259 if (C1 == MinVal) return DAG.getConstant(1, VT); // X >= MIN --> true
2261 return DAG.getSetCC(dl, VT, N0,
2262 DAG.getConstant(C1-1, N1.getValueType()),
2267 if (C1 == MaxVal) return DAG.getConstant(1, VT); // X <= MAX --> true
2269 return DAG.getSetCC(dl, VT, N0,
2270 DAG.getConstant(C1+1, N1.getValueType()),
2275 return DAG.getConstant(0, VT); // X < MIN --> false
2277 return DAG.getConstant(1, VT); // X >= MIN --> true
2279 return DAG.getConstant(0, VT); // X > MAX --> false
2281 return DAG.getConstant(1, VT); // X <= MAX --> true
2285 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETNE);
2288 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETNE);
2292 return DAG.getSetCC(dl, VT, N0,
2293 DAG.getConstant(MinVal, N0.getValueType()),
2297 return DAG.getSetCC(dl, VT, N0,
2298 DAG.getConstant(MaxVal, N0.getValueType()),
2307 return DAG.getSetCC(dl, VT, N0,
2308 DAG.getConstant(0, N1.getValueType()),
2315 DAG.getConstant(APInt::getAllOnesValue(OperandBitSize),
2317 return DAG.getSetCC(dl, VT, N0, ConstMinusOne, ISD::SETGT);
2332 return DAG.getNode(ISD::TRUNCATE, dl, VT,
2333 DAG.getNode(ISD::SRL, dl, N0.getValueType(), N0,
2334 DAG.getConstant(AndRHS->getAPIntValue().logBase2(), ShiftTy)));
2340 return DAG.getNode(ISD::TRUNCATE, dl, VT,
2341 DAG.getNode(ISD::SRL, dl, N0.getValueType(), N0,
2342 DAG.getConstant(C1.logBase2(), ShiftTy)));
2350 SDValue O = DAG.FoldSetCC(VT, N0, N1, Cond, dl);
2360 return DAG.getConstant(0, VT);
2362 return DAG.getConstant(1, VT);
2364 return DAG.getUNDEF(VT);
2373 return DAG.getSetCC(dl, VT, N0, N0, Cond);
2385 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOLE);
2388 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETULE);
2391 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETUGT);
2394 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOGT);
2398 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOGE);
2401 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETUGE);
2404 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETULT);
2407 return DAG.getSetCC(dl, VT, N0, N1, ISD::SETOLT);
2419 return DAG.getConstant(ISD::isTrueWhenEqual(Cond), VT);
2421 return DAG.getConstant(ISD::isTrueWhenEqual(Cond) ? -1 : 0, VT);
2426 return DAG.getConstant(ISD::isTrueWhenEqual(Cond), VT);
2428 return DAG.getConstant(UOF, VT);
2433 return DAG.getSetCC(dl, VT, N0, N1, NewCond);
2443 return DAG.getSetCC(dl, VT, N0.getOperand(1), N1.getOperand(1), Cond);
2445 return DAG.getSetCC(dl, VT, N0.getOperand(0), N1.getOperand(0), Cond);
2446 if (DAG.isCommutativeBinOp(N0.getOpcode())) {
2449 return DAG.getSetCC(dl, VT, N0.getOperand(1), N1.getOperand(0),
2452 return DAG.getSetCC(dl, VT, N0.getOperand(0), N1.getOperand(1),
2465 return DAG.getSetCC(dl, VT, N0.getOperand(0),
2466 DAG.getConstant(RHSC->getAPIntValue()-
2475 if (DAG.MaskedValueIsZero(N0.getOperand(0), ~LHSR->getAPIntValue()))
2477 DAG.getSetCC(dl, VT, N0.getOperand(0),
2478 DAG.getConstant(LHSR->getAPIntValue() ^
2488 DAG.getSetCC(dl, VT, N0.getOperand(1),
2489 DAG.getConstant(SUBC->getAPIntValue() -
2507 return DAG.getSetCC(dl, VT, N0.getOperand(1),
2508 DAG.getConstant(0, N0.getValueType()), Cond);
2510 if (DAG.isCommutativeBinOp(N0.getOpcode()))
2511 return DAG.getSetCC(dl, VT, N0.getOperand(0),
2512 DAG.getConstant(0, N0.getValueType()), Cond);
2516 SDValue SH = DAG.getNode(ISD::SHL, dl, N1.getValueType(), N1,
2517 DAG.getConstant(1, getShiftAmountTy(N1.getValueType())));
2520 return DAG.getSetCC(dl, VT, N0.getOperand(0), SH, Cond);
2530 return DAG.getSetCC(dl, VT, N1.getOperand(1),
2531 DAG.getConstant(0, N1.getValueType()), Cond);
2533 if (DAG.isCommutativeBinOp(N1.getOpcode())) {
2534 return DAG.getSetCC(dl, VT, N1.getOperand(0),
2535 DAG.getConstant(0, N1.getValueType()), Cond);
2539 SDValue SH = DAG.getNode(ISD::SHL, dl, N1.getValueType(), N0,
2540 DAG.getConstant(1, getShiftAmountTy(N0.getValueType())));
2543 return DAG.getSetCC(dl, VT, SH, N1.getOperand(0), Cond);
2554 if (ValueHasExactlyOneBitSet(N1, DAG)) {
2556 SDValue Zero = DAG.getConstant(0, N1.getValueType());
2557 return DAG.getSetCC(dl, VT, N0, Zero, Cond);
2562 if (ValueHasExactlyOneBitSet(N0, DAG)) {
2564 SDValue Zero = DAG.getConstant(0, N0.getValueType());
2565 return DAG.getSetCC(dl, VT, N1, Zero, Cond);
2576 Temp = DAG.getNode(ISD::XOR, dl, MVT::i1, N0, N1);
2577 N0 = DAG.getNOT(dl, Temp, MVT::i1);
2582 N0 = DAG.getNode(ISD::XOR, dl, MVT::i1, N0, N1);
2586 Temp = DAG.getNOT(dl, N0, MVT::i1);
2587 N0 = DAG.getNode(ISD::AND, dl, MVT::i1, N1, Temp);
2593 Temp = DAG.getNOT(dl, N1, MVT::i1);
2594 N0 = DAG.getNode(ISD::AND, dl, MVT::i1, N0, Temp);
2600 Temp = DAG.getNOT(dl, N0, MVT::i1);
2601 N0 = DAG.getNode(ISD::OR, dl, MVT::i1, N1, Temp);
2607 Temp = DAG.getNOT(dl, N1, MVT::i1);
2608 N0 = DAG.getNode(ISD::OR, dl, MVT::i1, N0, Temp);
2615 N0 = DAG.getNode(ISD::ZERO_EXTEND, dl, VT, N0);
2721 SelectionDAG &DAG) const {
2761 Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(),
2773 Ops.push_back(DAG.getTargetConstant(C->getAPIntValue().getSExtValue(),
3133 SDValue Op, SelectionDAG *DAG) {
3153 ResultOps, *DAG);
3184 SelectionDAG *DAG) const {
3192 ChooseConstraint(OpInfo, *this, Op, DAG);
3256 SelectionDAG &DAG) const {
3265 SDValue Amt = DAG.getConstant(ShAmt, getShiftAmountTy(Op1.getValueType()));
3266 Op1 = DAG.getNode(ISD::SRA, dl, Op1.getValueType(), Op1, Amt);
3275 Op2 = DAG.getConstant(xn, Op1.getValueType());
3276 return DAG.getNode(ISD::MUL, dl, Op1.getValueType(), Op1, Op2);
3280 /// return a DAG expression to select that will generate the same value by
3284 BuildSDIV(SDNode *N, SelectionDAG &DAG, bool IsAfterLegalization,
3302 Q = DAG.getNode(ISD::MULHS, dl, VT, N->getOperand(0),
3303 DAG.getConstant(magics.m, VT));
3306 Q = SDValue(DAG.getNode(ISD::SMUL_LOHI, dl, DAG.getVTList(VT, VT),
3308 DAG.getConstant(magics.m, VT)).getNode(), 1);
3313 Q = DAG.getNode(ISD::ADD, dl, VT, Q, N->getOperand(0));
3319 Q = DAG.getNode(ISD::SUB, dl, VT, Q, N->getOperand(0));
3325 Q = DAG.getNode(ISD::SRA, dl, VT, Q,
3326 DAG.getConstant(magics.s, getShiftAmountTy(Q.getValueType())));
3332 DAG.getNode(ISD::SRL, dl, VT, Q, DAG.getConstant(VT.getSizeInBits()-1,
3336 return DAG.getNode(ISD::ADD, dl, VT, Q, T);
3340 /// return a DAG expression to select that will generate the same value by
3344 BuildUDIV(SDNode *N, SelectionDAG &DAG, bool IsAfterLegalization,
3365 Q = DAG.getNode(ISD::SRL, dl, VT, Q,
3366 DAG.getConstant(Shift, getShiftAmountTy(Q.getValueType())));
3379 Q = DAG.getNode(ISD::MULHU, dl, VT, Q, DAG.getConstant(magics.m, VT));
3382 Q = SDValue(DAG.getNode(ISD::UMUL_LOHI, dl, DAG.getVTList(VT, VT), Q,
3383 DAG.getConstant(magics.m, VT)).getNode(), 1);
3392 return DAG.getNode(ISD::SRL, dl, VT, Q,
3393 DAG.getConstant(magics.s, getShiftAmountTy(Q.getValueType())));
3395 SDValue NPQ = DAG.getNode(ISD::SUB, dl, VT, N->getOperand(0), Q);
3398 NPQ = DAG.getNode(ISD::SRL, dl, VT, NPQ,
3399 DAG.getConstant(1, getShiftAmountTy(NPQ.getValueType())));
3402 NPQ = DAG.getNode(ISD::ADD, dl, VT, NPQ, Q);
3405 return DAG.getNode(ISD::SRL, dl, VT, NPQ,
3406 DAG.getConstant(magics.s-1, getShiftAmountTy(NPQ.getValueType())));