Lines Matching defs:NumBits

70 static bool CanEvaluateShifted(Value *V, unsigned NumBits, bool isLeftShift,
86 if (CI->getZExtValue() == NumBits) {
114 return CanEvaluateShifted(I->getOperand(0), NumBits, isLeftShift, IC, I) &&
115 CanEvaluateShifted(I->getOperand(1), NumBits, isLeftShift, IC, I);
126 if (CI->getValue() == NumBits) return true;
132 if (CI->getZExtValue() > NumBits) {
135 APInt::getLowBitsSet(TypeWidth, NumBits) << LowBits,
151 if (CI->getValue() == NumBits) return true;
157 if (CI->getValue().ult(TypeWidth) && CI->getZExtValue() > NumBits) {
158 unsigned LowBits = CI->getZExtValue() - NumBits;
160 APInt::getLowBitsSet(TypeWidth, NumBits) << LowBits,
169 return CanEvaluateShifted(SI->getTrueValue(), NumBits, isLeftShift,
171 CanEvaluateShifted(SI->getFalseValue(), NumBits, isLeftShift, IC, SI);
179 if (!CanEvaluateShifted(IncValue, NumBits, isLeftShift,
189 static Value *GetShiftedValue(Value *V, unsigned NumBits, bool isLeftShift,
194 V = IC.Builder->CreateShl(C, NumBits);
196 V = IC.Builder->CreateLShr(C, NumBits);
213 0, GetShiftedValue(I->getOperand(0), NumBits, isLeftShift, IC, DL));
215 1, GetShiftedValue(I->getOperand(1), NumBits, isLeftShift, IC, DL));
228 unsigned NewShAmt = NumBits+CI->getZExtValue();
240 if (CI->getValue() == NumBits) {
241 APInt Mask(APInt::getLowBitsSet(TypeWidth, TypeWidth - NumBits));
253 assert(CI->getZExtValue() > NumBits);
255 CI->getZExtValue() - NumBits));
269 unsigned NewShAmt = NumBits+CI->getZExtValue();
280 if (CI->getValue() == NumBits) {
281 APInt Mask(APInt::getHighBitsSet(TypeWidth, TypeWidth - NumBits));
293 assert(CI->getZExtValue() > NumBits);
295 CI->getZExtValue() - NumBits));
302 1, GetShiftedValue(I->getOperand(1), NumBits, isLeftShift, IC, DL));
304 2, GetShiftedValue(I->getOperand(2), NumBits, isLeftShift, IC, DL));
312 PN->setIncomingValue(i, GetShiftedValue(PN->getIncomingValue(i), NumBits,