Lines Matching full:one

118     // If the instruction has one use, we can directly simplify it.
138 /// with a constant or one of its operands. In such cases, this function does
140 /// analyzing the expression and setting KnownOne and known to be one in the
145 /// Known.One and Known.Zero always follow the invariant that:
146 /// Known.One & Known.Zero == 0.
147 /// That is, a bit can't be both 1 and 0. The bits in Known.One and Known.Zero
149 /// also that the bitwidth of V, DemandedMask, Known.Zero and Known.One must all
220 if (DemandedMask.isSubsetOf(Known.Zero | Known.One))
221 return Constant::getIntegerValue(VTy, Known.One);
223 // If all of the demanded bits are known 1 on one side, return the other.
225 if (DemandedMask.isSubsetOf(LHSKnown.Zero | RHSKnown.One))
227 if (DemandedMask.isSubsetOf(RHSKnown.Zero | LHSKnown.One))
237 // If either the LHS or the RHS are One, the result is One.
239 SimplifyDemandedBits(I, 0, DemandedMask & ~RHSKnown.One, LHSKnown,
251 if (DemandedMask.isSubsetOf(Known.Zero | Known.One))
252 return Constant::getIntegerValue(VTy, Known.One);
254 // If all of the demanded bits are known zero on one side, return the other.
256 if (DemandedMask.isSubsetOf(LHSKnown.One | RHSKnown.Zero))
258 if (DemandedMask.isSubsetOf(RHSKnown.One | LHSKnown.Zero))
297 if (DemandedMask.isSubsetOf(Known.Zero | Known.One))
298 return Constant::getIntegerValue(VTy, Known.One);
300 // If all of the demanded bits are known zero on one side, return the other.
307 // If all of the demanded bits are known to be zero on one side or the
319 // If all of the demanded bits on one side are known, and all of the set
323 if (DemandedMask.isSubsetOf(RHSKnown.Zero|RHSKnown.One) &&
324 RHSKnown.One.isSubsetOf(LHSKnown.One)) {
326 ~RHSKnown.One & DemandedMask);
346 // If our LHS is an 'and' and if it has one use, and if any of the bits we
355 (LHSKnown.One & RHSKnown.One & DemandedMask) != 0) {
356 APInt NewMask = ~(LHSKnown.One & RHSKnown.One & DemandedMask);
385 // Get the constant out of the ICmp, if there is one.
534 // If low order bits are not demanded and known to be zero in one operand,
609 // If we demand exactly one bit N and we have "X * (C' << N)" where C' is
623 Constant *One = ConstantInt::get(VTy, 1);
624 Instruction *And1 = BinaryOperator::CreateAnd(I->getOperand(0), One);
775 Known.One.lshrInPlace(ShiftAmt);
879 Known.One = LHSKnown.One & LowBits;
887 // are all one.
888 if (LHSKnown.isNegative() && LowBits.intersects(LHSKnown.One))
889 Known.One |= ~LowBits;
921 // If the only bits demanded come from one byte of the bswap result,
931 // If we need exactly one byte, we can do this transformation.
976 if (DemandedMask.isSubsetOf(RHSKnown.One | LHSKnown.Zero))
1047 // Only simplify if one operand is constant.
1049 if (DemandedMaskLHS.isSubsetOf(LHSKnown.Zero | LHSKnown.One) &&
1050 !match(I->getOperand(0), m_SpecificInt(LHSKnown.One))) {
1051 replaceOperand(*I, 0, Constant::getIntegerValue(VTy, LHSKnown.One));
1056 if (DemandedMaskRHS.isSubsetOf(RHSKnown.Zero | RHSKnown.One) &&
1057 !match(I->getOperand(1), m_SpecificInt(RHSKnown.One))) {
1058 replaceOperand(*I, 1, Constant::getIntegerValue(VTy, RHSKnown.One));
1065 Known.One = LHSKnown.One.shl(ShiftAmt) |
1066 RHSKnown.One.lshr(BitWidth - ShiftAmt);
1084 // non-one bit of C.
1120 DemandedMask.isSubsetOf(Known.Zero | Known.One))
1121 return Constant::getIntegerValue(VTy, Known.One);
1151 // do simplifications that apply to *just* the one user if we know that
1163 if (DemandedMask.isSubsetOf(Known.Zero | Known.One))
1164 return Constant::getIntegerValue(ITy, Known.One);
1166 // If all of the demanded bits are known 1 on one side, return the other.
1168 if (DemandedMask.isSubsetOf(LHSKnown.Zero | RHSKnown.One))
1170 if (DemandedMask.isSubsetOf(RHSKnown.Zero | LHSKnown.One))
1184 if (DemandedMask.isSubsetOf(Known.Zero | Known.One))
1185 return Constant::getIntegerValue(ITy, Known.One);
1189 // If all of the demanded bits are known zero on one side, return the other.
1191 if (DemandedMask.isSubsetOf(LHSKnown.One | RHSKnown.Zero))
1193 if (DemandedMask.isSubsetOf(RHSKnown.One | LHSKnown.Zero))
1207 if (DemandedMask.isSubsetOf(Known.Zero | Known.One))
1208 return Constant::getIntegerValue(ITy, Known.One);
1212 // If all of the demanded bits are known zero on one side, return the other.
1265 if (DemandedMask.isSubsetOf(Known.Zero | Known.One))
1266 return Constant::getIntegerValue(ITy, Known.One);
1292 if (DemandedMask.isSubsetOf(Known.Zero|Known.One))
1293 return Constant::getIntegerValue(ITy, Known.One);
1308 /// This transformation is legal iff one of following conditions is hold:
1333 Known.One.clearAllBits();
1503 // operands we may have. We know there must be at least one, or we
1731 // one of those values is undef, then the output can be undef.
1745 // either side. If one side is known undef, choosing that side would
1876 // Look for an equivalent binop except that one operand has been shuffled.
1879 // the earlier one.
1888 // TODO: Handle demand of an arbitrary single element or more than one