[llvm] [VPlan] Connect (MemRuntime|SCEV)Check blocks as VPlan transform (NFC). (PR #143879)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 27 02:46:42 PDT 2025
================
@@ -9331,6 +9241,47 @@ void LoopVectorizationPlanner::adjustRecipesForReductions(
VPlanTransforms::runPass(VPlanTransforms::clearReductionWrapFlags, *Plan);
}
+void LoopVectorizationPlanner::addRuntimeChecks(
+ VPlan &Plan, GeneratedRTChecks &RTChecks) const {
+ SmallVector<std::pair<VPValue *, VPIRBasicBlock *>> Checks;
+ const auto &[SCEVCheckCond, SCEVCheckBlock] = RTChecks.emitSCEVChecks();
+ if (SCEVCheckBlock) {
+ assert((!CM.OptForSize ||
+ CM.Hints->getForce() == LoopVectorizeHints::FK_Enabled) &&
+ "Cannot SCEV check stride or overflow when optimizing for size");
+ Checks.emplace_back(Plan.getOrAddLiveIn(SCEVCheckCond),
+ Plan.createVPIRBasicBlock(SCEVCheckBlock));
+ }
+ const auto &[MemCheckCond, MemCheckBlock] = RTChecks.emitMemRuntimeChecks();
+ if (MemCheckBlock) {
+ // VPlan-native path does not do any analysis for runtime checks
+ // currently.
+ assert((!EnableVPlanNativePath || OrigLoop->begin() == OrigLoop->end()) &&
----------------
fhahn wrote:
Done thanks
https://github.com/llvm/llvm-project/pull/143879
More information about the llvm-commits
mailing list