[llvm] [LV][EVL] Generate negative strided load/store for reversed load/store (PR #123608)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 03:26:41 PST 2025


================
@@ -7433,6 +7433,12 @@ static bool planContainsAdditionalSimplifications(VPlan &Plan,
       // comparing against the legacy cost isn't desirable.
       if (isa<VPPartialReductionRecipe>(&R))
         return true;
+
+      // The VPlan-based cost model may calculate the cost of strided load/store
+      // which can't be modeled in the legacy cost model.
+      if (isa<VPWidenLoadEVLRecipe>(&R) || isa<VPWidenLoadEVLRecipe>(&R))
----------------
lukel97 wrote:

Should this be

```suggestion
      if (isa<VPWidenLoadEVLRecipe>(&R) || isa<VPWidenStoreEVLRecipe>(&R))
```

We could probably also restrict this to `R.isReverse()` too

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


More information about the llvm-commits mailing list