Home | History | Annotate | Download | only in Analysis

Lines Matching refs:KnownZero

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