Lines Matching refs:NumBits
70 static bool CanEvaluateShifted(Value *V, unsigned NumBits, bool isLeftShift, in CanEvaluateShifted() argument
86 if (CI->getZExtValue() == NumBits) { in CanEvaluateShifted()
114 return CanEvaluateShifted(I->getOperand(0), NumBits, isLeftShift, IC) && in CanEvaluateShifted()
115 CanEvaluateShifted(I->getOperand(1), NumBits, isLeftShift, IC); in CanEvaluateShifted()
126 if (CI->getValue() == NumBits) return true; in CanEvaluateShifted()
132 if (CI->getZExtValue() > NumBits) { in CanEvaluateShifted()
135 APInt::getLowBitsSet(TypeWidth, NumBits) << LowBits)) in CanEvaluateShifted()
150 if (CI->getValue() == NumBits) return true; in CanEvaluateShifted()
156 if (CI->getValue().ult(TypeWidth) && CI->getZExtValue() > NumBits) { in CanEvaluateShifted()
157 unsigned LowBits = CI->getZExtValue() - NumBits; in CanEvaluateShifted()
159 APInt::getLowBitsSet(TypeWidth, NumBits) << LowBits)) in CanEvaluateShifted()
167 return CanEvaluateShifted(SI->getTrueValue(), NumBits, isLeftShift, IC) && in CanEvaluateShifted()
168 CanEvaluateShifted(SI->getFalseValue(), NumBits, isLeftShift, IC); in CanEvaluateShifted()
176 if (!CanEvaluateShifted(PN->getIncomingValue(i), NumBits, isLeftShift,IC)) in CanEvaluateShifted()
185 static Value *GetShiftedValue(Value *V, unsigned NumBits, bool isLeftShift, in GetShiftedValue() argument
190 V = IC.Builder->CreateShl(C, NumBits); in GetShiftedValue()
192 V = IC.Builder->CreateLShr(C, NumBits); in GetShiftedValue()
209 I->setOperand(0, GetShiftedValue(I->getOperand(0), NumBits,isLeftShift,IC)); in GetShiftedValue()
210 I->setOperand(1, GetShiftedValue(I->getOperand(1), NumBits,isLeftShift,IC)); in GetShiftedValue()
223 unsigned NewShAmt = NumBits+CI->getZExtValue(); in GetShiftedValue()
235 if (CI->getValue() == NumBits) { in GetShiftedValue()
236 APInt Mask(APInt::getLowBitsSet(TypeWidth, TypeWidth - NumBits)); in GetShiftedValue()
248 assert(CI->getZExtValue() > NumBits); in GetShiftedValue()
250 CI->getZExtValue() - NumBits)); in GetShiftedValue()
264 unsigned NewShAmt = NumBits+CI->getZExtValue(); in GetShiftedValue()
275 if (CI->getValue() == NumBits) { in GetShiftedValue()
276 APInt Mask(APInt::getHighBitsSet(TypeWidth, TypeWidth - NumBits)); in GetShiftedValue()
288 assert(CI->getZExtValue() > NumBits); in GetShiftedValue()
290 CI->getZExtValue() - NumBits)); in GetShiftedValue()
296 I->setOperand(1, GetShiftedValue(I->getOperand(1), NumBits,isLeftShift,IC)); in GetShiftedValue()
297 I->setOperand(2, GetShiftedValue(I->getOperand(2), NumBits,isLeftShift,IC)); in GetShiftedValue()
306 NumBits, isLeftShift, IC)); in GetShiftedValue()