Lines Matching defs:ShAmtC

1041     unsigned ShAmtC = C->getZExtValue();
1048 if (ShAmtC < SrcWidth &&
1049 MaskedValueIsZero(X, APInt::getHighBitsSet(SrcWidth, ShAmtC), 0, &I))
1050 return new ZExtInst(Builder.CreateShl(X, ShAmtC), Ty);
1055 APInt Mask(APInt::getHighBitsSet(BitWidth, BitWidth - ShAmtC));
1063 if (ShrAmt < ShAmtC) {
1065 Constant *ShiftDiff = ConstantInt::get(Ty, ShAmtC - ShrAmt);
1075 if (ShrAmt > ShAmtC) {
1077 Constant *ShiftDiff = ConstantInt::get(Ty, ShrAmt - ShAmtC);
1088 if (ShrAmt < ShAmtC) {
1090 Constant *ShiftDiff = ConstantInt::get(Ty, ShAmtC - ShrAmt);
1099 APInt Mask(APInt::getHighBitsSet(BitWidth, BitWidth - ShAmtC));
1102 if (ShrAmt > ShAmtC) {
1104 Constant *ShiftDiff = ConstantInt::get(Ty, ShrAmt - ShAmtC);
1110 APInt Mask(APInt::getHighBitsSet(BitWidth, BitWidth - ShAmtC));
1121 unsigned ShDiff = ShrAmtC > ShAmtC ? ShrAmtC - ShAmtC : ShAmtC - ShrAmtC;
1123 auto ShiftOpc = ShrAmtC > ShAmtC ? Shr->getOpcode() : Instruction::Shl;
1131 APInt Mask(APInt::getHighBitsSet(BitWidth, BitWidth - ShAmtC));
1344 unsigned ShAmtC = C->getZExtValue();
1346 if (II && isPowerOf2_32(BitWidth) && Log2_32(BitWidth) == ShAmtC &&
1361 if (C1->ult(ShAmtC)) {
1363 Constant *ShiftDiff = ConstantInt::get(Ty, ShAmtC - ShlAmtC);
1373 APInt Mask(APInt::getLowBitsSet(BitWidth, BitWidth - ShAmtC));
1376 } else if (C1->ugt(ShAmtC)) {
1378 Constant *ShiftDiff = ConstantInt::get(Ty, ShlAmtC - ShAmtC);
1383 NewShl->setHasNoSignedWrap(ShAmtC > 0);
1389 APInt Mask(APInt::getLowBitsSet(BitWidth, BitWidth - ShAmtC));
1393 assert(*C1 == ShAmtC);
1395 APInt Mask(APInt::getLowBitsSet(BitWidth, BitWidth - ShAmtC));
1416 assert(ShAmtC < X->getType()->getScalarSizeInBits() &&
1419 Value *NewLShr = Builder.CreateLShr(X, ShAmtC);
1428 Ty, APInt::getLowBitsSet(BitWidth, BitWidth - ShAmtC));
1436 if (ShAmtC == BitWidth - 1) {
1442 if (ShAmtC == BitWidth - SrcTyBitWidth) {
1444 unsigned NewShAmt = std::min(ShAmtC, SrcTyBitWidth - 1);
1451 if (ShAmtC == BitWidth - 1) {
1463 Value *Signbit = Builder.CreateLShr(X, ShAmtC);
1472 unsigned AmtSum = ShAmtC + C1->getZExtValue();
1486 APInt MaskC = APInt::getAllOnes(BitWidth).lshr(ShAmtC);
1494 MulC->logBase2() == ShAmtC) {
1498 if (ShAmtC * 2 == BitWidth)
1504 X, Builder.CreateLShr(X, ConstantInt::get(Ty, ShAmtC), "",
1516 APInt NewMulC = MulC->lshr(ShAmtC);
1517 // if c is divisible by (1 << ShAmtC):
1518 // lshr (mul nuw x, MulC), ShAmtC -> mul nuw nsw x, (MulC >> ShAmtC)
1519 if (MulC->eq(NewMulC.shl(ShAmtC))) {
1522 assert(ShAmtC != 0 &&
1533 MulC->logBase2() == ShAmtC) {
1535 X, Builder.CreateLShr(X, ConstantInt::get(Ty, ShAmtC), "",
1549 if (ShAmtC >= WidthDiff) {
1551 Value *NewShift = Builder.CreateLShr(NarrowSwap, ShAmtC - WidthDiff);
1556 Constant *ShiftDiff = ConstantInt::get(Ty, WidthDiff - ShAmtC);
1565 if (ShAmtC == 1 && match(Op0, m_Add(m_Value(X), m_Value(Y))) &&