[llvm] [VPlan] Make widen-gather-scatter decision in VPlan (PR #215862)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 04:02:30 PDT 2026


================
@@ -5502,10 +5504,20 @@ void VPlanTransforms::makeMemOpWideningDecisions(VPlan &Plan, VFRange &Range,
                                 IsLoad, ScalarTy, getLoadStoreAlignment(I),
                                 getLoadStoreAddressSpace(I)))
           return false;
+        if (!Consecutive && !LoopVectorizationPlanner::getDecisionAndClampRange(
+                                [&](ElementCount VF) {
+                                  return CostCtx.willGatherScatter(I, VF) &&
+                                         CostCtx.Config.isLegalGatherOrScatter(
+                                             IsLoad, ScalarTy,
+                                             getLoadStoreAlignment(I), VF);
+                                },
+                                Range))
+          return false;
----------------
artagnon wrote:

Yep, this is unfortunately the best first step that I could come up with, as both gather-scatters and interleaves need to be costed, and the costs need to be compared to make a decision? We could build on this in follow ups? Not sure?

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


More information about the llvm-commits mailing list