diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 8a75fb77f91d6..696de0d15a8cf 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -6902,11 +6902,9 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan, // cost model won't cost it whilst the legacy will. if (auto *FOR = dyn_cast(&R)) { using namespace VPlanPatternMatch; - if (none_of( - FOR->users(), - match_fn( - m_VPInstruction( - m_VPValue(), m_VPValue())))) + if (none_of(FOR->users(), + match_fn(m_VPInstruction< + VPInstruction::FirstOrderRecurrenceSplice>()))) return true; } // The VPlan-based cost model is more accurate for partial reduction and diff --git a/llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h b/llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h index 8f9ce7a74b58b..9a7f234a1b98e 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h +++ b/llvm/lib/Transforms/Vectorize/VPlanPatternMatch.h @@ -239,11 +239,9 @@ struct Recipe_match { } bool match(const VPRecipeBase *R) const { - if (std::tuple_size::value == 0) { - assert(Opcode == VPInstruction::BuildVector && - "can only match BuildVector with empty ops"); + if (std::tuple_size_v == 0) { auto *VPI = dyn_cast(R); - return VPI && VPI->getOpcode() == VPInstruction::BuildVector; + return VPI && VPI->getOpcode() == Opcode; } if ((!matchRecipeAndOpcode(R) && ...)) diff --git a/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp b/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp index 180b1b96b6364..5e7f19faebb56 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp @@ -317,8 +317,8 @@ void UnrollState::unrollRecipeByUF(VPRecipeBase &R) { // requiring it. if (isa(Copy) || - match(Copy, m_VPInstruction( - m_VPValue()))) + match(Copy, + m_VPInstruction())) Copy->addOperand(getConstantVPV(Part)); if (isa(R)) diff --git a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp index ddc4ad1977401..f30d790a7426c 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanUtils.cpp @@ -98,8 +98,7 @@ bool vputils::isUniformAcrossVFsAndUFs(VPValue *V) { VPRecipeBase *R = V->getDefiningRecipe(); if (R && V->isDefinedOutsideLoopRegions()) { if (match(V->getDefiningRecipe(), - m_VPInstruction( - m_VPValue()))) + m_VPInstruction())) return false; return all_of(R->operands(), isUniformAcrossVFsAndUFs); }