Lines Matching refs:LHS

674                                           Value *LHS, Value *RHS,
677 BinaryOperator *BO = Insert(BinaryOperator::Create(Opc, LHS, RHS), Name);
694 Value *CreateAdd(Value *LHS, Value *RHS, const Twine &Name = "",
696 if (Constant *LC = dyn_cast<Constant>(LHS))
699 return CreateInsertNUWNSWBinOp(Instruction::Add, LHS, RHS, Name,
702 Value *CreateNSWAdd(Value *LHS, Value *RHS, const Twine &Name = "") {
703 return CreateAdd(LHS, RHS, Name, false, true);
705 Value *CreateNUWAdd(Value *LHS, Value *RHS, const Twine &Name = "") {
706 return CreateAdd(LHS, RHS, Name, true, false);
708 Value *CreateFAdd(Value *LHS, Value *RHS, const Twine &Name = "",
710 if (Constant *LC = dyn_cast<Constant>(LHS))
713 return Insert(AddFPMathAttributes(BinaryOperator::CreateFAdd(LHS, RHS),
716 Value *CreateSub(Value *LHS, Value *RHS, const Twine &Name = "",
718 if (Constant *LC = dyn_cast<Constant>(LHS))
721 return CreateInsertNUWNSWBinOp(Instruction::Sub, LHS, RHS, Name,
724 Value *CreateNSWSub(Value *LHS, Value *RHS, const Twine &Name = "") {
725 return CreateSub(LHS, RHS, Name, false, true);
727 Value *CreateNUWSub(Value *LHS, Value *RHS, const Twine &Name = "") {
728 return CreateSub(LHS, RHS, Name, true, false);
730 Value *CreateFSub(Value *LHS, Value *RHS, const Twine &Name = "",
732 if (Constant *LC = dyn_cast<Constant>(LHS))
735 return Insert(AddFPMathAttributes(BinaryOperator::CreateFSub(LHS, RHS),
738 Value *CreateMul(Value *LHS, Value *RHS, const Twine &Name = "",
740 if (Constant *LC = dyn_cast<Constant>(LHS))
743 return CreateInsertNUWNSWBinOp(Instruction::Mul, LHS, RHS, Name,
746 Value *CreateNSWMul(Value *LHS, Value *RHS, const Twine &Name = "") {
747 return CreateMul(LHS, RHS, Name, false, true);
749 Value *CreateNUWMul(Value *LHS, Value *RHS, const Twine &Name = "") {
750 return CreateMul(LHS, RHS, Name, true, false);
752 Value *CreateFMul(Value *LHS, Value *RHS, const Twine &Name = "",
754 if (Constant *LC = dyn_cast<Constant>(LHS))
757 return Insert(AddFPMathAttributes(BinaryOperator::CreateFMul(LHS, RHS),
760 Value *CreateUDiv(Value *LHS, Value *RHS, const Twine &Name = "",
762 if (Constant *LC = dyn_cast<Constant>(LHS))
766 return Insert(BinaryOperator::CreateUDiv(LHS, RHS), Name);
767 return Insert(BinaryOperator::CreateExactUDiv(LHS, RHS), Name);
769 Value *CreateExactUDiv(Value *LHS, Value *RHS, const Twine &Name = "") {
770 return CreateUDiv(LHS, RHS, Name, true);
772 Value *CreateSDiv(Value *LHS, Value *RHS, const Twine &Name = "",
774 if (Constant *LC = dyn_cast<Constant>(LHS))
778 return Insert(BinaryOperator::CreateSDiv(LHS, RHS), Name);
779 return Insert(BinaryOperator::CreateExactSDiv(LHS, RHS), Name);
781 Value *CreateExactSDiv(Value *LHS, Value *RHS, const Twine &Name = "") {
782 return CreateSDiv(LHS, RHS, Name, true);
784 Value *CreateFDiv(Value *LHS, Value *RHS, const Twine &Name = "",
786 if (Constant *LC = dyn_cast<Constant>(LHS))
789 return Insert(AddFPMathAttributes(BinaryOperator::CreateFDiv(LHS, RHS),
792 Value *CreateURem(Value *LHS, Value *RHS, const Twine &Name = "") {
793 if (Constant *LC = dyn_cast<Constant>(LHS))
796 return Insert(BinaryOperator::CreateURem(LHS, RHS), Name);
798 Value *CreateSRem(Value *LHS, Value *RHS, const Twine &Name = "") {
799 if (Constant *LC = dyn_cast<Constant>(LHS))
802 return Insert(BinaryOperator::CreateSRem(LHS, RHS), Name);
804 Value *CreateFRem(Value *LHS, Value *RHS, const Twine &Name = "",
806 if (Constant *LC = dyn_cast<Constant>(LHS))
809 return Insert(AddFPMathAttributes(BinaryOperator::CreateFRem(LHS, RHS),
813 Value *CreateShl(Value *LHS, Value *RHS, const Twine &Name = "",
815 if (Constant *LC = dyn_cast<Constant>(LHS))
818 return CreateInsertNUWNSWBinOp(Instruction::Shl, LHS, RHS, Name,
821 Value *CreateShl(Value *LHS, const APInt &RHS, const Twine &Name = "",
823 return CreateShl(LHS, ConstantInt::get(LHS->getType(), RHS), Name,
826 Value *CreateShl(Value *LHS, uint64_t RHS, const Twine &Name = "",
828 return CreateShl(LHS, ConstantInt::get(LHS->getType(), RHS), Name,
832 Value *CreateLShr(Value *LHS, Value *RHS, const Twine &Name = "",
834 if (Constant *LC = dyn_cast<Constant>(LHS))
838 return Insert(BinaryOperator::CreateLShr(LHS, RHS), Name);
839 return Insert(BinaryOperator::CreateExactLShr(LHS, RHS), Name);
841 Value *CreateLShr(Value *LHS, const APInt &RHS, const Twine &Name = "",
843 return CreateLShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
845 Value *CreateLShr(Value *LHS, uint64_t RHS, const Twine &Name = "",
847 return CreateLShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
850 Value *CreateAShr(Value *LHS, Value *RHS, const Twine &Name = "",
852 if (Constant *LC = dyn_cast<Constant>(LHS))
856 return Insert(BinaryOperator::CreateAShr(LHS, RHS), Name);
857 return Insert(BinaryOperator::CreateExactAShr(LHS, RHS), Name);
859 Value *CreateAShr(Value *LHS, const APInt &RHS, const Twine &Name = "",
861 return CreateAShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
863 Value *CreateAShr(Value *LHS, uint64_t RHS, const Twine &Name = "",
865 return CreateAShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
868 Value *CreateAnd(Value *LHS, Value *RHS, const Twine &Name = "") {
871 return LHS; // LHS & -1 -> LHS
872 if (Constant *LC = dyn_cast<Constant>(LHS))
875 return Insert(BinaryOperator::CreateAnd(LHS, RHS), Name);
877 Value *CreateAnd(Value *LHS, const APInt &RHS, const Twine &Name = "") {
878 return CreateAnd(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
880 Value *CreateAnd(Value *LHS, uint64_t RHS, const Twine &Name = "") {
881 return CreateAnd(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
884 Value *CreateOr(Value *LHS, Value *RHS, const Twine &Name = "") {
887 return LHS; // LHS | 0 -> LHS
888 if (Constant *LC = dyn_cast<Constant>(LHS))
891 return Insert(BinaryOperator::CreateOr(LHS, RHS), Name);
893 Value *CreateOr(Value *LHS, const APInt &RHS, const Twine &Name = "") {
894 return CreateOr(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
896 Value *CreateOr(Value *LHS, uint64_t RHS, const Twine &Name = "") {
897 return CreateOr(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
900 Value *CreateXor(Value *LHS, Value *RHS, const Twine &Name = "") {
901 if (Constant *LC = dyn_cast<Constant>(LHS))
904 return Insert(BinaryOperator::CreateXor(LHS, RHS), Name);
906 Value *CreateXor(Value *LHS, const APInt &RHS, const Twine &Name = "") {
907 return CreateXor(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
909 Value *CreateXor(Value *LHS, uint64_t RHS, const Twine &Name = "") {
910 return CreateXor(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
914 Value *LHS, Value *RHS, const Twine &Name = "",
916 if (Constant *LC = dyn_cast<Constant>(LHS))
919 llvm::Instruction *BinOp = BinaryOperator::Create(Opc, LHS, RHS);
1340 Value *CreateICmpEQ(Value *LHS, Value *RHS, const Twine &Name = "") {
1341 return CreateICmp(ICmpInst::ICMP_EQ, LHS, RHS, Name);
1343 Value *CreateICmpNE(Value *LHS, Value *RHS, const Twine &Name = "") {
1344 return CreateICmp(ICmpInst::ICMP_NE, LHS, RHS, Name);
1346 Value *CreateICmpUGT(Value *LHS, Value *RHS, const Twine &Name = "") {
1347 return CreateICmp(ICmpInst::ICMP_UGT, LHS, RHS, Name);
1349 Value *CreateICmpUGE(Value *LHS, Value *RHS, const Twine &Name = "") {
1350 return CreateICmp(ICmpInst::ICMP_UGE, LHS, RHS, Name);
1352 Value *CreateICmpULT(Value *LHS, Value *RHS, const Twine &Name = "") {
1353 return CreateICmp(ICmpInst::ICMP_ULT, LHS, RHS, Name);
1355 Value *CreateICmpULE(Value *LHS, Value *RHS, const Twine &Name = "") {
1356 return CreateICmp(ICmpInst::ICMP_ULE, LHS, RHS, Name);
1358 Value *CreateICmpSGT(Value *LHS, Value *RHS, const Twine &Name = "") {
1359 return CreateICmp(ICmpInst::ICMP_SGT, LHS, RHS, Name);
1361 Value *CreateICmpSGE(Value *LHS, Value *RHS, const Twine &Name = "") {
1362 return CreateICmp(ICmpInst::ICMP_SGE, LHS, RHS, Name);
1364 Value *CreateICmpSLT(Value *LHS, Value *RHS, const Twine &Name = "") {
1365 return CreateICmp(ICmpInst::ICMP_SLT, LHS, RHS, Name);
1367 Value *CreateICmpSLE(Value *LHS, Value *RHS, const Twine &Name = "") {
1368 return CreateICmp(ICmpInst::ICMP_SLE, LHS, RHS, Name);
1371 Value *CreateFCmpOEQ(Value *LHS, Value *RHS, const Twine &Name = "") {
1372 return CreateFCmp(FCmpInst::FCMP_OEQ, LHS, RHS, Name);
1374 Value *CreateFCmpOGT(Value *LHS, Value *RHS, const Twine &Name = "") {
1375 return CreateFCmp(FCmpInst::FCMP_OGT, LHS, RHS, Name);
1377 Value *CreateFCmpOGE(Value *LHS, Value *RHS, const Twine &Name = "") {
1378 return CreateFCmp(FCmpInst::FCMP_OGE, LHS, RHS, Name);
1380 Value *CreateFCmpOLT(Value *LHS, Value *RHS, const Twine &Name = "") {
1381 return CreateFCmp(FCmpInst::FCMP_OLT, LHS, RHS, Name);
1383 Value *CreateFCmpOLE(Value *LHS, Value *RHS, const Twine &Name = "") {
1384 return CreateFCmp(FCmpInst::FCMP_OLE, LHS, RHS, Name);
1386 Value *CreateFCmpONE(Value *LHS, Value *RHS, const Twine &Name = "") {
1387 return CreateFCmp(FCmpInst::FCMP_ONE, LHS, RHS, Name);
1389 Value *CreateFCmpORD(Value *LHS, Value *RHS, const Twine &Name = "") {
1390 return CreateFCmp(FCmpInst::FCMP_ORD, LHS, RHS, Name);
1392 Value *CreateFCmpUNO(Value *LHS, Value *RHS, const Twine &Name = "") {
1393 return CreateFCmp(FCmpInst::FCMP_UNO, LHS, RHS, Name);
1395 Value *CreateFCmpUEQ(Value *LHS, Value *RHS, const Twine &Name = "") {
1396 return CreateFCmp(FCmpInst::FCMP_UEQ, LHS, RHS, Name);
1398 Value *CreateFCmpUGT(Value *LHS, Value *RHS, const Twine &Name = "") {
1399 return CreateFCmp(FCmpInst::FCMP_UGT, LHS, RHS, Name);
1401 Value *CreateFCmpUGE(Value *LHS, Value *RHS, const Twine &Name = "") {
1402 return CreateFCmp(FCmpInst::FCMP_UGE, LHS, RHS, Name);
1404 Value *CreateFCmpULT(Value *LHS, Value *RHS, const Twine &Name = "") {
1405 return CreateFCmp(FCmpInst::FCMP_ULT, LHS, RHS, Name);
1407 Value *CreateFCmpULE(Value *LHS, Value *RHS, const Twine &Name = "") {
1408 return CreateFCmp(FCmpInst::FCMP_ULE, LHS, RHS, Name);
1410 Value *CreateFCmpUNE(Value *LHS, Value *RHS, const Twine &Name = "") {
1411 return CreateFCmp(FCmpInst::FCMP_UNE, LHS, RHS, Name);
1414 Value *CreateICmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
1416 if (Constant *LC = dyn_cast<Constant>(LHS))
1419 return Insert(new ICmpInst(P, LHS, RHS), Name);
1421 Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
1423 if (Constant *LC = dyn_cast<Constant>(LHS))
1426 return Insert(new FCmpInst(P, LHS, RHS), Name);
1563 Value *CreatePtrDiff(Value *LHS, Value *RHS, const Twine &Name = "") {
1564 assert(LHS->getType() == RHS->getType() &&
1566 PointerType *ArgType = cast<PointerType>(LHS->getType());
1567 Value *LHS_int = CreatePtrToInt(LHS, Type::getInt64Ty(Context));