llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-llvm-transforms Author: Alexey Bataev (alexey-bataev) <details> <summary>Changes</summary> --- Full diff: https://github.com/llvm/llvm-project/pull/83854.diff 2 Files Affected: - (modified) llvm/lib/Transforms/Vectorize/LoopVectorize.cpp (+3-3) - (modified) llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp (+16-13) ``````````diff diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 81992883ac7049..9fe63078786571 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1580,7 +1580,7 @@ class LoopVectorizationCostModel { /// Returns true if VP intrinsics with explicit vector length support should /// be generated in the tail folded loop. - bool useVPIWithVPEVLVectorization() const { + bool foldTailWithEVL() const { return getTailFoldingStyle() == TailFoldingStyle::DataWithEVL; } @@ -5310,7 +5310,7 @@ LoopVectorizationCostModel::selectInterleaveCount(ElementCount VF, return 1; // Do not interleave if EVL is preferred and no User IC is specified. - if (useVPIWithVPEVLVectorization()) { + if (foldTailWithEVL()) { LLVM_DEBUG(dbgs() << "LV: Preference for VP intrinsics indicated. " "Unroll factor forced to be 1.\n"); return 1; @@ -8564,7 +8564,7 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF, VPlanTransforms::truncateToMinimalBitwidths( *Plan, CM.getMinimalBitwidths(), PSE.getSE()->getContext()); VPlanTransforms::optimize(*Plan, *PSE.getSE()); - if (CM.useVPIWithVPEVLVectorization()) + if (CM.foldTailWithEVL()) VPlanTransforms::addExplicitVectorLength(*Plan); assert(verifyVPlanIsValid(*Plan) && "VPlan is invalid"); VPlans.push_back(std::move(Plan)); diff --git a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp index f549c8310fec5c..a3b8fc9db3fb72 100644 --- a/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp +++ b/llvm/lib/Transforms/Vectorize/VPlanVerifier.cpp @@ -93,8 +93,9 @@ static bool verifyVPBasicBlock(const VPBasicBlock *VPBB, RecipeNumbering[&R] = Cnt++; // Set of recipe types along with VPInstruction Opcodes of all EVL-related - // recipes that must appear at most once in Entry or Exiting blocks. + // recipes that must appear at most once in the header block. DenseSet<unsigned> EVLFound; + const VPRecipeBase *VPWidenMemRecipe = nullptr; const VPlan *Plan = VPBB->getPlan(); bool IsHeader = Plan && Plan->getEntry()->getNumSuccessors() == 1 && Plan->getVectorLoopRegion()->getEntry() == VPBB; @@ -110,23 +111,25 @@ static bool verifyVPBasicBlock(const VPBasicBlock *VPBB, } return true; } - auto *RInst = dyn_cast<VPInstruction>(R); - if (!RInst) - return true; - switch (RInst->getOpcode()) { - case VPInstruction::ExplicitVectorLength: + if (const auto *RInst = dyn_cast<VPInstruction>(R); + RInst && RInst->getOpcode() == VPInstruction::ExplicitVectorLength) { if (!IsHeader) { - errs() << "EVL instruction not in entry block!\n"; + errs() << "EVL instruction not in the header block!\n"; + return false; + } + if (!EVLFound.insert(RInst->getOpcode() + VPDef::VPLastPHISC).second) { + errs() << "EVL instruction inserted more than once!\n"; + return false; + } + if (VPWidenMemRecipe) { + errs() << "Use of EVL instruction by widen memory recipe before " + "definition!\n"; return false; } - break; - default: return true; } - if (!EVLFound.insert(RInst->getOpcode() + VPDef::VPLastPHISC).second) { - errs() << "EVL instruction inserted more than once!\n"; - return false; - } + if (isa<VPWidenMemoryInstructionRecipe>(R)) + VPWidenMemRecipe = R; return true; }; `````````` </details> https://github.com/llvm/llvm-project/pull/83854 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits