Lines Matching refs:ShAmt
538 auto NewInnerShift = [&](unsigned ShAmt) { in foldShiftedShift() argument
539 InnerShift->setOperand(1, ConstantInt::get(ShType, ShAmt)); in foldShiftedShift()
701 Constant *ShAmt = ConstantExpr::getZExt(Op1, SrcTy); in FoldShiftByConstant() local
703 Value *NSh = Builder.CreateBinOp(I.getOpcode(), TrOp, ShAmt, I.getName()); in FoldShiftByConstant()
717 MaskV = ConstantExpr::get(I.getOpcode(), MaskV, ShAmt); in FoldShiftByConstant()
907 unsigned ShAmt = ShAmtAPInt->getZExtValue(); in visitShl() local
914 if (ShAmt < SrcWidth && in visitShl()
915 MaskedValueIsZero(X, APInt::getHighBitsSet(SrcWidth, ShAmt), 0, &I)) in visitShl()
916 return new ZExtInst(Builder.CreateShl(X, ShAmt), Ty); in visitShl()
921 APInt Mask(APInt::getHighBitsSet(BitWidth, BitWidth - ShAmt)); in visitShl()
929 if (ShrAmt < ShAmt) { in visitShl()
931 Constant *ShiftDiff = ConstantInt::get(Ty, ShAmt - ShrAmt); in visitShl()
937 if (ShrAmt > ShAmt) { in visitShl()
939 Constant *ShiftDiff = ConstantInt::get(Ty, ShrAmt - ShAmt); in visitShl()
950 if (ShrAmt < ShAmt) { in visitShl()
952 Constant *ShiftDiff = ConstantInt::get(Ty, ShAmt - ShrAmt); in visitShl()
957 APInt Mask(APInt::getHighBitsSet(BitWidth, BitWidth - ShAmt)); in visitShl()
960 if (ShrAmt > ShAmt) { in visitShl()
962 Constant *ShiftDiff = ConstantInt::get(Ty, ShrAmt - ShAmt); in visitShl()
968 APInt Mask(APInt::getHighBitsSet(BitWidth, BitWidth - ShAmt)); in visitShl()
974 unsigned AmtSum = ShAmt + ShOp1->getZExtValue(); in visitShl()
983 MaskedValueIsZero(Op0, APInt::getHighBitsSet(BitWidth, ShAmt), 0, &I)) { in visitShl()
989 if (!I.hasNoSignedWrap() && ComputeNumSignBits(Op0, 0, &I) > ShAmt) { in visitShl()
1047 unsigned ShAmt = ShAmtAPInt->getZExtValue(); in visitLShr() local
1050 if (II && isPowerOf2_32(BitWidth) && Log2_32(BitWidth) == ShAmt && in visitLShr()
1066 if (ShOp1->ult(ShAmt)) { in visitLShr()
1068 Constant *ShiftDiff = ConstantInt::get(Ty, ShAmt - ShlAmt); in visitLShr()
1077 APInt Mask(APInt::getLowBitsSet(BitWidth, BitWidth - ShAmt)); in visitLShr()
1080 if (ShOp1->ugt(ShAmt)) { in visitLShr()
1082 Constant *ShiftDiff = ConstantInt::get(Ty, ShlAmt - ShAmt); in visitLShr()
1091 APInt Mask(APInt::getLowBitsSet(BitWidth, BitWidth - ShAmt)); in visitLShr()
1094 assert(*ShOp1 == ShAmt); in visitLShr()
1096 APInt Mask(APInt::getLowBitsSet(BitWidth, BitWidth - ShAmt)); in visitLShr()
1102 assert(ShAmt < X->getType()->getScalarSizeInBits() && in visitLShr()
1105 Value *NewLShr = Builder.CreateLShr(X, ShAmt); in visitLShr()
1113 if (ShAmt == BitWidth - 1) { in visitLShr()
1126 if (ShAmt == BitWidth - SrcTyBitWidth && Op0->hasOneUse()) { in visitLShr()
1128 unsigned NewShAmt = std::min(ShAmt, SrcTyBitWidth - 1); in visitLShr()
1136 if (ShAmt == BitWidth - 1 && in visitLShr()
1141 unsigned AmtSum = ShAmt + ShOp1->getZExtValue(); in visitLShr()
1150 MaskedValueIsZero(Op0, APInt::getLowBitsSet(BitWidth, ShAmt), 0, &I)) { in visitLShr()
1252 unsigned ShAmt = ShAmtAPInt->getZExtValue(); in visitAShr() local
1259 ShAmt == BitWidth - X->getType()->getScalarSizeInBits()) in visitAShr()
1268 if (ShlAmt < ShAmt) { in visitAShr()
1270 Constant *ShiftDiff = ConstantInt::get(Ty, ShAmt - ShlAmt); in visitAShr()
1275 if (ShlAmt > ShAmt) { in visitAShr()
1277 Constant *ShiftDiff = ConstantInt::get(Ty, ShlAmt - ShAmt); in visitAShr()
1286 unsigned AmtSum = ShAmt + ShOp1->getZExtValue(); in visitAShr()
1297 ShAmt = std::min(ShAmt, SrcTy->getScalarSizeInBits() - 1); in visitAShr()
1298 Value *NewSh = Builder.CreateAShr(X, ConstantInt::get(SrcTy, ShAmt)); in visitAShr()
1304 if (ShAmt == BitWidth - 1 && in visitAShr()
1310 MaskedValueIsZero(Op0, APInt::getLowBitsSet(BitWidth, ShAmt), 0, &I)) { in visitAShr()