[llvm] [VPlan] Model first memory runtime checks as VPlan recipes. (PR #221483)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 14:07:26 PDT 2026


================
@@ -6975,7 +7016,8 @@ void LoopVectorizationPlanner::addReductionResultComputation(
 }
 
 void LoopVectorizationPlanner::attachRuntimeChecks(
-    VPlan &Plan, GeneratedRTChecks &RTChecks, bool HasBranchWeights) const {
+    VPlan &Plan, GeneratedRTChecks &RTChecks, bool HasBranchWeights,
+    bool UseVPlanMemChecks) const {
----------------
fhahn wrote:

I re-organized the code a bit: now most of the logic is consolidated in `LoopVectorizationPlanner::attachRuntimeChecks`: we either create the VPlan checks or attach the existing IR check blocks.

I tried to to have a single `attachCheckBlock` but overall it eneded up simpler to just do it separately in `addMemoryRuntimeChecks` instead of return a pair. The check block is now removed directly when creating the VPlan based expansion. WDYT?

https://github.com/llvm/llvm-project/pull/221483


More information about the llvm-commits mailing list