/freebsd/contrib/llvm-project/llvm/lib/Transforms/InstCombine/ |
H A D | InstCombineMulDivRem.cpp | 246 if (match(&I, m_Mul(m_Value(NewOp), m_Constant(C1)))) { in visitMul() 348 if (match(Op0, m_Neg(m_Value(X))) && match(Op1, m_Constant(Op1C))) in visitMul() 684 if (match(Op1, m_Constant(C)) && C->isFiniteNonZeroFP() && in foldFMulReassoc() 691 if (match(Op0, m_OneUse(m_FDiv(m_Constant(C1), m_Value(X))))) { in foldFMulReassoc() 698 if (match(Op0, m_FDiv(m_Value(X), m_Constant(C1)))) { in foldFMulReassoc() 717 if (match(Op0, m_OneUse(m_FAdd(m_Value(X), m_Constant(C1))))) { in foldFMulReassoc() 725 if (match(Op0, m_OneUse(m_FSub(m_Constant(C1), m_Value(X))))) { in foldFMulReassoc() 906 if (match(Op0, m_FNeg(m_Value(X))) && match(Op1, m_Constant(C))) in visitFMul() 1489 match(D, m_Constant(C))) { in narrowUDivURem() 1500 match(N, m_Constant(C))) { in narrowUDivURem() [all …]
|
H A D | InstCombineShifts.cpp | 360 if (!match(I.getOperand(1), m_Constant(C1))) in foldShiftOfShiftedBinOp() 378 return match(V, m_BinOp(ShiftOpcode, m_Value(X), m_Constant(C0))) && in foldShiftOfShiftedBinOp() 442 if (match(Op0, m_Constant(C)) && in commonShiftTransforms() 443 match(Op1, m_NUWAddLike(m_Value(A), m_Constant(C1)))) { in commonShiftTransforms() 499 if (Op1->hasOneUse() && match(Op1, m_SRem(m_Value(A), m_Constant(C))) && in commonShiftTransforms() 1619 m_ZExtOrSelf(m_Sub(m_Constant(C1), in foldVariableSignZeroExtensionOfVariableHighBitExtract() 1621 m_ZExtOrSelf(m_Sub(m_Constant(C2), in foldVariableSignZeroExtensionOfVariableHighBitExtract() 1640 m_Sub(m_Constant(C0), m_ZExtOrSelf(m_Specific(NBits))))) || in foldVariableSignZeroExtensionOfVariableHighBitExtract()
|
H A D | InstCombineAddSub.cpp | 814 if (!match(Op1, m_Constant(Op1C))) in foldNoWrapAdd() 839 m_NSWAddLike(m_Value(X), m_Constant(NarrowC)))))) { in foldNoWrapAdd() 847 m_OneUse(m_ZExt(m_NUWAddLike(m_Value(X), m_Constant(NarrowC)))))) { in foldNoWrapAdd() 870 if (match(Op0, m_Sub(m_Constant(Op00C), m_Value(X)))) in foldAddWithConstant() 1345 m_ZExtOrSelf(m_Sub(m_Constant(C), m_ZExtOrSelf(m_Value(NBits))))) || in canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract() 1389 m_Shl(m_Constant(SignExtendingValueBaseConstant), in canonicalizeCondSignextOfHighBitExtractToSignextHighBitExtract() 2440 if (match(Op0, m_OneUse(m_And(m_Specific(Op1), m_Constant(C))))) { in visitSub() 2684 if (match(FNegOp, m_FMul(m_Value(X), m_Constant(C)))) in foldFNegIntoConstant() 2688 if (match(FNegOp, m_FDiv(m_Value(X), m_Constant(C)))) in foldFNegIntoConstant() 2692 if (match(FNegOp, m_FDiv(m_Constant(C), m_Value(X)))) in foldFNegIntoConstant() [all …]
|
H A D | InstCombineCasts.cpp | 567 if (match(BinOp0, m_Constant(C))) { in narrowBinOp() 573 if (match(BinOp1, m_Constant(C))) { in narrowBinOp() 597 if (match(BinOp0, m_Trunc(m_Value(A))) && match(BinOp1, m_Constant(C))) { in narrowBinOp() 785 if (match(Src, m_LShr(m_SExt(m_Value(A)), m_Constant(C)))) { in visitTrunc() 835 if (match(Src, m_Shl(m_Value(A), m_Constant(C))) && in visitTrunc() 836 !match(A, m_Shr(m_Value(), m_Constant()))) { in visitTrunc() 1236 if (match(Src, m_OneUse(m_And(m_Trunc(m_Value(X)), m_Constant(C)))) && in visitZExt() 1242 if (match(Src, m_OneUse(m_Xor(m_Value(And), m_Constant(C)))) && in visitZExt() 1254 if (match(Src, m_And(m_Trunc(m_Value(X)), m_Constant(C))) && in visitZExt() 1517 if (match(Src, m_AShr(m_Shl(m_Trunc(m_Value(A)), m_Constant(BA)), in visitSExt() [all …]
|
H A D | InstCombineVectorOps.cpp | 1395 match(InsElt2.getOperand(1), m_Constant(ScalarC)) && in hoistInsEltConst() 1417 if (!match(Shuf->getOperand(1), m_Constant(ShufConstVec)) || in foldConstantInsEltIntoShuffle() 1418 !match(InsElt.getOperand(1), m_Constant(InsEltScalar)) || in foldConstantInsEltIntoShuffle() 1474 !match(InsElt.getOperand(1), m_Constant(Val[0])) || in foldConstantInsEltIntoShuffle() 1476 !match(IEI->getOperand(1), m_Constant(Val[1]))) in foldConstantInsEltIntoShuffle() 2155 if (match(Op0, m_BinOp(m_Specific(Op1), m_Constant(C)))) in foldSelectShuffleWith1Binop() 2157 else if (match(Op1, m_BinOp(m_Specific(Op0), m_Constant(C)))) in foldSelectShuffleWith1Binop() 2280 if (match(B0, m_BinOp(m_Constant(C0), m_Value(X))) && in foldSelectShuffle() 2281 match(B1, m_BinOp(m_Constant(C1), m_Value(Y)))) in foldSelectShuffle() 2283 else if (match(B0, m_CombineOr(m_BinOp(m_Value(X), m_Constant(C0)), in foldSelectShuffle() [all …]
|
H A D | InstCombineAndOrXor.cpp | 1230 if (!match(Cmp0, m_ICmp(Pred0, m_Value(X), m_Constant(C))) || in foldAndOrOfICmpsWithConstEq() 1918 if (!match(Op0, m_OneUse(m_Add(m_Specific(Op1), m_Constant(C)))) && in narrowMaskedBinOp() 1919 !match(Op0, m_OneUse(m_Mul(m_Specific(Op1), m_Constant(C)))) && in narrowMaskedBinOp() 1920 !match(Op0, m_OneUse(m_LShr(m_Specific(Op1), m_Constant(C)))) && in narrowMaskedBinOp() 1921 !match(Op0, m_OneUse(m_Shl(m_Specific(Op1), m_Constant(C)))) && in narrowMaskedBinOp() 1922 !match(Op0, m_OneUse(m_Sub(m_Constant(C), m_Specific(Op1))))) in narrowMaskedBinOp() 2895 if (match(L, m_Constant(LC)) && match(R, m_Constant(RC)) && in convertOrOfShiftsToFunnelShift() 3147 if (match(A, m_Constant(AConst)) && match(B, m_Constant(BConst))) in getSelectCondition() 3181 if (match(A, (m_Xor(m_SExt(m_Value(Cond)), m_Constant(AConst)))) && in getSelectCondition() 3182 match(B, (m_Xor(m_SExt(m_Specific(Cond)), m_Constant(BConst)))) && in getSelectCondition() [all …]
|
H A D | InstCombineSelect.cpp | 62 if (!match(Sel.getCondition(), m_Cmp(Pred, m_Value(X), m_Constant(C)))) in foldSelectBinOpIdentity() 1337 !match(OldOp, m_Constant()) && !Cmp.getType()->isVectorTy() && in foldSelectValueEquivalence() 1407 m_CombineAnd(m_AnyIntegralConstant(), m_Constant(C0)))) in canonicalizeClampLike() 1461 m_CombineAnd(m_AnyIntegralConstant(), m_Constant(C1))))) in canonicalizeClampLike() 1472 m_CombineAnd(m_AnyIntegralConstant(), m_Constant(C2))))) in canonicalizeClampLike() 1579 m_CombineAnd(m_AnyIntegralConstant(), m_Constant(C0)))))) in tryToReuseConstantFromSelectInComparison() 1599 if (Pred == CmpInst::ICMP_ULT && match(X, m_Add(m_Value(), m_Constant()))) in tryToReuseConstantFromSelectInComparison() 1870 !match(TrueVal, m_Constant()) && !match(FalseVal, m_Constant()) && in foldSelectInstWithICmp() 2215 if (!match(Sel.getTrueValue(), m_Constant(C)) && in foldSelectExtConst() 2216 !match(Sel.getFalseValue(), m_Constant(C))) in foldSelectExtConst() [all …]
|
H A D | InstructionCombining.cpp | 356 if (!match(BinOp1->getOperand(1), m_Constant(C1)) || in simplifyAssocCastAssoc() 357 !match(BinOp2->getOperand(1), m_Constant(C2))) in simplifyAssocCastAssoc() 551 match(Op0, m_OneUse(m_BinOp(m_Value(A), m_Constant(C1)))) && in SimplifyAssociativeOrCommutative() 552 match(Op1, m_OneUse(m_BinOp(m_Value(B), m_Constant(C2)))) && in SimplifyAssociativeOrCommutative() 1608 if (!match(BO.getOperand(1), m_Constant(Op1FpC)) && in foldFBinOpOfIntCasts() 1660 m_ICmp(Pred, m_Specific(Op), m_Constant(C))) && in constantFoldOperationIntoSelectOperand() 2283 if (!Op0->hasOneUse() || !match(Op1, m_Constant(WideC))) in narrowMathIfNoOverflow() 2328 m_Select(m_Value(Cond), m_Constant(TrueC), m_Constant(FalseC)))) in foldSelectGEP() 4645 else if (match(U, m_Select(m_Specific(&I), m_Constant(), m_Value()))) in visitFreeze() 4667 if (match(Op0, m_Constant(C)) && C->containsUndefOrPoisonElement()) { in visitFreeze()
|
H A D | InstCombineCalls.cpp | 1724 if (match(I0, m_ZExt(m_Value(X))) && match(I1, m_Constant(C)) && in visitCallInst() 1746 if (match(I0, m_SExt(m_Value(X))) && match(I1, m_Constant(C)) && in visitCallInst() 2206 if (match(Arg1, m_Constant(C)) && C->isNotMinSignedValue()) { in visitCallInst() 2266 if (IID == Intrinsic::ssub_sat && match(Arg1, m_Constant(C)) && in visitCallInst()
|
H A D | InstCombineCompares.cpp | 1181 if (match(Val, m_TruncOrSelf(m_Shr(m_Value(X), m_Constant(C))))) { in foldSignBitTest() 5660 if (match(Op0, m_OneUse(m_Or(m_Value(X), m_Constant(C)))) && in foldICmpEquality() 7070 if (!LHS->hasOneUse() || !match(RHS, m_Constant(C))) in foldVectorCmp() 7224 if (match(Op0, m_Intrinsic<Intrinsic::abs>(m_Value(X), m_Constant(C))) && in foldICmpCommutative() 8210 if (match(Op0, m_Instruction(LHSI)) && match(Op1, m_Constant(RHSC))) { in visitFCmpInst() 8256 if (match(Op1, m_Constant(C))) in visitFCmpInst()
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Scalar/ |
H A D | Reassociate.cpp | 834 if (match(TheNeg, m_BinOp(m_Constant(C), m_Value())) && in NegateValue() 2029 if (match(I->getOperand(0), m_Constant())) in getNegatibleInsts() 2041 if (match(I->getOperand(0), m_Constant()) && in getNegatibleInsts() 2042 match(I->getOperand(1), m_Constant())) in getNegatibleInsts() 2085 assert(!match(Negatible->getOperand(1), m_Constant()) && in canonicalizeNegFPConstantsForOp() 2092 assert(!match(Negatible->getOperand(0), m_Constant()) && in canonicalizeNegFPConstantsForOp()
|
H A D | CallSiteSplitting.cpp | 137 if (!match(Cond, m_ICmp(Pred, m_Value(), m_Constant()))) in recordCondition()
|
H A D | JumpThreading.cpp | 599 if (!PredCst && match(V, m_Cmp(Pred, m_Value(Val), m_Constant(Cst)))) in computeValueKnownInPredecessorsImpl()
|
/freebsd/contrib/llvm-project/llvm/lib/Transforms/Vectorize/ |
H A D | VectorCombine.cpp | 934 if (!match(Ins0, m_InsertElt(m_Constant(VecC0), m_Value(V0), in scalarizeBinopOrCmp() 936 !match(Ins0, m_Constant(VecC0))) in scalarizeBinopOrCmp() 938 if (!match(Ins1, m_InsertElt(m_Constant(VecC1), m_Value(V1), in scalarizeBinopOrCmp() 940 !match(Ins1, m_Constant(VecC1))) in scalarizeBinopOrCmp() 1044 if (!match(B0, m_OneUse(m_Cmp(P0, m_Instruction(I0), m_Constant(C0)))) || in foldExtractedCmps() 1045 !match(B1, m_OneUse(m_Cmp(P1, m_Instruction(I1), m_Constant(C1)))) || in foldExtractedCmps()
|
/freebsd/contrib/llvm-project/llvm/include/llvm/IR/ |
H A D | PatternMatch.h | 165 inline class_match<Constant> m_Constant() { return class_match<Constant>(); } in m_Constant() function 834 inline bind_ty<Constant> m_Constant(Constant *&C) { return C; } in m_Constant() function 855 return m_CombineAnd(m_Constant(), m_Unless(m_ConstantExpr())); in m_ImmConstant() 862 return m_CombineAnd(m_Constant(C), m_Unless(m_ConstantExpr())); in m_ImmConstant()
|
/freebsd/contrib/llvm-project/llvm/lib/Analysis/ |
H A D | InstructionSimplify.cpp | 2001 if ((match(Op0, m_Add(m_Value(X), m_Constant(C1))) && in simplifyLogicOfAddSub() 2002 match(Op1, m_Sub(m_Constant(C2), m_Specific(X)))) || in simplifyLogicOfAddSub() 2003 (match(Op1, m_Add(m_Value(X), m_Constant(C1))) && in simplifyLogicOfAddSub() 2004 match(Op0, m_Sub(m_Constant(C2), m_Specific(X))))) { in simplifyLogicOfAddSub() 4926 match(TrueVal, m_Constant(TrueC)) && in simplifySelectInst() 4927 match(FalseVal, m_Constant(FalseC))) { in simplifySelectInst() 5477 if (!Scalable && match(Op0, m_InsertElt(m_Value(), m_Constant(C), in simplifyShuffleVectorInst()
|
H A D | VectorUtils.cpp | 214 if (match(V, m_Add(m_Value(Val), m_Constant(C)))) in findScalarElement()
|
H A D | ValueTracking.cpp | 8638 if (match(CmpI->getOperand(1), m_Constant(CmpConst)) && in lookThroughCast() 9794 } else if (match(RHS, m_Constant())) in findValuesAffectedByCondition()
|
/freebsd/contrib/llvm-project/llvm/lib/CodeGen/ |
H A D | CodeGenPrepare.cpp | 1504 if (match(IVInc, m_Add(m_Instruction(LHS), m_Constant(Step))) || in matchIncrement() 1506 m_Instruction(LHS), m_Constant(Step))))) in matchIncrement() 1508 if (match(IVInc, m_Sub(m_Instruction(LHS), m_Constant(Step))) || in matchIncrement() 1510 m_Instruction(LHS), m_Constant(Step))))) { in matchIncrement()
|
/freebsd/contrib/llvm-project/llvm/lib/Target/ARM/ |
H A D | ARMTargetTransformInfo.cpp | 177 PatternMatch::m_Constant(XorMask))) && in instCombineIntrinsic()
|