Home | History | Annotate | Download | only in SelectionDAG

Lines Matching refs:c1

571       // reassoc. (op (op x, c1), c2) -> (op x, (op c1, c2))
579 // reassoc. (op (op x, c1), y) -> (op (op x, y), c1) iff x+c1 has one use
589 // reassoc. (op c2, (op x, c1)) -> (op x, (op c1, c2))
597 // reassoc. (op y, (op x, c1)) -> (op (op x, y), c1) iff x+c1 has one use
1348 // fold (add (shl (add x, c1), c2), ) -> (add (add (shl x, c2), c1<<c2), )
1378 // fold (add c1, c2) -> c1+c2
1394 // fold ((c1-A)+c2) -> (c1+c2)-A
1468 // fold (add (shl (add x, c1), c2), ) -> (add (add (shl x, c2), c1<<c2), )
1620 // fold (sub c1, c2) -> c1-c2
1639 // fold C2-(A+C1) -> (C2-C1)-A
1679 // fold (sub Sym+c1, Sym+c2) -> c1-c2
1750 // fold (mul c1, c2) -> c1*c2
1779 // (mul (shl X, c1), c2) -> (mul X, c2 << c1)
1811 // fold (mul (add x, c1), c2) -> (add (mul x, c2), c1*c2)
1841 // fold (sdiv c1, c2) -> c1/c2
1925 // fold (udiv c1, c2) -> c1/c2
1971 // fold (srem c1, c2) -> c1%c2
2013 // fold (urem c1, c2) -> c1%c2
2418 // fold (and c1, c2) -> c1&c2
2974 // fold (or c1, c2) -> c1|c2
3002 // Canonicalize (or (and X, c1), c2) -> (and (or X, c2), c1|c2)
3003 // iff (c1 & c2) == 0.
3006 ConstantSDNode *C1 = cast<ConstantSDNode>(N0.getOperand(1));
3007 if ((C1->getAPIntValue() & N1C->getAPIntValue()) != 0)
3011 DAG.FoldConstantArithmetic(ISD::OR, VT, N1C, C1));
3060 // (or (and X, C1), (and Y, C2)) -> (and (or X, Y), C3) if possible.
3068 // but not in C1 are already zero. Likewise for Y.
3156 // fold (or (shl x, C1), (srl x, C2)) -> (rotl x, C1)
3157 // fold (or (shl x, C1), (srl x, C2)) -> (rotr x, C2)
3296 // fold (xor c1, c2) -> c1^c2
3364 // fold (xor (xor x, c1), c2) -> (xor x, (xor c1, c2))
3473 // fold (shl c1, c2) -> c1<<c2
3514 // fold (shl (shl x, c1), c2) -> 0 or (shl x, (add c1, c2))
3517 uint64_t c1 = cast<ConstantSDNode>(N0.getOperand(1))->getZExtValue();
3519 if (c1 + c2 >= OpSizeInBits)
3522 DAG.getConstant(c1 + c2, N1.getValueType()));
3525 // fold (shl (ext (shl x, c1)), c2) -> (ext (shl x, (add c1, c2)))
3535 uint64_t c1 =
3541 if (c1 + c2 >= OpSizeInBits)
3546 DAG.getConstant(c1 + c2, N1.getValueType()));
3550 // fold (shl (srl x, c1), c2) -> (and (shl x, (sub c2, c1), MASK) or
3551 // (and (srl x, (sub c1, c2), MASK)
3556 uint64_t c1 = cast<ConstantSDNode>(N0.getOperand(1))->getZExtValue();
3557 if (c1 < VT.getSizeInBits()) {
3560 VT.getSizeInBits() - c1);
3562 if (c2 > c1) {
3563 Mask = Mask.shl(c2-c1);
3565 DAG.getConstant(c2-c1, N1.getValueType()));
3567 Mask = Mask.lshr(c1-c2);
3569 DAG.getConstant(c1-c2, N1.getValueType()));
3575 // fold (shl (sra x, c1), c1) -> (and x, (shl -1, c1))
3603 // fold (sra c1, c2) -> (sra c1, c2)
3618 // fold (sra (shl x, c1), c1) -> sext_inreg for some c1 and target supports
3632 // fold (sra (sra x, c1), c2) -> (sra x, (add c1, c2))
3634 if (ConstantSDNode *C1 = dyn_cast<ConstantSDNode>(N0.getOperand(1))) {
3635 unsigned Sum = N1C->getZExtValue() + C1->getZExtValue();
3699 // fold (sra (trunc (sr x, c1)), c2) -> (trunc (sra x, c1+c2))
3700 // if c1 is equal to the number of bits the trunc removes
3748 // fold (srl c1, c2) -> c1 >>u c2
3765 // fold (srl (srl x, c1), c2) -> 0 or (srl x, (add c1, c2))
3768 uint64_t c1 = cast<ConstantSDNode>(N0.getOperand(1))->getZExtValue();
3770 if (c1 + c2 >= OpSizeInBits)
3773 DAG.getConstant(c1 + c2, N1.getValueType()));
3776 // fold (srl (trunc (srl x, c1)), c2) -> 0 or (trunc (srl x, (add c1, c2)))
3780 uint64_t c1 =
3786 // This is only valid if the OpSizeInBits + c1 = size of inner shift.
3787 if (c1 + OpSizeInBits == InnerShiftSize) {
3788 if (c1 + c2 >= InnerShiftSize)
3793 DAG.getConstant(c1 + c2, ShiftCountVT)));
3937 // fold (ctlz c1) -> c2
3947 // fold (ctlz_zero_undef c1) -> c2
3957 // fold (cttz c1) -> c2
3967 // fold (cttz_zero_undef c1) -> c2
3977 // fold (ctpop c1) -> c2
4201 // fold (sext c1) -> c1
4461 // fold (zext c1) -> c1
4731 // fold (aext c1) -> c1
5069 // fold (sext_in_reg c1) -> c1
5179 // fold (truncate c1) -> c1
5610 // fold (fadd c1, c2) -> (fadd c1, c2)
5631 // If allowed, fold (fadd (fadd x, c1), c2) -> (fadd x, (fadd c1, c2))
5655 // fold (fsub c1, c2) -> c1-c2
5709 // fold (fmul c1c1*c2
5745 // If allowed, fold (fmul (fmul x, c1), c2) -> (fmul x, (fmul c1, c2))
5770 // fold (fdiv c1, c2) -> c1/c2
5817 // fold (frem c1, c2) -> fmod(c1,c2)
5836 // copysign(x, c1) -> fabs(x) iff ispos(c1)
5837 // copysign(x, c1) -> fneg(fabs(x)) iff isneg(c1)
5880 // fold (sint_to_fp c1) -> c1fp
5905 // fold (uint_to_fp c1) -> c1fp
5929 // fold (fp_to_sint c1fp) -> c1
5941 // fold (fp_to_uint c1fp) -> c1
6079 // fold (fabs c1) -> fabs(c1)
6179 // will convert it back to (X & C1) >> C2.