[llvm] [LoopVectorizer] Prune VFs based on plan register pressure (PR #132190)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 14 13:35:37 PDT 2025
================
@@ -7777,6 +7565,18 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
InstructionCost Cost = cost(*P, VF);
VectorizationFactor CurrentFactor(VF, Cost, ScalarCost);
+
+ // Make sure that the VF doesn't use more than the number of available
+ // registers
+ const auto &MLU = RU.MaxLocalUsers;
+ if (any_of(MLU, [&](decltype(MLU.front()) &LU) {
----------------
fhahn wrote:
```suggestion
if (any_of(MLU, [&](auto &LU) {
```
simpler to just use `auto`?
https://github.com/llvm/llvm-project/pull/132190
More information about the llvm-commits
mailing list