Lines Matching refs:LHS

753                                           Value *LHS, Value *RHS,
756 BinaryOperator *BO = Insert(BinaryOperator::Create(Opc, LHS, RHS), Name);
774 Value *CreateAdd(Value *LHS, Value *RHS, const Twine &Name = "",
776 if (Constant *LC = dyn_cast<Constant>(LHS))
779 return CreateInsertNUWNSWBinOp(Instruction::Add, LHS, RHS, Name,
782 Value *CreateNSWAdd(Value *LHS, Value *RHS, const Twine &Name = "") {
783 return CreateAdd(LHS, RHS, Name, false, true);
785 Value *CreateNUWAdd(Value *LHS, Value *RHS, const Twine &Name = "") {
786 return CreateAdd(LHS, RHS, Name, true, false);
788 Value *CreateFAdd(Value *LHS, Value *RHS, const Twine &Name = "",
790 if (Constant *LC = dyn_cast<Constant>(LHS))
793 return Insert(AddFPMathAttributes(BinaryOperator::CreateFAdd(LHS, RHS),
796 Value *CreateSub(Value *LHS, Value *RHS, const Twine &Name = "",
798 if (Constant *LC = dyn_cast<Constant>(LHS))
801 return CreateInsertNUWNSWBinOp(Instruction::Sub, LHS, RHS, Name,
804 Value *CreateNSWSub(Value *LHS, Value *RHS, const Twine &Name = "") {
805 return CreateSub(LHS, RHS, Name, false, true);
807 Value *CreateNUWSub(Value *LHS, Value *RHS, const Twine &Name = "") {
808 return CreateSub(LHS, RHS, Name, true, false);
810 Value *CreateFSub(Value *LHS, Value *RHS, const Twine &Name = "",
812 if (Constant *LC = dyn_cast<Constant>(LHS))
815 return Insert(AddFPMathAttributes(BinaryOperator::CreateFSub(LHS, RHS),
818 Value *CreateMul(Value *LHS, Value *RHS, const Twine &Name = "",
820 if (Constant *LC = dyn_cast<Constant>(LHS))
823 return CreateInsertNUWNSWBinOp(Instruction::Mul, LHS, RHS, Name,
826 Value *CreateNSWMul(Value *LHS, Value *RHS, const Twine &Name = "") {
827 return CreateMul(LHS, RHS, Name, false, true);
829 Value *CreateNUWMul(Value *LHS, Value *RHS, const Twine &Name = "") {
830 return CreateMul(LHS, RHS, Name, true, false);
832 Value *CreateFMul(Value *LHS, Value *RHS, const Twine &Name = "",
834 if (Constant *LC = dyn_cast<Constant>(LHS))
837 return Insert(AddFPMathAttributes(BinaryOperator::CreateFMul(LHS, RHS),
840 Value *CreateUDiv(Value *LHS, Value *RHS, const Twine &Name = "",
842 if (Constant *LC = dyn_cast<Constant>(LHS))
846 return Insert(BinaryOperator::CreateUDiv(LHS, RHS), Name);
847 return Insert(BinaryOperator::CreateExactUDiv(LHS, RHS), Name);
849 Value *CreateExactUDiv(Value *LHS, Value *RHS, const Twine &Name = "") {
850 return CreateUDiv(LHS, RHS, Name, true);
852 Value *CreateSDiv(Value *LHS, Value *RHS, const Twine &Name = "",
854 if (Constant *LC = dyn_cast<Constant>(LHS))
858 return Insert(BinaryOperator::CreateSDiv(LHS, RHS), Name);
859 return Insert(BinaryOperator::CreateExactSDiv(LHS, RHS), Name);
861 Value *CreateExactSDiv(Value *LHS, Value *RHS, const Twine &Name = "") {
862 return CreateSDiv(LHS, RHS, Name, true);
864 Value *CreateFDiv(Value *LHS, Value *RHS, const Twine &Name = "",
866 if (Constant *LC = dyn_cast<Constant>(LHS))
869 return Insert(AddFPMathAttributes(BinaryOperator::CreateFDiv(LHS, RHS),
872 Value *CreateURem(Value *LHS, Value *RHS, const Twine &Name = "") {
873 if (Constant *LC = dyn_cast<Constant>(LHS))
876 return Insert(BinaryOperator::CreateURem(LHS, RHS), Name);
878 Value *CreateSRem(Value *LHS, Value *RHS, const Twine &Name = "") {
879 if (Constant *LC = dyn_cast<Constant>(LHS))
882 return Insert(BinaryOperator::CreateSRem(LHS, RHS), Name);
884 Value *CreateFRem(Value *LHS, Value *RHS, const Twine &Name = "",
886 if (Constant *LC = dyn_cast<Constant>(LHS))
889 return Insert(AddFPMathAttributes(BinaryOperator::CreateFRem(LHS, RHS),
893 Value *CreateShl(Value *LHS, Value *RHS, const Twine &Name = "",
895 if (Constant *LC = dyn_cast<Constant>(LHS))
898 return CreateInsertNUWNSWBinOp(Instruction::Shl, LHS, RHS, Name,
901 Value *CreateShl(Value *LHS, const APInt &RHS, const Twine &Name = "",
903 return CreateShl(LHS, ConstantInt::get(LHS->getType(), RHS), Name,
906 Value *CreateShl(Value *LHS, uint64_t RHS, const Twine &Name = "",
908 return CreateShl(LHS, ConstantInt::get(LHS->getType(), RHS), Name,
912 Value *CreateLShr(Value *LHS, Value *RHS, const Twine &Name = "",
914 if (Constant *LC = dyn_cast<Constant>(LHS))
918 return Insert(BinaryOperator::CreateLShr(LHS, RHS), Name);
919 return Insert(BinaryOperator::CreateExactLShr(LHS, RHS), Name);
921 Value *CreateLShr(Value *LHS, const APInt &RHS, const Twine &Name = "",
923 return CreateLShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
925 Value *CreateLShr(Value *LHS, uint64_t RHS, const Twine &Name = "",
927 return CreateLShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
930 Value *CreateAShr(Value *LHS, Value *RHS, const Twine &Name = "",
932 if (Constant *LC = dyn_cast<Constant>(LHS))
936 return Insert(BinaryOperator::CreateAShr(LHS, RHS), Name);
937 return Insert(BinaryOperator::CreateExactAShr(LHS, RHS), Name);
939 Value *CreateAShr(Value *LHS, const APInt &RHS, const Twine &Name = "",
941 return CreateAShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
943 Value *CreateAShr(Value *LHS, uint64_t RHS, const Twine &Name = "",
945 return CreateAShr(LHS, ConstantInt::get(LHS->getType(), RHS), Name,isExact);
948 Value *CreateAnd(Value *LHS, Value *RHS, const Twine &Name = "") {
951 return LHS; // LHS & -1 -> LHS
952 if (Constant *LC = dyn_cast<Constant>(LHS))
955 return Insert(BinaryOperator::CreateAnd(LHS, RHS), Name);
957 Value *CreateAnd(Value *LHS, const APInt &RHS, const Twine &Name = "") {
958 return CreateAnd(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
960 Value *CreateAnd(Value *LHS, uint64_t RHS, const Twine &Name = "") {
961 return CreateAnd(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
964 Value *CreateOr(Value *LHS, Value *RHS, const Twine &Name = "") {
967 return LHS; // LHS | 0 -> LHS
968 if (Constant *LC = dyn_cast<Constant>(LHS))
971 return Insert(BinaryOperator::CreateOr(LHS, RHS), Name);
973 Value *CreateOr(Value *LHS, const APInt &RHS, const Twine &Name = "") {
974 return CreateOr(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
976 Value *CreateOr(Value *LHS, uint64_t RHS, const Twine &Name = "") {
977 return CreateOr(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
980 Value *CreateXor(Value *LHS, Value *RHS, const Twine &Name = "") {
981 if (Constant *LC = dyn_cast<Constant>(LHS))
984 return Insert(BinaryOperator::CreateXor(LHS, RHS), Name);
986 Value *CreateXor(Value *LHS, const APInt &RHS, const Twine &Name = "") {
987 return CreateXor(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
989 Value *CreateXor(Value *LHS, uint64_t RHS, const Twine &Name = "") {
990 return CreateXor(LHS, ConstantInt::get(LHS->getType(), RHS), Name);
994 Value *LHS, Value *RHS, const Twine &Name = "",
996 if (Constant *LC = dyn_cast<Constant>(LHS))
999 llvm::Instruction *BinOp = BinaryOperator::Create(Opc, LHS, RHS);
1428 Value *CreateICmpEQ(Value *LHS, Value *RHS, const Twine &Name = "") {
1429 return CreateICmp(ICmpInst::ICMP_EQ, LHS, RHS, Name);
1431 Value *CreateICmpNE(Value *LHS, Value *RHS, const Twine &Name = "") {
1432 return CreateICmp(ICmpInst::ICMP_NE, LHS, RHS, Name);
1434 Value *CreateICmpUGT(Value *LHS, Value *RHS, const Twine &Name = "") {
1435 return CreateICmp(ICmpInst::ICMP_UGT, LHS, RHS, Name);
1437 Value *CreateICmpUGE(Value *LHS, Value *RHS, const Twine &Name = "") {
1438 return CreateICmp(ICmpInst::ICMP_UGE, LHS, RHS, Name);
1440 Value *CreateICmpULT(Value *LHS, Value *RHS, const Twine &Name = "") {
1441 return CreateICmp(ICmpInst::ICMP_ULT, LHS, RHS, Name);
1443 Value *CreateICmpULE(Value *LHS, Value *RHS, const Twine &Name = "") {
1444 return CreateICmp(ICmpInst::ICMP_ULE, LHS, RHS, Name);
1446 Value *CreateICmpSGT(Value *LHS, Value *RHS, const Twine &Name = "") {
1447 return CreateICmp(ICmpInst::ICMP_SGT, LHS, RHS, Name);
1449 Value *CreateICmpSGE(Value *LHS, Value *RHS, const Twine &Name = "") {
1450 return CreateICmp(ICmpInst::ICMP_SGE, LHS, RHS, Name);
1452 Value *CreateICmpSLT(Value *LHS, Value *RHS, const Twine &Name = "") {
1453 return CreateICmp(ICmpInst::ICMP_SLT, LHS, RHS, Name);
1455 Value *CreateICmpSLE(Value *LHS, Value *RHS, const Twine &Name = "") {
1456 return CreateICmp(ICmpInst::ICMP_SLE, LHS, RHS, Name);
1459 Value *CreateFCmpOEQ(Value *LHS, Value *RHS, const Twine &Name = "",
1461 return CreateFCmp(FCmpInst::FCMP_OEQ, LHS, RHS, Name, FPMathTag);
1463 Value *CreateFCmpOGT(Value *LHS, Value *RHS, const Twine &Name = "",
1465 return CreateFCmp(FCmpInst::FCMP_OGT, LHS, RHS, Name, FPMathTag);
1467 Value *CreateFCmpOGE(Value *LHS, Value *RHS, const Twine &Name = "",
1469 return CreateFCmp(FCmpInst::FCMP_OGE, LHS, RHS, Name, FPMathTag);
1471 Value *CreateFCmpOLT(Value *LHS, Value *RHS, const Twine &Name = "",
1473 return CreateFCmp(FCmpInst::FCMP_OLT, LHS, RHS, Name, FPMathTag);
1475 Value *CreateFCmpOLE(Value *LHS, Value *RHS, const Twine &Name = "",
1477 return CreateFCmp(FCmpInst::FCMP_OLE, LHS, RHS, Name, FPMathTag);
1479 Value *CreateFCmpONE(Value *LHS, Value *RHS, const Twine &Name = "",
1481 return CreateFCmp(FCmpInst::FCMP_ONE, LHS, RHS, Name, FPMathTag);
1483 Value *CreateFCmpORD(Value *LHS, Value *RHS, const Twine &Name = "",
1485 return CreateFCmp(FCmpInst::FCMP_ORD, LHS, RHS, Name, FPMathTag);
1487 Value *CreateFCmpUNO(Value *LHS, Value *RHS, const Twine &Name = "",
1489 return CreateFCmp(FCmpInst::FCMP_UNO, LHS, RHS, Name, FPMathTag);
1491 Value *CreateFCmpUEQ(Value *LHS, Value *RHS, const Twine &Name = "",
1493 return CreateFCmp(FCmpInst::FCMP_UEQ, LHS, RHS, Name, FPMathTag);
1495 Value *CreateFCmpUGT(Value *LHS, Value *RHS, const Twine &Name = "",
1497 return CreateFCmp(FCmpInst::FCMP_UGT, LHS, RHS, Name, FPMathTag);
1499 Value *CreateFCmpUGE(Value *LHS, Value *RHS, const Twine &Name = "",
1501 return CreateFCmp(FCmpInst::FCMP_UGE, LHS, RHS, Name, FPMathTag);
1503 Value *CreateFCmpULT(Value *LHS, Value *RHS, const Twine &Name = "",
1505 return CreateFCmp(FCmpInst::FCMP_ULT, LHS, RHS, Name, FPMathTag);
1507 Value *CreateFCmpULE(Value *LHS, Value *RHS, const Twine &Name = "",
1509 return CreateFCmp(FCmpInst::FCMP_ULE, LHS, RHS, Name, FPMathTag);
1511 Value *CreateFCmpUNE(Value *LHS, Value *RHS, const Twine &Name = "",
1513 return CreateFCmp(FCmpInst::FCMP_UNE, LHS, RHS, Name, FPMathTag);
1516 Value *CreateICmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
1518 if (Constant *LC = dyn_cast<Constant>(LHS))
1521 return Insert(new ICmpInst(P, LHS, RHS), Name);
1523 Value *CreateFCmp(CmpInst::Predicate P, Value *LHS, Value *RHS,
1525 if (Constant *LC = dyn_cast<Constant>(LHS))
1528 return Insert(AddFPMathAttributes(new FCmpInst(P, LHS, RHS),
1674 Value *CreatePtrDiff(Value *LHS, Value *RHS, const Twine &Name = "") {
1675 assert(LHS->getType() == RHS->getType() &&
1677 PointerType *ArgType = cast<PointerType>(LHS->getType());
1678 Value *LHS_int = CreatePtrToInt(LHS, Type::getInt64Ty(Context));