[llvm] [LoopVectorize] Improve Vectorization of Small Loops (PR #195823)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue May 5 03:58:33 PDT 2026
================
@@ -3023,9 +3033,37 @@ LoopVectorizationCostModel::computeMaxVF(ElementCount UserVF, unsigned UserIC) {
NoScalarEpilogueNeeded(MaxFactors.FixedVF.getFixedValue())) {
LLVM_DEBUG(dbgs() << "LV: Picking a fixed-width so that no tail will "
"remain for any chosen VF.\n");
- MaxFactors.ScalableVF = ElementCount::getScalable(0);
+ ApplyVectorWidth(MaxFactors, MaxFactors.FixedVF.getFixedValue(), 0);
----------------
david-arm wrote:
nit: I'm not sure there is much value in this change to be honest, since it's now doing more work than before setting the fixed width VF unnecessarily. It's also inconsistent with the other places in this function that change the factors similarly, e.g.
```
MaxFactors.FixedVF = ElementCount::getFixed(1);
```
on line 3094 below. At the very least, we should use a consistent style throughout the function.
https://github.com/llvm/llvm-project/pull/195823
More information about the llvm-commits
mailing list