Lines Matching refs:DemandedMask

56   APInt DemandedMask(APInt::getAllOnesValue(BitWidth));  in SimplifyDemandedInstructionBits()  local
58 Value *V = SimplifyDemandedUseBits(&Inst, DemandedMask, KnownZero, KnownOne, in SimplifyDemandedInstructionBits()
69 bool InstCombiner::SimplifyDemandedBits(Use &U, const APInt &DemandedMask, in SimplifyDemandedBits() argument
73 Value *NewVal = SimplifyDemandedUseBits(U.get(), DemandedMask, KnownZero, in SimplifyDemandedBits()
103 Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, in SimplifyDemandedUseBits() argument
109 uint32_t BitWidth = DemandedMask.getBitWidth(); in SimplifyDemandedUseBits()
119 KnownOne = CI->getValue() & DemandedMask; in SimplifyDemandedUseBits()
120 KnownZero = ~KnownOne & DemandedMask; in SimplifyDemandedUseBits()
126 KnownZero = DemandedMask; in SimplifyDemandedUseBits()
132 if (DemandedMask == 0) { // Not demanding any bits from V. in SimplifyDemandedUseBits()
168 if ((DemandedMask & ~LHSKnownZero & RHSKnownOne) == in SimplifyDemandedUseBits()
169 (DemandedMask & ~LHSKnownZero)) in SimplifyDemandedUseBits()
171 if ((DemandedMask & ~RHSKnownZero & LHSKnownOne) == in SimplifyDemandedUseBits()
172 (DemandedMask & ~RHSKnownZero)) in SimplifyDemandedUseBits()
176 if ((DemandedMask & (RHSKnownZero|LHSKnownZero)) == DemandedMask) in SimplifyDemandedUseBits()
192 if ((DemandedMask & ~LHSKnownOne & RHSKnownZero) == in SimplifyDemandedUseBits()
193 (DemandedMask & ~LHSKnownOne)) in SimplifyDemandedUseBits()
195 if ((DemandedMask & ~RHSKnownOne & LHSKnownZero) == in SimplifyDemandedUseBits()
196 (DemandedMask & ~RHSKnownOne)) in SimplifyDemandedUseBits()
201 if ((DemandedMask & (~RHSKnownZero) & LHSKnownOne) == in SimplifyDemandedUseBits()
202 (DemandedMask & (~RHSKnownZero))) in SimplifyDemandedUseBits()
204 if ((DemandedMask & (~LHSKnownZero) & RHSKnownOne) == in SimplifyDemandedUseBits()
205 (DemandedMask & (~LHSKnownZero))) in SimplifyDemandedUseBits()
218 if ((DemandedMask & RHSKnownZero) == DemandedMask) in SimplifyDemandedUseBits()
220 if ((DemandedMask & LHSKnownZero) == DemandedMask) in SimplifyDemandedUseBits()
234 DemandedMask = APInt::getAllOnesValue(BitWidth); in SimplifyDemandedUseBits()
242 if (SimplifyDemandedBits(I->getOperandUse(1), DemandedMask, RHSKnownZero, in SimplifyDemandedUseBits()
244 SimplifyDemandedBits(I->getOperandUse(0), DemandedMask & ~RHSKnownZero, in SimplifyDemandedUseBits()
252 if ((DemandedMask & ((RHSKnownZero | LHSKnownZero)| in SimplifyDemandedUseBits()
253 (RHSKnownOne & LHSKnownOne))) == DemandedMask) in SimplifyDemandedUseBits()
258 if ((DemandedMask & ~LHSKnownZero & RHSKnownOne) == in SimplifyDemandedUseBits()
259 (DemandedMask & ~LHSKnownZero)) in SimplifyDemandedUseBits()
261 if ((DemandedMask & ~RHSKnownZero & LHSKnownOne) == in SimplifyDemandedUseBits()
262 (DemandedMask & ~RHSKnownZero)) in SimplifyDemandedUseBits()
266 if ((DemandedMask & (RHSKnownZero|LHSKnownZero)) == DemandedMask) in SimplifyDemandedUseBits()
270 if (ShrinkDemandedConstant(I, 1, DemandedMask & ~LHSKnownZero)) in SimplifyDemandedUseBits()
280 if (SimplifyDemandedBits(I->getOperandUse(1), DemandedMask, RHSKnownZero, in SimplifyDemandedUseBits()
282 SimplifyDemandedBits(I->getOperandUse(0), DemandedMask & ~RHSKnownOne, in SimplifyDemandedUseBits()
290 if ((DemandedMask & ((RHSKnownZero & LHSKnownZero)| in SimplifyDemandedUseBits()
291 (RHSKnownOne | LHSKnownOne))) == DemandedMask) in SimplifyDemandedUseBits()
296 if ((DemandedMask & ~LHSKnownOne & RHSKnownZero) == in SimplifyDemandedUseBits()
297 (DemandedMask & ~LHSKnownOne)) in SimplifyDemandedUseBits()
299 if ((DemandedMask & ~RHSKnownOne & LHSKnownZero) == in SimplifyDemandedUseBits()
300 (DemandedMask & ~RHSKnownOne)) in SimplifyDemandedUseBits()
305 if ((DemandedMask & (~RHSKnownZero) & LHSKnownOne) == in SimplifyDemandedUseBits()
306 (DemandedMask & (~RHSKnownZero))) in SimplifyDemandedUseBits()
308 if ((DemandedMask & (~LHSKnownZero) & RHSKnownOne) == in SimplifyDemandedUseBits()
309 (DemandedMask & (~LHSKnownZero))) in SimplifyDemandedUseBits()
313 if (ShrinkDemandedConstant(I, 1, DemandedMask)) in SimplifyDemandedUseBits()
322 if (SimplifyDemandedBits(I->getOperandUse(1), DemandedMask, RHSKnownZero, in SimplifyDemandedUseBits()
324 SimplifyDemandedBits(I->getOperandUse(0), DemandedMask, LHSKnownZero, in SimplifyDemandedUseBits()
339 if ((DemandedMask & (IKnownZero|IKnownOne)) == DemandedMask) in SimplifyDemandedUseBits()
344 if ((DemandedMask & RHSKnownZero) == DemandedMask) in SimplifyDemandedUseBits()
346 if ((DemandedMask & LHSKnownZero) == DemandedMask) in SimplifyDemandedUseBits()
352 if ((DemandedMask & ~RHSKnownZero & ~LHSKnownZero) == 0) { in SimplifyDemandedUseBits()
363 if ((DemandedMask & (RHSKnownZero|RHSKnownOne)) == DemandedMask) { in SimplifyDemandedUseBits()
367 ~RHSKnownOne & DemandedMask); in SimplifyDemandedUseBits()
375 if (ShrinkDemandedConstant(I, 1, DemandedMask)) in SimplifyDemandedUseBits()
386 (LHSKnownOne & RHSKnownOne & DemandedMask) != 0) { in SimplifyDemandedUseBits()
389 APInt NewMask = ~(LHSKnownOne & RHSKnownOne & DemandedMask); in SimplifyDemandedUseBits()
415 if (SimplifyDemandedBits(I->getOperandUse(2), DemandedMask, RHSKnownZero, in SimplifyDemandedUseBits()
417 SimplifyDemandedBits(I->getOperandUse(1), DemandedMask, LHSKnownZero, in SimplifyDemandedUseBits()
424 if (ShrinkDemandedConstant(I, 1, DemandedMask) || in SimplifyDemandedUseBits()
425 ShrinkDemandedConstant(I, 2, DemandedMask)) in SimplifyDemandedUseBits()
434 DemandedMask = DemandedMask.zext(truncBf); in SimplifyDemandedUseBits()
437 if (SimplifyDemandedBits(I->getOperandUse(0), DemandedMask, KnownZero, in SimplifyDemandedUseBits()
440 DemandedMask = DemandedMask.trunc(BitWidth); in SimplifyDemandedUseBits()
463 if (SimplifyDemandedBits(I->getOperandUse(0), DemandedMask, KnownZero, in SimplifyDemandedUseBits()
472 DemandedMask = DemandedMask.trunc(SrcBitWidth); in SimplifyDemandedUseBits()
475 if (SimplifyDemandedBits(I->getOperandUse(0), DemandedMask, KnownZero, in SimplifyDemandedUseBits()
478 DemandedMask = DemandedMask.zext(BitWidth); in SimplifyDemandedUseBits()
490 APInt InputDemandedBits = DemandedMask & in SimplifyDemandedUseBits()
496 if ((NewBits & DemandedMask) != 0) in SimplifyDemandedUseBits()
515 if (KnownZero[SrcBitWidth-1] || (NewBits & ~DemandedMask) == NewBits) { in SimplifyDemandedUseBits()
528 unsigned NLZ = DemandedMask.countLeadingZeros(); in SimplifyDemandedUseBits()
559 Value *R = SimplifyShrShlDemandedBits(Shr, I, DemandedMask, in SimplifyDemandedUseBits()
567 APInt DemandedMaskIn(DemandedMask.lshr(ShiftAmt)); in SimplifyDemandedUseBits()
593 APInt DemandedMaskIn(DemandedMask.shl(ShiftAmt)); in SimplifyDemandedUseBits()
618 if (DemandedMask == 1) { in SimplifyDemandedUseBits()
627 if (DemandedMask.isSignBit()) in SimplifyDemandedUseBits()
634 APInt DemandedMaskIn(DemandedMask.shl(ShiftAmt)); in SimplifyDemandedUseBits()
637 if (DemandedMask.countLeadingZeros() <= ShiftAmt) in SimplifyDemandedUseBits()
662 (HighBits & ~DemandedMask) == HighBits) { in SimplifyDemandedUseBits()
681 if (DemandedMask.ult(RA)) // srem won't affect demanded bits in SimplifyDemandedUseBits()
710 if (DemandedMask.isNegative() && KnownZero.isNonNegative()) { in SimplifyDemandedUseBits()
731 KnownZero = APInt::getHighBitsSet(BitWidth, Leaders) & DemandedMask; in SimplifyDemandedUseBits()
741 unsigned NLZ = DemandedMask.countLeadingZeros(); in SimplifyDemandedUseBits()
742 unsigned NTZ = DemandedMask.countTrailingZeros(); in SimplifyDemandedUseBits()
790 APInt DemandedElts = DemandedMask.zextOrTrunc(ArgWidth); in SimplifyDemandedUseBits()
809 if ((DemandedMask & (KnownZero|KnownOne)) == DemandedMask) in SimplifyDemandedUseBits()
833 const APInt &DemandedMask, in SimplifyShrShlDemandedBits() argument
853 KnownZero &= DemandedMask; in SimplifyShrShlDemandedBits()
870 if ((BitMask1 & DemandedMask) == (BitMask2 & DemandedMask)) { in SimplifyShrShlDemandedBits()