[llvm] [LV, VP]VP intrinsics support for the Loop Vectorizer + adding new tail-folding mode using EVL. (PR #76172)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 12:42:19 PST 2024


================
@@ -242,6 +242,12 @@ struct VPTransformState {
   ElementCount VF;
   unsigned UF;
 
+  /// If EVL is not nullptr, then EVL must be a valid value set during plan
+  /// transformation, possibly a default value = whole vector register length.
+  /// EVL is created only if TTI prefers predicated vectorization, thus if EVL
+  /// is not nullptr it also implies preference for predicated vectorization.
+  VPValue *EVL = nullptr;
----------------
fhahn wrote:

The canonical IV is implicitly associated with its loop region, by its guaranteed placement as first recipe in the header (dominates all recipes in the region).  What makes this tricker for EVL is that the EVL VPInstruction is placed after the phis, so does not necessarily dominate all recipes.

Once the memory recipes have been split up, this likely can be removed, so might also be good to leave a corresponding TODO here in the meantime?

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


More information about the llvm-commits mailing list