Lines Matching defs:MOps
204 static bool matchAndOrChain(Value *V, MaskOps &MOps) {
206 if (MOps.MatchAndChain) {
211 MOps.FoundAnd1 = true;
212 return matchAndOrChain(Op0, MOps);
215 return matchAndOrChain(Op0, MOps) && matchAndOrChain(Op1, MOps);
219 return matchAndOrChain(Op0, MOps) && matchAndOrChain(Op1, MOps);
230 if (!MOps.Root)
231 MOps.Root = Candidate;
234 if (BitIndex && BitIndex->uge(MOps.Mask.getBitWidth()))
238 MOps.Mask.setBit(BitIndex ? BitIndex->getZExtValue() : 0);
239 return MOps.Root == Candidate;
261 MaskOps MOps(I.getType()->getScalarSizeInBits(), MatchAllBitsSet);
263 if (!matchAndOrChain(cast<BinaryOperator>(&I), MOps) || !MOps.FoundAnd1)
266 if (!matchAndOrChain(cast<BinaryOperator>(&I)->getOperand(0), MOps))
273 Constant *Mask = ConstantInt::get(I.getType(), MOps.Mask);
274 Value *And = Builder.CreateAnd(MOps.Root, Mask);