Home | History | Annotate | Download | only in InstCombine

Lines Matching full:numbits

68 static bool CanEvaluateShifted(Value *V, unsigned NumBits, bool isLeftShift,
84 if (CI->getZExtValue() == NumBits) {
112 return CanEvaluateShifted(I->getOperand(0), NumBits, isLeftShift, IC) &&
113 CanEvaluateShifted(I->getOperand(1), NumBits, isLeftShift, IC);
124 if (CI->getValue() == NumBits) return true;
130 if (CI->getZExtValue() > NumBits) {
133 APInt::getLowBitsSet(TypeWidth, NumBits) << LowBits))
148 if (CI->getValue() == NumBits) return true;
154 if (CI->getValue().ult(TypeWidth) && CI->getZExtValue() > NumBits) {
155 unsigned LowBits = CI->getZExtValue() - NumBits;
157 APInt::getLowBitsSet(TypeWidth, NumBits) << LowBits))
165 return CanEvaluateShifted(SI->getTrueValue(), NumBits, isLeftShift, IC) &&
166 CanEvaluateShifted(SI->getFalseValue(), NumBits, isLeftShift, IC);
174 if (!CanEvaluateShifted(PN->getIncomingValue(i), NumBits, isLeftShift,IC))
183 static Value *GetShiftedValue(Value *V, unsigned NumBits, bool isLeftShift,
188 V = IC.Builder->CreateShl(C, NumBits);
190 V = IC.Builder->CreateLShr(C, NumBits);
207 I->setOperand(0, GetShiftedValue(I->getOperand(0), NumBits,isLeftShift,IC));
208 I->setOperand(1, GetShiftedValue(I->getOperand(1), NumBits,isLeftShift,IC));
221 unsigned NewShAmt = NumBits+CI->getZExtValue();
233 if (CI->getValue() == NumBits) {
234 APInt Mask(APInt::getLowBitsSet(TypeWidth, TypeWidth - NumBits));
246 assert(CI->getZExtValue() > NumBits);
248 CI->getZExtValue() - NumBits));
262 unsigned NewShAmt = NumBits+CI->getZExtValue();
273 if (CI->getValue() == NumBits) {
274 APInt Mask(APInt::getHighBitsSet(TypeWidth, TypeWidth - NumBits));
286 assert(CI->getZExtValue() > NumBits);
288 CI->getZExtValue() - NumBits));
294 I->setOperand(1, GetShiftedValue(I->getOperand(1), NumBits,isLeftShift,IC));
295 I->setOperand(2, GetShiftedValue(I->getOperand(2), NumBits,isLeftShift,IC));
304 NumBits, isLeftShift, IC));