Lines Matching refs:Op0

149   if (BinaryOperator *Op0 = dyn_cast<BinaryOperator>(LHS))  in ExpandBinOp()  local
150 if (Op0->getOpcode() == OpcodeToExpand) { in ExpandBinOp()
152 Value *A = Op0->getOperand(0), *B = Op0->getOperand(1), *C = RHS; in ExpandBinOp()
208 BinaryOperator *Op0 = dyn_cast<BinaryOperator>(LHS); in SimplifyAssociativeBinOp() local
212 if (Op0 && Op0->getOpcode() == Opcode) { in SimplifyAssociativeBinOp()
213 Value *A = Op0->getOperand(0); in SimplifyAssociativeBinOp()
214 Value *B = Op0->getOperand(1); in SimplifyAssociativeBinOp()
254 if (Op0 && Op0->getOpcode() == Opcode) { in SimplifyAssociativeBinOp()
255 Value *A = Op0->getOperand(0); in SimplifyAssociativeBinOp()
256 Value *B = Op0->getOperand(1); in SimplifyAssociativeBinOp()
529 static Value *SimplifyAddInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, in SimplifyAddInst() argument
531 if (Constant *CLHS = dyn_cast<Constant>(Op0)) { in SimplifyAddInst()
536 std::swap(Op0, Op1); in SimplifyAddInst()
545 return Op0; in SimplifyAddInst()
551 if (match(Op1, m_Sub(m_Value(Y), m_Specific(Op0))) || in SimplifyAddInst()
552 match(Op0, m_Sub(m_Value(Y), m_Specific(Op1)))) in SimplifyAddInst()
556 if (match(Op0, m_Not(m_Specific(Op1))) || in SimplifyAddInst()
557 match(Op1, m_Not(m_Specific(Op0)))) in SimplifyAddInst()
558 return Constant::getAllOnesValue(Op0->getType()); in SimplifyAddInst()
561 if (MaxRecurse && Op0->getType()->isIntegerTy(1)) in SimplifyAddInst()
562 if (Value *V = SimplifyXorInst(Op0, Op1, Q, MaxRecurse-1)) in SimplifyAddInst()
566 if (Value *V = SimplifyAssociativeBinOp(Instruction::Add, Op0, Op1, Q, in SimplifyAddInst()
582 Value *llvm::SimplifyAddInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, in SimplifyAddInst() argument
586 return ::SimplifyAddInst(Op0, Op1, isNSW, isNUW, Query(DL, TLI, DT, AC, CxtI), in SimplifyAddInst()
663 static Value *SimplifySubInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, in SimplifySubInst() argument
665 if (Constant *CLHS = dyn_cast<Constant>(Op0)) in SimplifySubInst()
671 if (match(Op0, m_Undef()) || match(Op1, m_Undef())) in SimplifySubInst()
672 return UndefValue::get(Op0->getType()); in SimplifySubInst()
676 return Op0; in SimplifySubInst()
679 if (Op0 == Op1) in SimplifySubInst()
680 return Constant::getNullValue(Op0->getType()); in SimplifySubInst()
683 if (isNUW && match(Op0, m_Zero())) in SimplifySubInst()
684 return Op0; in SimplifySubInst()
689 if (MaxRecurse && match(Op0, m_Add(m_Value(X), m_Value(Y)))) { // (X + Y) - Z in SimplifySubInst()
710 X = Op0; in SimplifySubInst()
732 Z = Op0; in SimplifySubInst()
744 if (MaxRecurse && match(Op0, m_Trunc(m_Value(X))) && in SimplifySubInst()
750 if (Value *W = SimplifyTruncInst(V, Op0->getType(), Q, MaxRecurse-1)) in SimplifySubInst()
755 if (match(Op0, m_PtrToInt(m_Value(X))) && in SimplifySubInst()
758 return ConstantExpr::getIntegerCast(Result, Op0->getType(), true); in SimplifySubInst()
761 if (MaxRecurse && Op0->getType()->isIntegerTy(1)) in SimplifySubInst()
762 if (Value *V = SimplifyXorInst(Op0, Op1, Q, MaxRecurse-1)) in SimplifySubInst()
777 Value *llvm::SimplifySubInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, in SimplifySubInst() argument
781 return ::SimplifySubInst(Op0, Op1, isNSW, isNUW, Query(DL, TLI, DT, AC, CxtI), in SimplifySubInst()
787 static Value *SimplifyFAddInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFAddInst() argument
789 if (Constant *CLHS = dyn_cast<Constant>(Op0)) { in SimplifyFAddInst()
794 std::swap(Op0, Op1); in SimplifyFAddInst()
799 return Op0; in SimplifyFAddInst()
803 (FMF.noSignedZeros() || CannotBeNegativeZero(Op0, Q.TLI))) in SimplifyFAddInst()
804 return Op0; in SimplifyFAddInst()
810 if (match(Op1, m_FSub(m_AnyZero(), m_Specific(Op0)))) in SimplifyFAddInst()
812 else if (match(Op0, m_FSub(m_AnyZero(), m_Specific(Op1)))) in SimplifyFAddInst()
813 SubOp = Op0; in SimplifyFAddInst()
818 return Constant::getNullValue(Op0->getType()); in SimplifyFAddInst()
826 static Value *SimplifyFSubInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFSubInst() argument
828 if (Constant *CLHS = dyn_cast<Constant>(Op0)) { in SimplifyFSubInst()
835 return Op0; in SimplifyFSubInst()
839 (FMF.noSignedZeros() || CannotBeNegativeZero(Op0, Q.TLI))) in SimplifyFSubInst()
840 return Op0; in SimplifyFSubInst()
844 if (match(Op0, m_NegZero()) && match(Op1, m_FSub(m_NegZero(), m_Value(X)))) in SimplifyFSubInst()
848 if (FMF.noSignedZeros() && match(Op0, m_AnyZero()) && in SimplifyFSubInst()
853 if (FMF.noNaNs() && Op0 == Op1) in SimplifyFSubInst()
854 return Constant::getNullValue(Op0->getType()); in SimplifyFSubInst()
860 static Value *SimplifyFMulInst(Value *Op0, Value *Op1, in SimplifyFMulInst() argument
864 if (Constant *CLHS = dyn_cast<Constant>(Op0)) { in SimplifyFMulInst()
869 std::swap(Op0, Op1); in SimplifyFMulInst()
874 return Op0; in SimplifyFMulInst()
885 static Value *SimplifyMulInst(Value *Op0, Value *Op1, const Query &Q, in SimplifyMulInst() argument
887 if (Constant *CLHS = dyn_cast<Constant>(Op0)) { in SimplifyMulInst()
892 std::swap(Op0, Op1); in SimplifyMulInst()
897 return Constant::getNullValue(Op0->getType()); in SimplifyMulInst()
905 return Op0; in SimplifyMulInst()
909 if (match(Op0, m_Exact(m_IDiv(m_Value(X), m_Specific(Op1)))) || // (X / Y) * Y in SimplifyMulInst()
910 match(Op1, m_Exact(m_IDiv(m_Value(X), m_Specific(Op0))))) // Y * (X / Y) in SimplifyMulInst()
914 if (MaxRecurse && Op0->getType()->isIntegerTy(1)) in SimplifyMulInst()
915 if (Value *V = SimplifyAndInst(Op0, Op1, Q, MaxRecurse-1)) in SimplifyMulInst()
919 if (Value *V = SimplifyAssociativeBinOp(Instruction::Mul, Op0, Op1, Q, in SimplifyMulInst()
924 if (Value *V = ExpandBinOp(Instruction::Mul, Op0, Op1, Instruction::Add, in SimplifyMulInst()
930 if (isa<SelectInst>(Op0) || isa<SelectInst>(Op1)) in SimplifyMulInst()
931 if (Value *V = ThreadBinOpOverSelect(Instruction::Mul, Op0, Op1, Q, in SimplifyMulInst()
937 if (isa<PHINode>(Op0) || isa<PHINode>(Op1)) in SimplifyMulInst()
938 if (Value *V = ThreadBinOpOverPHI(Instruction::Mul, Op0, Op1, Q, in SimplifyMulInst()
945 Value *llvm::SimplifyFAddInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFAddInst() argument
950 return ::SimplifyFAddInst(Op0, Op1, FMF, Query(DL, TLI, DT, AC, CxtI), in SimplifyFAddInst()
954 Value *llvm::SimplifyFSubInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFSubInst() argument
959 return ::SimplifyFSubInst(Op0, Op1, FMF, Query(DL, TLI, DT, AC, CxtI), in SimplifyFSubInst()
963 Value *llvm::SimplifyFMulInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFMulInst() argument
968 return ::SimplifyFMulInst(Op0, Op1, FMF, Query(DL, TLI, DT, AC, CxtI), in SimplifyFMulInst()
972 Value *llvm::SimplifyMulInst(Value *Op0, Value *Op1, const DataLayout &DL, in SimplifyMulInst() argument
976 return ::SimplifyMulInst(Op0, Op1, Query(DL, TLI, DT, AC, CxtI), in SimplifyMulInst()
982 static Value *SimplifyDiv(Instruction::BinaryOps Opcode, Value *Op0, Value *Op1, in SimplifyDiv() argument
984 if (Constant *C0 = dyn_cast<Constant>(Op0)) in SimplifyDiv()
999 if (match(Op0, m_Undef())) in SimplifyDiv()
1000 return Constant::getNullValue(Op0->getType()); in SimplifyDiv()
1003 if (match(Op0, m_Zero())) in SimplifyDiv()
1004 return Op0; in SimplifyDiv()
1008 return Op0; in SimplifyDiv()
1010 if (Op0->getType()->isIntegerTy(1)) in SimplifyDiv()
1012 return Op0; in SimplifyDiv()
1015 if (Op0 == Op1) in SimplifyDiv()
1016 return ConstantInt::get(Op0->getType(), 1); in SimplifyDiv()
1020 if (match(Op0, m_Mul(m_Value(X), m_Value(Y))) && (X == Op1 || Y == Op1)) { in SimplifyDiv()
1022 OverflowingBinaryOperator *Mul = cast<OverflowingBinaryOperator>(Op0); in SimplifyDiv()
1034 if ((isSigned && match(Op0, m_SRem(m_Value(), m_Specific(Op1)))) || in SimplifyDiv()
1035 (!isSigned && match(Op0, m_URem(m_Value(), m_Specific(Op1))))) in SimplifyDiv()
1036 return Constant::getNullValue(Op0->getType()); in SimplifyDiv()
1040 if (!isSigned && match(Op0, m_UDiv(m_Value(X), m_ConstantInt(C1))) && in SimplifyDiv()
1045 return Constant::getNullValue(Op0->getType()); in SimplifyDiv()
1050 if (isa<SelectInst>(Op0) || isa<SelectInst>(Op1)) in SimplifyDiv()
1051 if (Value *V = ThreadBinOpOverSelect(Opcode, Op0, Op1, Q, MaxRecurse)) in SimplifyDiv()
1056 if (isa<PHINode>(Op0) || isa<PHINode>(Op1)) in SimplifyDiv()
1057 if (Value *V = ThreadBinOpOverPHI(Opcode, Op0, Op1, Q, MaxRecurse)) in SimplifyDiv()
1065 static Value *SimplifySDivInst(Value *Op0, Value *Op1, const Query &Q, in SimplifySDivInst() argument
1067 if (Value *V = SimplifyDiv(Instruction::SDiv, Op0, Op1, Q, MaxRecurse)) in SimplifySDivInst()
1073 Value *llvm::SimplifySDivInst(Value *Op0, Value *Op1, const DataLayout &DL, in SimplifySDivInst() argument
1077 return ::SimplifySDivInst(Op0, Op1, Query(DL, TLI, DT, AC, CxtI), in SimplifySDivInst()
1083 static Value *SimplifyUDivInst(Value *Op0, Value *Op1, const Query &Q, in SimplifyUDivInst() argument
1085 if (Value *V = SimplifyDiv(Instruction::UDiv, Op0, Op1, Q, MaxRecurse)) in SimplifyUDivInst()
1091 Value *llvm::SimplifyUDivInst(Value *Op0, Value *Op1, const DataLayout &DL, in SimplifyUDivInst() argument
1095 return ::SimplifyUDivInst(Op0, Op1, Query(DL, TLI, DT, AC, CxtI), in SimplifyUDivInst()
1099 static Value *SimplifyFDivInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFDivInst() argument
1102 if (match(Op0, m_Undef())) in SimplifyFDivInst()
1103 return Op0; in SimplifyFDivInst()
1112 if (FMF.noNaNs() && FMF.noSignedZeros() && match(Op0, m_AnyZero())) in SimplifyFDivInst()
1113 return Op0; in SimplifyFDivInst()
1117 if (Op0 == Op1) in SimplifyFDivInst()
1118 return ConstantFP::get(Op0->getType(), 1.0); in SimplifyFDivInst()
1123 if ((BinaryOperator::isFNeg(Op0, /*IgnoreZeroSign=*/true) && in SimplifyFDivInst()
1124 BinaryOperator::getFNegArgument(Op0) == Op1) || in SimplifyFDivInst()
1126 BinaryOperator::getFNegArgument(Op1) == Op0)) in SimplifyFDivInst()
1127 return ConstantFP::get(Op0->getType(), -1.0); in SimplifyFDivInst()
1133 Value *llvm::SimplifyFDivInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFDivInst() argument
1138 return ::SimplifyFDivInst(Op0, Op1, FMF, Query(DL, TLI, DT, AC, CxtI), in SimplifyFDivInst()
1144 static Value *SimplifyRem(Instruction::BinaryOps Opcode, Value *Op0, Value *Op1, in SimplifyRem() argument
1146 if (Constant *C0 = dyn_cast<Constant>(Op0)) in SimplifyRem()
1155 if (match(Op0, m_Undef())) in SimplifyRem()
1156 return Constant::getNullValue(Op0->getType()); in SimplifyRem()
1159 if (match(Op0, m_Zero())) in SimplifyRem()
1160 return Op0; in SimplifyRem()
1164 return UndefValue::get(Op0->getType()); in SimplifyRem()
1168 return Constant::getNullValue(Op0->getType()); in SimplifyRem()
1170 if (Op0->getType()->isIntegerTy(1)) in SimplifyRem()
1172 return Constant::getNullValue(Op0->getType()); in SimplifyRem()
1175 if (Op0 == Op1) in SimplifyRem()
1176 return Constant::getNullValue(Op0->getType()); in SimplifyRem()
1180 match(Op0, m_SRem(m_Value(), m_Specific(Op1)))) || in SimplifyRem()
1182 match(Op0, m_URem(m_Value(), m_Specific(Op1))))) in SimplifyRem()
1183 return Op0; in SimplifyRem()
1187 if (isa<SelectInst>(Op0) || isa<SelectInst>(Op1)) in SimplifyRem()
1188 if (Value *V = ThreadBinOpOverSelect(Opcode, Op0, Op1, Q, MaxRecurse)) in SimplifyRem()
1193 if (isa<PHINode>(Op0) || isa<PHINode>(Op1)) in SimplifyRem()
1194 if (Value *V = ThreadBinOpOverPHI(Opcode, Op0, Op1, Q, MaxRecurse)) in SimplifyRem()
1202 static Value *SimplifySRemInst(Value *Op0, Value *Op1, const Query &Q, in SimplifySRemInst() argument
1204 if (Value *V = SimplifyRem(Instruction::SRem, Op0, Op1, Q, MaxRecurse)) in SimplifySRemInst()
1210 Value *llvm::SimplifySRemInst(Value *Op0, Value *Op1, const DataLayout &DL, in SimplifySRemInst() argument
1214 return ::SimplifySRemInst(Op0, Op1, Query(DL, TLI, DT, AC, CxtI), in SimplifySRemInst()
1220 static Value *SimplifyURemInst(Value *Op0, Value *Op1, const Query &Q, in SimplifyURemInst() argument
1222 if (Value *V = SimplifyRem(Instruction::URem, Op0, Op1, Q, MaxRecurse)) in SimplifyURemInst()
1228 Value *llvm::SimplifyURemInst(Value *Op0, Value *Op1, const DataLayout &DL, in SimplifyURemInst() argument
1232 return ::SimplifyURemInst(Op0, Op1, Query(DL, TLI, DT, AC, CxtI), in SimplifyURemInst()
1236 static Value *SimplifyFRemInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFRemInst() argument
1239 if (match(Op0, m_Undef())) in SimplifyFRemInst()
1240 return Op0; in SimplifyFRemInst()
1249 if (FMF.noNaNs() && FMF.noSignedZeros() && match(Op0, m_AnyZero())) in SimplifyFRemInst()
1250 return Op0; in SimplifyFRemInst()
1255 Value *llvm::SimplifyFRemInst(Value *Op0, Value *Op1, FastMathFlags FMF, in SimplifyFRemInst() argument
1260 return ::SimplifyFRemInst(Op0, Op1, FMF, Query(DL, TLI, DT, AC, CxtI), in SimplifyFRemInst()
1293 static Value *SimplifyShift(unsigned Opcode, Value *Op0, Value *Op1, in SimplifyShift() argument
1295 if (Constant *C0 = dyn_cast<Constant>(Op0)) in SimplifyShift()
1300 if (match(Op0, m_Zero())) in SimplifyShift()
1301 return Op0; in SimplifyShift()
1305 return Op0; in SimplifyShift()
1309 return UndefValue::get(Op0->getType()); in SimplifyShift()
1313 if (isa<SelectInst>(Op0) || isa<SelectInst>(Op1)) in SimplifyShift()
1314 if (Value *V = ThreadBinOpOverSelect(Opcode, Op0, Op1, Q, MaxRecurse)) in SimplifyShift()
1319 if (isa<PHINode>(Op0) || isa<PHINode>(Op1)) in SimplifyShift()
1320 if (Value *V = ThreadBinOpOverPHI(Opcode, Op0, Op1, Q, MaxRecurse)) in SimplifyShift()
1330 return UndefValue::get(Op0->getType()); in SimplifyShift()
1337 return Op0; in SimplifyShift()
1344 static Value *SimplifyRightShift(unsigned Opcode, Value *Op0, Value *Op1, in SimplifyRightShift() argument
1347 if (Value *V = SimplifyShift(Opcode, Op0, Op1, Q, MaxRecurse)) in SimplifyRightShift()
1351 if (Op0 == Op1) in SimplifyRightShift()
1352 return Constant::getNullValue(Op0->getType()); in SimplifyRightShift()
1356 if (match(Op0, m_Undef())) in SimplifyRightShift()
1357 return isExact ? Op0 : Constant::getNullValue(Op0->getType()); in SimplifyRightShift()
1361 unsigned BitWidth = Op0->getType()->getScalarSizeInBits(); in SimplifyRightShift()
1364 computeKnownBits(Op0, Op0KnownZero, Op0KnownOne, Q.DL, /*Depth=*/0, Q.AC, in SimplifyRightShift()
1367 return Op0; in SimplifyRightShift()
1375 static Value *SimplifyShlInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, in SimplifyShlInst() argument
1377 if (Value *V = SimplifyShift(Instruction::Shl, Op0, Op1, Q, MaxRecurse)) in SimplifyShlInst()
1382 if (match(Op0, m_Undef())) in SimplifyShlInst()
1383 return isNSW || isNUW ? Op0 : Constant::getNullValue(Op0->getType()); in SimplifyShlInst()
1387 if (match(Op0, m_Exact(m_Shr(m_Value(X), m_Specific(Op1))))) in SimplifyShlInst()
1392 Value *llvm::SimplifyShlInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, in SimplifyShlInst() argument
1396 return ::SimplifyShlInst(Op0, Op1, isNSW, isNUW, Query(DL, TLI, DT, AC, CxtI), in SimplifyShlInst()
1402 static Value *SimplifyLShrInst(Value *Op0, Value *Op1, bool isExact, in SimplifyLShrInst() argument
1404 if (Value *V = SimplifyRightShift(Instruction::LShr, Op0, Op1, isExact, Q, in SimplifyLShrInst()
1410 if (match(Op0, m_NUWShl(m_Value(X), m_Specific(Op1)))) in SimplifyLShrInst()
1416 Value *llvm::SimplifyLShrInst(Value *Op0, Value *Op1, bool isExact, in SimplifyLShrInst() argument
1421 return ::SimplifyLShrInst(Op0, Op1, isExact, Query(DL, TLI, DT, AC, CxtI), in SimplifyLShrInst()
1427 static Value *SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact, in SimplifyAShrInst() argument
1429 if (Value *V = SimplifyRightShift(Instruction::AShr, Op0, Op1, isExact, Q, in SimplifyAShrInst()
1434 if (match(Op0, m_AllOnes())) in SimplifyAShrInst()
1435 return Op0; in SimplifyAShrInst()
1439 if (match(Op0, m_NSWShl(m_Value(X), m_Specific(Op1)))) in SimplifyAShrInst()
1443 unsigned NumSignBits = ComputeNumSignBits(Op0, Q.DL, 0, Q.AC, Q.CxtI, Q.DT); in SimplifyAShrInst()
1444 if (NumSignBits == Op0->getType()->getScalarSizeInBits()) in SimplifyAShrInst()
1445 return Op0; in SimplifyAShrInst()
1450 Value *llvm::SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact, in SimplifyAShrInst() argument
1455 return ::SimplifyAShrInst(Op0, Op1, isExact, Query(DL, TLI, DT, AC, CxtI), in SimplifyAShrInst()
1500 static Value *SimplifyAndOfICmps(ICmpInst *Op0, ICmpInst *Op1) { in SimplifyAndOfICmps() argument
1501 Type *ITy = Op0->getType(); in SimplifyAndOfICmps()
1506 if (Value *X = simplifyUnsignedRangeCheck(Op0, Op1, /*IsAnd=*/true)) in SimplifyAndOfICmps()
1511 if (match(Op0, m_ICmp(Pred0, m_Value(V), m_APInt(C0))) && in SimplifyAndOfICmps()
1521 if (!match(Op0, m_ICmp(Pred0, m_Add(m_Value(V), m_ConstantInt(CI1)), in SimplifyAndOfICmps()
1528 auto *AddInst = cast<BinaryOperator>(Op0->getOperand(0)); in SimplifyAndOfICmps()
1563 static Value *SimplifyAndInst(Value *Op0, Value *Op1, const Query &Q, in SimplifyAndInst() argument
1565 if (Constant *CLHS = dyn_cast<Constant>(Op0)) { in SimplifyAndInst()
1570 std::swap(Op0, Op1); in SimplifyAndInst()
1575 return Constant::getNullValue(Op0->getType()); in SimplifyAndInst()
1578 if (Op0 == Op1) in SimplifyAndInst()
1579 return Op0; in SimplifyAndInst()
1587 return Op0; in SimplifyAndInst()
1590 if (match(Op0, m_Not(m_Specific(Op1))) || in SimplifyAndInst()
1591 match(Op1, m_Not(m_Specific(Op0)))) in SimplifyAndInst()
1592 return Constant::getNullValue(Op0->getType()); in SimplifyAndInst()
1596 if (match(Op0, m_Or(m_Value(A), m_Value(B))) && in SimplifyAndInst()
1602 (A == Op0 || B == Op0)) in SimplifyAndInst()
1603 return Op0; in SimplifyAndInst()
1606 if (match(Op0, m_Neg(m_Specific(Op1))) || in SimplifyAndInst()
1607 match(Op1, m_Neg(m_Specific(Op0)))) { in SimplifyAndInst()
1608 if (isKnownToBeAPowerOfTwo(Op0, Q.DL, /*OrZero*/ true, 0, Q.AC, Q.CxtI, in SimplifyAndInst()
1610 return Op0; in SimplifyAndInst()
1616 if (auto *ICILHS = dyn_cast<ICmpInst>(Op0)) { in SimplifyAndInst()
1627 auto *Cast0 = dyn_cast<CastInst>(Op0); in SimplifyAndInst()
1644 if (Value *V = SimplifyAssociativeBinOp(Instruction::And, Op0, Op1, Q, in SimplifyAndInst()
1649 if (Value *V = ExpandBinOp(Instruction::And, Op0, Op1, Instruction::Or, in SimplifyAndInst()
1654 if (Value *V = ExpandBinOp(Instruction::And, Op0, Op1, Instruction::Xor, in SimplifyAndInst()
1660 if (isa<SelectInst>(Op0) || isa<SelectInst>(Op1)) in SimplifyAndInst()
1661 if (Value *V = ThreadBinOpOverSelect(Instruction::And, Op0, Op1, Q, in SimplifyAndInst()
1667 if (isa<PHINode>(Op0) || isa<PHINode>(Op1)) in SimplifyAndInst()
1668 if (Value *V = ThreadBinOpOverPHI(Instruction::And, Op0, Op1, Q, in SimplifyAndInst()
1675 Value *llvm::SimplifyAndInst(Value *Op0, Value *Op1, const DataLayout &DL, in SimplifyAndInst() argument
1679 return ::SimplifyAndInst(Op0, Op1, Query(DL, TLI, DT, AC, CxtI), in SimplifyAndInst()
1685 static Value *SimplifyOrOfICmps(ICmpInst *Op0, ICmpInst *Op1) { in SimplifyOrOfICmps() argument
1690 if (Value *X = simplifyUnsignedRangeCheck(Op0, Op1, /*IsAnd=*/false)) in SimplifyOrOfICmps()
1693 if (!match(Op0, m_ICmp(Pred0, m_Add(m_Value(V), m_ConstantInt(CI1)), in SimplifyOrOfICmps()
1700 Type *ITy = Op0->getType(); in SimplifyOrOfICmps()
1702 auto *AddInst = cast<BinaryOperator>(Op0->getOperand(0)); in SimplifyOrOfICmps()
1737 static Value *SimplifyOrInst(Value *Op0, Value *Op1, const Query &Q, in SimplifyOrInst() argument
1739 if (Constant *CLHS = dyn_cast<Constant>(Op0)) { in SimplifyOrInst()
1744 std::swap(Op0, Op1); in SimplifyOrInst()
1749 return Constant::getAllOnesValue(Op0->getType()); in SimplifyOrInst()
1752 if (Op0 == Op1) in SimplifyOrInst()
1753 return Op0; in SimplifyOrInst()
1757 return Op0; in SimplifyOrInst()
1764 if (match(Op0, m_Not(m_Specific(Op1))) || in SimplifyOrInst()
1765 match(Op1, m_Not(m_Specific(Op0)))) in SimplifyOrInst()
1766 return Constant::getAllOnesValue(Op0->getType()); in SimplifyOrInst()
1770 if (match(Op0, m_And(m_Value(A), m_Value(B))) && in SimplifyOrInst()
1776 (A == Op0 || B == Op0)) in SimplifyOrInst()
1777 return Op0; in SimplifyOrInst()
1780 if (match(Op0, m_Not(m_And(m_Value(A), m_Value(B)))) && in SimplifyOrInst()
1786 (A == Op0 || B == Op0)) in SimplifyOrInst()
1787 return Constant::getAllOnesValue(Op0->getType()); in SimplifyOrInst()
1789 if (auto *ICILHS = dyn_cast<ICmpInst>(Op0)) { in SimplifyOrInst()
1799 if (Value *V = SimplifyAssociativeBinOp(Instruction::Or, Op0, Op1, Q, in SimplifyOrInst()
1804 if (Value *V = ExpandBinOp(Instruction::Or, Op0, Op1, Instruction::And, Q, in SimplifyOrInst()
1810 if (isa<SelectInst>(Op0) || isa<SelectInst>(Op1)) in SimplifyOrInst()
1811 if (Value *V = ThreadBinOpOverSelect(Instruction::Or, Op0, Op1, Q, in SimplifyOrInst()
1817 if (match(Op0, m_And(m_Value(A), m_Value(C))) && in SimplifyOrInst()
1853 if (isa<PHINode>(Op0) || isa<PHINode>(Op1)) in SimplifyOrInst()
1854 if (Value *V = ThreadBinOpOverPHI(Instruction::Or, Op0, Op1, Q, MaxRecurse)) in SimplifyOrInst()
1860 Value *llvm::SimplifyOrInst(Value *Op0, Value *Op1, const DataLayout &DL, in SimplifyOrInst() argument
1864 return ::SimplifyOrInst(Op0, Op1, Query(DL, TLI, DT, AC, CxtI), in SimplifyOrInst()
1870 static Value *SimplifyXorInst(Value *Op0, Value *Op1, const Query &Q, in SimplifyXorInst() argument
1872 if (Constant *CLHS = dyn_cast<Constant>(Op0)) { in SimplifyXorInst()
1877 std::swap(Op0, Op1); in SimplifyXorInst()
1886 return Op0; in SimplifyXorInst()
1889 if (Op0 == Op1) in SimplifyXorInst()
1890 return Constant::getNullValue(Op0->getType()); in SimplifyXorInst()
1893 if (match(Op0, m_Not(m_Specific(Op1))) || in SimplifyXorInst()
1894 match(Op1, m_Not(m_Specific(Op0)))) in SimplifyXorInst()
1895 return Constant::getAllOnesValue(Op0->getType()); in SimplifyXorInst()
1898 if (Value *V = SimplifyAssociativeBinOp(Instruction::Xor, Op0, Op1, Q, in SimplifyXorInst()
1914 Value *llvm::SimplifyXorInst(Value *Op0, Value *Op1, const DataLayout &DL, in SimplifyXorInst() argument
1918 return ::SimplifyXorInst(Op0, Op1, Query(DL, TLI, DT, AC, CxtI), in SimplifyXorInst()