[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
================
@@ -1337,7 +1337,23 @@ void VPlanTransforms::addActiveLaneMask(
/// %NextEVLIV = add IVSize (cast i32 %VPEVVL to IVSize), %EVLPhi
/// ...
///
-bool VPlanTransforms::tryAddExplicitVectorLength(VPlan &Plan) {
+/// If MaxEVLSafeElements is provided, the function adds the following recipes:
+/// vector.ph:
+/// ...
+///
+/// vector.body:
+/// ...
+/// %EVLPhi = EXPLICIT-VECTOR-LENGTH-BASED-IV-PHI [ %StartV, %vector.ph ],
+/// [ %NextEVLIV, %vector.body ]
+/// %cmp = cmp ult %EVLPhi, MaxEVLSafeElements
+/// %SAFE_AVL = select %cmp, %EVLPhi, MaxEVLSafeElements
+/// %VPEVL = EXPLICIT-VECTOR-LENGTH %SAFE_AVL, original TC
+/// ...
+/// %NextEVLIV = add IVSize (cast i32 %VPEVVL to IVSize), %EVLPhi
----------------
ayalz wrote:
```suggestion
/// %NextEVLIV = add IVSize (cast i32 %VPEVL to IVSize), %EVLPhi
```
https://github.com/llvm/llvm-project/pull/102897
More information about the llvm-commits
mailing list