Lines Matching refs:KnownZero
61 APInt &KnownZero, APInt &KnownOne, in ComputeMaskedBits() argument
72 KnownZero.getBitWidth() == BitWidth && in ComputeMaskedBits()
79 KnownZero = ~KnownOne & Mask; in ComputeMaskedBits()
86 KnownZero = Mask; in ComputeMaskedBits()
92 KnownZero.setAllBits(); KnownOne.setAllBits(); in ComputeMaskedBits()
97 KnownZero &= KnownZero2; in ComputeMaskedBits()
116 KnownZero = Mask & APInt::getLowBitsSet(BitWidth, in ComputeMaskedBits()
119 KnownZero.clearAllBits(); in ComputeMaskedBits()
127 KnownZero.clearAllBits(); KnownOne.clearAllBits(); in ComputeMaskedBits()
129 ComputeMaskedBits(GA->getAliasee(), Mask, KnownZero, KnownOne, in ComputeMaskedBits()
139 KnownZero = Mask & APInt::getLowBitsSet(BitWidth, in ComputeMaskedBits()
145 KnownZero.clearAllBits(); KnownOne.clearAllBits(); in ComputeMaskedBits()
153 APInt KnownZero2(KnownZero), KnownOne2(KnownOne); in ComputeMaskedBits()
158 ComputeMaskedBits(I->getOperand(1), Mask, KnownZero, KnownOne, TD, Depth+1); in ComputeMaskedBits()
159 APInt Mask2(Mask & ~KnownZero); in ComputeMaskedBits()
162 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
168 KnownZero |= KnownZero2; in ComputeMaskedBits()
172 ComputeMaskedBits(I->getOperand(1), Mask, KnownZero, KnownOne, TD, Depth+1); in ComputeMaskedBits()
176 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
180 KnownZero &= KnownZero2; in ComputeMaskedBits()
186 ComputeMaskedBits(I->getOperand(1), Mask, KnownZero, KnownOne, TD, Depth+1); in ComputeMaskedBits()
189 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
193 APInt KnownZeroOut = (KnownZero & KnownZero2) | (KnownOne & KnownOne2); in ComputeMaskedBits()
195 KnownOne = (KnownZero & KnownOne2) | (KnownOne & KnownZero2); in ComputeMaskedBits()
196 KnownZero = KnownZeroOut; in ComputeMaskedBits()
201 ComputeMaskedBits(I->getOperand(1), Mask2, KnownZero, KnownOne, TD,Depth+1); in ComputeMaskedBits()
204 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
212 unsigned TrailZ = KnownZero.countTrailingOnes() + in ComputeMaskedBits()
214 unsigned LeadZ = std::max(KnownZero.countLeadingOnes() + in ComputeMaskedBits()
220 KnownZero = APInt::getLowBitsSet(BitWidth, TrailZ) | in ComputeMaskedBits()
222 KnownZero &= Mask; in ComputeMaskedBits()
243 KnownZero = APInt::getHighBitsSet(BitWidth, LeadZ) & Mask; in ComputeMaskedBits()
247 ComputeMaskedBits(I->getOperand(2), Mask, KnownZero, KnownOne, TD, Depth+1); in ComputeMaskedBits()
250 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
255 KnownZero &= KnownZero2; in ComputeMaskedBits()
282 KnownZero = KnownZero.zextOrTrunc(SrcBitWidth); in ComputeMaskedBits()
284 ComputeMaskedBits(I->getOperand(0), MaskIn, KnownZero, KnownOne, TD, in ComputeMaskedBits()
286 KnownZero = KnownZero.zextOrTrunc(BitWidth); in ComputeMaskedBits()
290 KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth); in ComputeMaskedBits()
299 ComputeMaskedBits(I->getOperand(0), Mask, KnownZero, KnownOne, TD, in ComputeMaskedBits()
310 KnownZero = KnownZero.trunc(SrcBitWidth); in ComputeMaskedBits()
312 ComputeMaskedBits(I->getOperand(0), MaskIn, KnownZero, KnownOne, TD, in ComputeMaskedBits()
314 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
315 KnownZero = KnownZero.zext(BitWidth); in ComputeMaskedBits()
320 if (KnownZero[SrcBitWidth-1]) // Input sign bit known zero in ComputeMaskedBits()
321 KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth); in ComputeMaskedBits()
331 ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero, KnownOne, TD, in ComputeMaskedBits()
333 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
334 KnownZero <<= ShiftAmt; in ComputeMaskedBits()
336 KnownZero |= APInt::getLowBitsSet(BitWidth, ShiftAmt); // low bits known 0 in ComputeMaskedBits()
348 ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero,KnownOne, TD, in ComputeMaskedBits()
350 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
351 KnownZero = APIntOps::lshr(KnownZero, ShiftAmt); in ComputeMaskedBits()
354 KnownZero |= APInt::getHighBitsSet(BitWidth, ShiftAmt); in ComputeMaskedBits()
366 ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero, KnownOne, TD, in ComputeMaskedBits()
368 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
369 KnownZero = APIntOps::lshr(KnownZero, ShiftAmt); in ComputeMaskedBits()
373 if (KnownZero[BitWidth-ShiftAmt-1]) // New bits are known zero. in ComputeMaskedBits()
374 KnownZero |= HighBits; in ComputeMaskedBits()
398 KnownZero = APInt::getHighBitsSet(BitWidth, NLZ2) & Mask; in ComputeMaskedBits()
428 KnownZero |= KnownZero2 & Mask; in ComputeMaskedBits()
433 KnownZero |= APInt::getLowBitsSet(BitWidth, in ComputeMaskedBits()
439 KnownZero |= LHSKnownZero & Mask; in ComputeMaskedBits()
444 if (Mask.isNegative() && !KnownZero.isNegative() && !KnownOne.isNegative()){ in ComputeMaskedBits()
450 KnownZero |= APInt::getSignBit(BitWidth); in ComputeMaskedBits()
457 KnownZero |= APInt::getSignBit(BitWidth); in ComputeMaskedBits()
477 KnownZero = KnownZero2 & LowBits; in ComputeMaskedBits()
483 KnownZero |= ~LowBits; in ComputeMaskedBits()
490 KnownZero &= Mask; in ComputeMaskedBits()
493 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
499 if (Mask.isNegative() && KnownZero.isNonNegative()) { in ComputeMaskedBits()
506 KnownZero |= LHSKnownZero; in ComputeMaskedBits()
516 KnownZero |= ~LowBits & Mask; in ComputeMaskedBits()
517 ComputeMaskedBits(I->getOperand(0), Mask2, KnownZero, KnownOne, TD, in ComputeMaskedBits()
519 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
527 ComputeMaskedBits(I->getOperand(0), AllOnes, KnownZero, KnownOne, in ComputeMaskedBits()
532 unsigned Leaders = std::max(KnownZero.countLeadingOnes(), in ComputeMaskedBits()
535 KnownZero = APInt::getHighBitsSet(BitWidth, Leaders) & Mask; in ComputeMaskedBits()
546 KnownZero = Mask & APInt::getLowBitsSet(BitWidth, in ComputeMaskedBits()
586 KnownZero = APInt::getLowBitsSet(BitWidth, TrailZ) & Mask; in ComputeMaskedBits()
627 APInt KnownZero3(KnownZero), KnownOne3(KnownOne); in ComputeMaskedBits()
630 KnownZero = Mask & in ComputeMaskedBits()
645 if (Depth < MaxDepth - 1 && !KnownZero && !KnownOne) { in ComputeMaskedBits()
650 KnownZero = APInt::getAllOnesValue(BitWidth); in ComputeMaskedBits()
660 ComputeMaskedBits(P->getIncomingValue(i), KnownZero | KnownOne, in ComputeMaskedBits()
662 KnownZero &= KnownZero2; in ComputeMaskedBits()
666 if (!KnownZero && !KnownOne) in ComputeMaskedBits()
680 KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - LowBits); in ComputeMaskedBits()
685 KnownZero = APInt::getHighBitsSet(64, 32); in ComputeMaskedBits()
695 void llvm::ComputeSignBit(Value *V, bool &KnownZero, bool &KnownOne, in ComputeSignBit() argument
699 KnownZero = false; in ComputeSignBit()
708 KnownZero = ZeroBits[BitWidth - 1]; in ComputeSignBit()
792 APInt KnownZero(BitWidth, 0); in isKnownNonZero() local
794 ComputeMaskedBits(X, APInt(BitWidth, 1), KnownZero, KnownOne, TD, Depth); in isKnownNonZero()
833 APInt KnownZero(BitWidth, 0); in isKnownNonZero() local
838 ComputeMaskedBits(X, Mask, KnownZero, KnownOne, TD, Depth); in isKnownNonZero()
843 ComputeMaskedBits(Y, Mask, KnownZero, KnownOne, TD, Depth); in isKnownNonZero()
862 APInt KnownZero(BitWidth, 0); in isKnownNonZero() local
864 ComputeMaskedBits(V, APInt::getAllOnesValue(BitWidth), KnownZero, KnownOne, in isKnownNonZero()
880 APInt KnownZero(Mask.getBitWidth(), 0), KnownOne(Mask.getBitWidth(), 0); in MaskedValueIsZero() local
881 ComputeMaskedBits(V, Mask, KnownZero, KnownOne, TD, Depth); in MaskedValueIsZero()
882 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in MaskedValueIsZero()
883 return (KnownZero & Mask) == Mask; in MaskedValueIsZero()
973 APInt KnownZero(TyBits, 0), KnownOne(TyBits, 0); in ComputeNumSignBits() local
975 ComputeMaskedBits(U->getOperand(0), Mask, KnownZero, KnownOne, TD, in ComputeNumSignBits()
980 if ((KnownZero | APInt(TyBits, 1)) == Mask) in ComputeNumSignBits()
985 if (KnownZero.isNegative()) in ComputeNumSignBits()
1000 APInt KnownZero(TyBits, 0), KnownOne(TyBits, 0); in ComputeNumSignBits() local
1002 ComputeMaskedBits(U->getOperand(1), Mask, KnownZero, KnownOne, in ComputeNumSignBits()
1006 if ((KnownZero | APInt(TyBits, 1)) == Mask) in ComputeNumSignBits()
1011 if (KnownZero.isNegative()) in ComputeNumSignBits()
1047 APInt KnownZero(TyBits, 0), KnownOne(TyBits, 0); in ComputeNumSignBits() local
1049 ComputeMaskedBits(V, Mask, KnownZero, KnownOne, TD, Depth); in ComputeNumSignBits()
1051 if (KnownZero.isNegative()) { // sign bit is 0 in ComputeNumSignBits()
1052 Mask = KnownZero; in ComputeNumSignBits()