[llvm] [LV] Support strided load with a stride of -1 (PR #128718)

Mel Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 03:16:16 PDT 2025


================
@@ -2702,12 +2709,60 @@ struct VPWidenLoadEVLRecipe final : public VPWidenMemoryRecipe, public VPValue {
   bool onlyFirstLaneUsed(const VPValue *Op) const override {
     assert(is_contained(operands(), Op) &&
            "Op must be an operand of the recipe");
-    // Widened loads only demand the first lane of EVL and consecutive loads
-    // only demand the first lane of their address.
+    // Widened loads only demand the first lane of EVL and consecutive/strided
+    // loads only demand the first lane of their address.
     return Op == getEVL() || (Op == getAddr() && isConsecutive());
   }
 };
 
+/// A recipe for strided load operations, using the base address, stride, and an
+/// optional mask.
----------------
Mel-Chen wrote:

Yes, you are right. Strided load can represent consecutive access, just like gather can also represent consecutive access. It's just that we usually don't choose the one with worse performance.
Updated the comment briefly. a2400038164625b4a4e888efc97b0584b57781e3 


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


More information about the llvm-commits mailing list