[llvm] WIP:[LV] Support strided memory accesses with a stride of -1 (PR #128718)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 08:57:44 PST 2025


================
@@ -2561,10 +2563,15 @@ InstructionCost VPWidenMemoryRecipe::computeCost(ElementCount VF,
     const Value *Ptr = getLoadStorePointerOperand(&Ingredient);
     assert(!Reverse &&
            "Inconsecutive memory access should not have the order.");
-    return Ctx.TTI.getAddressComputationCost(Ty) +
-           Ctx.TTI.getGatherScatterOpCost(Ingredient.getOpcode(), Ty, Ptr,
-                                          IsMasked, Alignment, Ctx.CostKind,
-                                          &Ingredient);
+    if (Strided)
+      return Ctx.TTI.getStridedMemoryOpCost(Ingredient.getOpcode(), Ty, Ptr,
+                                            IsMasked, Alignment, Ctx.CostKind,
+                                            &Ingredient);
+    else
----------------
alexey-bataev wrote:

```suggestion
```


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


More information about the llvm-commits mailing list