Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LV] Disable Scalable VFs when tail folding is enabled b/c of low tri…
…pcount. The loop vectorizer may decide to use tail folding when the trip-count is low. When that happens, scalable VFs are no longer a candidate, since tail folding/predication is not yet supported for scalable vectors. This can be re-enabled in a future patch. Reviewed By: kmclaughlin Differential Revision: https://reviews.llvm.org/D106657
- Loading branch information
1 parent
dc72106
commit d7dd12a
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
llvm/test/Transforms/LoopVectorize/AArch64/sve-tail-folding.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
; RUN: opt -S -loop-vectorize -scalable-vectorization=preferred -prefer-predicate-over-epilogue=predicate-dont-vectorize < %s | FileCheck %s | ||
|
||
; CHECK-NOT: vector.body: | ||
|
||
target triple = "aarch64-unknown-linux-gnu" | ||
|
||
define void @tail_predication(i32 %init, i32* %ptr, i32 %val) #0 { | ||
entry: | ||
br label %while.body | ||
|
||
while.body: ; preds = %while.body, %entry | ||
%index = phi i32 [ %index.dec, %while.body ], [ %init, %entry ] | ||
%gep = getelementptr i32, i32* %ptr, i32 %index | ||
store i32 %val, i32* %gep | ||
%index.dec = add nsw i32 %index, -1 | ||
%cmp10 = icmp sgt i32 %index, 0 | ||
br i1 %cmp10, label %while.body, label %while.end.loopexit | ||
|
||
while.end.loopexit: ; preds = %while.body | ||
ret void | ||
} | ||
|
||
attributes #0 = { "target-features"="+sve" } |