Lines Matching refs:Ops

451   Value *EmitMul(const BinOpInfo &Ops) {  in EmitMul()  argument
452 if (Ops.Ty->isSignedIntegerOrEnumerationType()) { in EmitMul()
455 return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul"); in EmitMul()
458 return Builder.CreateNSWMul(Ops.LHS, Ops.RHS, "mul"); in EmitMul()
461 return EmitOverflowCheckedBinOp(Ops); in EmitMul()
465 if (Ops.Ty->isUnsignedIntegerType() && in EmitMul()
467 return EmitOverflowCheckedBinOp(Ops); in EmitMul()
469 if (Ops.LHS->getType()->isFPOrFPVectorTy()) in EmitMul()
470 return Builder.CreateFMul(Ops.LHS, Ops.RHS, "mul"); in EmitMul()
471 return Builder.CreateMul(Ops.LHS, Ops.RHS, "mul"); in EmitMul()
475 Value *EmitOverflowCheckedBinOp(const BinOpInfo &Ops);
478 void EmitUndefinedBehaviorIntegerDivAndRemCheck(const BinOpInfo &Ops,
482 Value *EmitDiv(const BinOpInfo &Ops);
483 Value *EmitRem(const BinOpInfo &Ops);
484 Value *EmitAdd(const BinOpInfo &Ops);
485 Value *EmitSub(const BinOpInfo &Ops);
486 Value *EmitShl(const BinOpInfo &Ops);
487 Value *EmitShr(const BinOpInfo &Ops);
488 Value *EmitAnd(const BinOpInfo &Ops) { in EmitAnd() argument
489 return Builder.CreateAnd(Ops.LHS, Ops.RHS, "and"); in EmitAnd()
491 Value *EmitXor(const BinOpInfo &Ops) { in EmitXor() argument
492 return Builder.CreateXor(Ops.LHS, Ops.RHS, "xor"); in EmitXor()
494 Value *EmitOr (const BinOpInfo &Ops) { in EmitOr() argument
495 return Builder.CreateOr(Ops.LHS, Ops.RHS, "or"); in EmitOr()
2235 const BinOpInfo &Ops, llvm::Value *Zero, bool isDiv) { in EmitUndefinedBehaviorIntegerDivAndRemCheck() argument
2239 Checks.push_back(std::make_pair(Builder.CreateICmpNE(Ops.RHS, Zero), in EmitUndefinedBehaviorIntegerDivAndRemCheck()
2244 Ops.Ty->hasSignedIntegerRepresentation()) { in EmitUndefinedBehaviorIntegerDivAndRemCheck()
2251 llvm::Value *LHSCmp = Builder.CreateICmpNE(Ops.LHS, IntMin); in EmitUndefinedBehaviorIntegerDivAndRemCheck()
2252 llvm::Value *RHSCmp = Builder.CreateICmpNE(Ops.RHS, NegOne); in EmitUndefinedBehaviorIntegerDivAndRemCheck()
2259 EmitBinOpCheck(Checks, Ops); in EmitUndefinedBehaviorIntegerDivAndRemCheck()
2262 Value *ScalarExprEmitter::EmitDiv(const BinOpInfo &Ops) { in EmitDiv() argument
2267 Ops.Ty->isIntegerType()) { in EmitDiv()
2268 llvm::Value *Zero = llvm::Constant::getNullValue(ConvertType(Ops.Ty)); in EmitDiv()
2269 EmitUndefinedBehaviorIntegerDivAndRemCheck(Ops, Zero, true); in EmitDiv()
2271 Ops.Ty->isRealFloatingType()) { in EmitDiv()
2272 llvm::Value *Zero = llvm::Constant::getNullValue(ConvertType(Ops.Ty)); in EmitDiv()
2273 llvm::Value *NonZero = Builder.CreateFCmpUNE(Ops.RHS, Zero); in EmitDiv()
2275 Ops); in EmitDiv()
2279 if (Ops.LHS->getType()->isFPOrFPVectorTy()) { in EmitDiv()
2280 llvm::Value *Val = Builder.CreateFDiv(Ops.LHS, Ops.RHS, "div"); in EmitDiv()
2291 else if (Ops.Ty->hasUnsignedIntegerRepresentation()) in EmitDiv()
2292 return Builder.CreateUDiv(Ops.LHS, Ops.RHS, "div"); in EmitDiv()
2294 return Builder.CreateSDiv(Ops.LHS, Ops.RHS, "div"); in EmitDiv()
2297 Value *ScalarExprEmitter::EmitRem(const BinOpInfo &Ops) { in EmitRem() argument
2301 llvm::Value *Zero = llvm::Constant::getNullValue(ConvertType(Ops.Ty)); in EmitRem()
2303 if (Ops.Ty->isIntegerType()) in EmitRem()
2304 EmitUndefinedBehaviorIntegerDivAndRemCheck(Ops, Zero, false); in EmitRem()
2307 if (Ops.Ty->hasUnsignedIntegerRepresentation()) in EmitRem()
2308 return Builder.CreateURem(Ops.LHS, Ops.RHS, "rem"); in EmitRem()
2310 return Builder.CreateSRem(Ops.LHS, Ops.RHS, "rem"); in EmitRem()
2313 Value *ScalarExprEmitter::EmitOverflowCheckedBinOp(const BinOpInfo &Ops) { in EmitOverflowCheckedBinOp() argument
2317 bool isSigned = Ops.Ty->isSignedIntegerOrEnumerationType(); in EmitOverflowCheckedBinOp()
2318 switch (Ops.Opcode) { in EmitOverflowCheckedBinOp()
2344 llvm::Type *opTy = CGF.CGM.getTypes().ConvertType(Ops.Ty); in EmitOverflowCheckedBinOp()
2348 Value *resultAndOverflow = Builder.CreateCall2(intrinsic, Ops.LHS, Ops.RHS); in EmitOverflowCheckedBinOp()
2363 EmitBinOpCheck(std::make_pair(NotOverflow, Kind), Ops); in EmitOverflowCheckedBinOp()
2391 llvm::Value *lhs = Builder.CreateSExt(Ops.LHS, CGF.Int64Ty); in EmitOverflowCheckedBinOp()
2392 llvm::Value *rhs = Builder.CreateSExt(Ops.RHS, CGF.Int64Ty); in EmitOverflowCheckedBinOp()
2709 Value *ScalarExprEmitter::EmitShl(const BinOpInfo &Ops) { in EmitShl() argument
2712 Value *RHS = Ops.RHS; in EmitShl()
2713 if (Ops.LHS->getType() != RHS->getType()) in EmitShl()
2714 RHS = Builder.CreateIntCast(RHS, Ops.LHS->getType(), false, "sh_prom"); in EmitShl()
2717 Ops.Ty->hasSignedIntegerRepresentation(); in EmitShl()
2722 Builder.CreateAnd(RHS, GetWidthMinusOneValue(Ops.LHS, RHS), "shl.mask"); in EmitShl()
2724 isa<llvm::IntegerType>(Ops.LHS->getType())) { in EmitShl()
2727 llvm::Value *WidthMinusOne = GetWidthMinusOneValue(Ops.LHS, RHS); in EmitShl()
2745 Builder.CreateLShr(Ops.LHS, in EmitShl()
2767 EmitBinOpCheck(Checks, Ops); in EmitShl()
2770 return Builder.CreateShl(Ops.LHS, RHS, "shl"); in EmitShl()
2773 Value *ScalarExprEmitter::EmitShr(const BinOpInfo &Ops) { in EmitShr() argument
2776 Value *RHS = Ops.RHS; in EmitShr()
2777 if (Ops.LHS->getType() != RHS->getType()) in EmitShr()
2778 RHS = Builder.CreateIntCast(RHS, Ops.LHS->getType(), false, "sh_prom"); in EmitShr()
2783 Builder.CreateAnd(RHS, GetWidthMinusOneValue(Ops.LHS, RHS), "shr.mask"); in EmitShr()
2785 isa<llvm::IntegerType>(Ops.LHS->getType())) { in EmitShr()
2788 Builder.CreateICmpULE(RHS, GetWidthMinusOneValue(Ops.LHS, RHS)); in EmitShr()
2789 EmitBinOpCheck(std::make_pair(Valid, SanitizerKind::ShiftExponent), Ops); in EmitShr()
2792 if (Ops.Ty->hasUnsignedIntegerRepresentation()) in EmitShr()
2793 return Builder.CreateLShr(Ops.LHS, RHS, "shr"); in EmitShr()
2794 return Builder.CreateAShr(Ops.LHS, RHS, "shr"); in EmitShr()