1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[LV] Disable epilogue vectorization for scalable VFs

Epilogue vectorization doesn't support scalable vectorization factors
yet, disable it for now.

Reviewed By: sdesmalen, bmahjour

Differential Revision: https://reviews.llvm.org/D93063
This commit is contained in:
Cullen Rhodes 2020-12-09 13:18:22 +00:00
parent 058127650f
commit 2b9814f6d5
2 changed files with 33 additions and 0 deletions

View File

@ -5784,6 +5784,15 @@ LoopVectorizationCostModel::selectEpilogueVectorizationFactor(
return Result;
}
// FIXME: This can be fixed for scalable vectors later, because at this stage
// the LoopVectorizer will only consider vectorizing a loop with scalable
// vectors when the loop has a hint to enable vectorization for a given VF.
if (MainLoopVF.isScalable()) {
LLVM_DEBUG(dbgs() << "LEV: Epilogue vectorization for scalable vectors not "
"yet supported.\n");
return Result;
}
// Not really a cost consideration, but check for unsupported cases here to
// simplify the logic.
if (!isCandidateForEpilogueVectorization(*TheLoop, MainLoopVF)) {

View File

@ -99,3 +99,27 @@ for.end.loopexit: ; preds = %for.body
for.end: ; preds = %for.end.loopexit, %entry
ret void
}
; Currently we cannot handle scalable vectorization factors.
; CHECK: LV: Checking a loop in "f4"
; CHECK: LEV: Epilogue vectorization for scalable vectors not yet supported.
define void @f4(i8* %A) {
entry:
br label %for.body
for.body:
%iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
%arrayidx = getelementptr inbounds i8, i8* %A, i64 %iv
store i8 1, i8* %arrayidx, align 1
%iv.next = add nuw nsw i64 %iv, 1
%exitcond = icmp ne i64 %iv.next, 1024
br i1 %exitcond, label %for.body, label %exit, !llvm.loop !0
exit:
ret void
}
!0 = !{!0, !1, !2}
!1 = !{!"llvm.loop.vectorize.width", i32 4}
!2 = !{!"llvm.loop.vectorize.scalable.enable", i1 true}