Lines Matching refs:KnownOne
61 APInt &KnownZero, APInt &KnownOne, in ComputeMaskedBits() argument
73 KnownOne.getBitWidth() == BitWidth && in ComputeMaskedBits()
78 KnownOne = CI->getValue() & Mask; in ComputeMaskedBits()
79 KnownZero = ~KnownOne & Mask; in ComputeMaskedBits()
85 KnownOne.clearAllBits(); in ComputeMaskedBits()
92 KnownZero.setAllBits(); KnownOne.setAllBits(); in ComputeMaskedBits()
98 KnownOne &= KnownOne2; in ComputeMaskedBits()
120 KnownOne.clearAllBits(); in ComputeMaskedBits()
127 KnownZero.clearAllBits(); KnownOne.clearAllBits(); in ComputeMaskedBits()
129 ComputeMaskedBits(GA->getAliasee(), Mask, KnownZero, KnownOne, 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()
162 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
166 KnownOne &= KnownOne2; in ComputeMaskedBits()
172 ComputeMaskedBits(I->getOperand(1), Mask, KnownZero, KnownOne, TD, Depth+1); in ComputeMaskedBits()
173 APInt Mask2(Mask & ~KnownOne); in ComputeMaskedBits()
176 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); in ComputeMaskedBits()
182 KnownOne |= KnownOne2; 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()
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()
211 KnownOne.clearAllBits(); 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()
254 KnownOne &= KnownOne2; in ComputeMaskedBits()
283 KnownOne = KnownOne.zextOrTrunc(SrcBitWidth); in ComputeMaskedBits()
284 ComputeMaskedBits(I->getOperand(0), MaskIn, KnownZero, KnownOne, TD, in ComputeMaskedBits()
287 KnownOne = KnownOne.zextOrTrunc(BitWidth); in ComputeMaskedBits()
299 ComputeMaskedBits(I->getOperand(0), Mask, KnownZero, KnownOne, TD, in ComputeMaskedBits()
311 KnownOne = KnownOne.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()
316 KnownOne = KnownOne.zext(BitWidth); in ComputeMaskedBits()
322 else if (KnownOne[SrcBitWidth-1]) // Input sign bit known set in ComputeMaskedBits()
323 KnownOne |= 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()
335 KnownOne <<= ShiftAmt; 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()
352 KnownOne = APIntOps::lshr(KnownOne, 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()
370 KnownOne = APIntOps::lshr(KnownOne, ShiftAmt); in ComputeMaskedBits()
375 else if (KnownOne[BitWidth-ShiftAmt-1]) // New bits are known one. in ComputeMaskedBits()
376 KnownOne |= HighBits; in ComputeMaskedBits()
429 KnownOne |= KnownOne2 & Mask; in ComputeMaskedBits()
440 KnownOne |= LHSKnownOne & Mask; in ComputeMaskedBits()
444 if (Mask.isNegative() && !KnownZero.isNegative() && !KnownOne.isNegative()){ in ComputeMaskedBits()
453 KnownOne |= APInt::getSignBit(BitWidth); in ComputeMaskedBits()
460 KnownOne |= APInt::getSignBit(BitWidth); in ComputeMaskedBits()
478 KnownOne = KnownOne2 & LowBits; in ComputeMaskedBits()
488 KnownOne |= ~LowBits; in ComputeMaskedBits()
491 KnownOne &= Mask; in ComputeMaskedBits()
493 assert((KnownZero & KnownOne) == 0 && "Bits known to be one AND zero?"); 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()
534 KnownOne.clearAllBits(); in ComputeMaskedBits()
627 APInt KnownZero3(KnownZero), KnownOne3(KnownOne); in ComputeMaskedBits()
645 if (Depth < MaxDepth - 1 && !KnownZero && !KnownOne) { in ComputeMaskedBits()
651 KnownOne = APInt::getAllOnesValue(BitWidth); in ComputeMaskedBits()
660 ComputeMaskedBits(P->getIncomingValue(i), KnownZero | KnownOne, in ComputeMaskedBits()
663 KnownOne &= KnownOne2; in ComputeMaskedBits()
666 if (!KnownZero && !KnownOne) in ComputeMaskedBits()
695 void llvm::ComputeSignBit(Value *V, bool &KnownZero, bool &KnownOne, in ComputeSignBit() argument
700 KnownOne = false; in ComputeSignBit()
707 KnownOne = OneBits[BitWidth - 1]; in ComputeSignBit()
793 APInt KnownOne(BitWidth, 0); in isKnownNonZero() local
794 ComputeMaskedBits(X, APInt(BitWidth, 1), KnownZero, KnownOne, TD, Depth); in isKnownNonZero()
795 if (KnownOne[0]) in isKnownNonZero()
834 APInt KnownOne(BitWidth, 0); in isKnownNonZero() local
838 ComputeMaskedBits(X, Mask, KnownZero, KnownOne, TD, Depth); in isKnownNonZero()
839 if ((KnownOne & Mask) != 0) in isKnownNonZero()
843 ComputeMaskedBits(Y, Mask, KnownZero, KnownOne, TD, Depth); in isKnownNonZero()
844 if ((KnownOne & Mask) != 0) in isKnownNonZero()
863 APInt KnownOne(BitWidth, 0); in isKnownNonZero() local
864 ComputeMaskedBits(V, APInt::getAllOnesValue(BitWidth), KnownZero, KnownOne, in isKnownNonZero()
866 return KnownOne != 0; 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()
973 APInt KnownZero(TyBits, 0), KnownOne(TyBits, 0); in ComputeNumSignBits() local
975 ComputeMaskedBits(U->getOperand(0), Mask, KnownZero, KnownOne, TD, in ComputeNumSignBits()
1000 APInt KnownZero(TyBits, 0), KnownOne(TyBits, 0); in ComputeNumSignBits() local
1002 ComputeMaskedBits(U->getOperand(1), Mask, KnownZero, KnownOne, in ComputeNumSignBits()
1047 APInt KnownZero(TyBits, 0), KnownOne(TyBits, 0); in ComputeNumSignBits() local
1049 ComputeMaskedBits(V, Mask, KnownZero, KnownOne, TD, Depth); in ComputeNumSignBits()
1053 } else if (KnownOne.isNegative()) { // sign bit is 1; in ComputeNumSignBits()
1054 Mask = KnownOne; in ComputeNumSignBits()