[llvm] [LoopVectorize] Perform loop versioning for some early exit loops (PR #120603)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 11 09:15:12 PST 2025
================
@@ -1585,6 +1591,22 @@ class LoopVectorizationCostModel {
ElementCount MaxSafeVF,
bool FoldTailByMasking);
+ bool isSafeForAnyVectorWidth() const {
+ return Legal->isSafeForAnyVectorWidth() &&
+ (!Legal->hasUncountableEarlyExit() ||
+ !Legal->getNumPotentiallyFaultingLoads());
+ }
----------------
paulwalker-arm wrote:
Given all the questions are answered by `LoopVectorizationLegality` why not just extend its implementation instead of adding a cost model specific implementation?
https://github.com/llvm/llvm-project/pull/120603
More information about the llvm-commits
mailing list