[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 01:18:12 PST 2025


================
@@ -1776,6 +1776,10 @@ class TargetTransformInfo {
   /// otherwise scalar epilogue loop.
   bool preferEpilogueVectorization() const;
 
+  /// Return true if the loop vectorizer prefer strided load/store when
+  /// vectorizing reversed load/store.
+  bool preferStridedLoadStore() const;
----------------
lukel97 wrote:

For the sake of not having unused code in-tree, I'm not sure if it's worthwhile emitting `@llvm.experimental.vp.reverse` if no current target is going to use it.

It sounds reasonable to me if this patch changes the recipe to only emit `@llvm.experimental.vp.strided.{load,store}`.

If other targets want to use EVL tail folding and don't support `@llvm.experimental.vp.strided.{load,store}`, we can handle that in a subsequent patch by expanding it later to a vp.load + vp.reverse or vp.gather in ExpandVectorPredication.cpp.

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


More information about the llvm-commits mailing list