[llvm] [VPlan] Implement VPlan-based unit-strideness speculation (PR #182595)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 4 01:17:10 PDT 2026


================
@@ -5534,6 +5543,169 @@ void VPlanTransforms::makeMemOpWideningDecisions(VPlan &Plan, VFRange &Range,
                            });
 }
 
+void VPlanTransforms::multiversionForUnitStridedMemOps(
+    VPlan &Plan, VPCostContext &CostCtx, VFRange &Range,
+    SmallVectorImpl<VPInstruction *> &MemOps) {
+  ScalarEvolution *SE = CostCtx.PSE.getSE();
+  SCEVUnionPredicate StridePredicates({}, *SE);
+
+  for (VPInstruction *VPI : MemOps) {
+    auto *PtrOp = VPI->getOpcode() == Instruction::Load ? VPI->getOperand(0)
----------------
lukel97 wrote:

Nit
```suggestion
    VPValue *PtrOp = VPI->getOpcode() == Instruction::Load ? VPI->getOperand(0)
```

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


More information about the llvm-commits mailing list