[llvm] [LV]Initial support for safe distance in predicated DataWithEVL vectorization mode. (PR #102897)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 16:08:22 PDT 2024


================
@@ -1243,6 +1243,11 @@ class VPInstruction : public VPRecipeWithIRFlags {
     SLPLoad,
     SLPStore,
     ActiveLaneMask,
+    /// Creates special scalar explicit-vector-length instruction, which
+    /// calculates the vectorization factor (number of iterations, that can be
+    /// executed simultaneously) at runtime.
+    /// Has two mandatory parameters - EVL (effective vector length) on the
+    /// previous iteration and original trip count.
----------------
ayalz wrote:

```suggestion
    /// Has two mandatory parameters - the sum of effective vector lengths across all
    /// previous iterations and original trip count.
```
best push this documentation of existing behavior independent of this patch. How safe distance is taken into account could then follow.

(Also independent of this patch:) Better if this VPInstruction accepts a single operand - number of remaining iterations - which could be counted-down from original trip count, instead of counting up and emitting a subtract?
Easier to then accommodate max safe distance - the operand becomes "the maximum number of remaining iterations that can be processed together as a vector".

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


More information about the llvm-commits mailing list