[llvm] [LV] Fix MVE regression from #132190 (PR #141736)
Nicholas Guy via llvm-commits
llvm-commits at lists.llvm.org
Wed May 28 07:47:23 PDT 2025
================
@@ -7458,7 +7470,10 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
InstructionCost Cost = cost(*P, VF);
VectorizationFactor CurrentFactor(VF, Cost, ScalarCost);
- if (RU.exceedsMaxNumRegs(TTI)) {
+ if (CM.useMaxBandwidth(VF.isScalable()
+ ? TargetTransformInfo::RGK_ScalableVector
+ : TargetTransformInfo::RGK_FixedWidthVector) &&
+ RU.exceedsMaxNumRegs(TTI)) {
----------------
NickGuy-Arm wrote:
Could you explain this logic briefly? Maybe I'm misunderstanding the goal here, but if we exceed the number of registers but don't have maxBandwidth enabled, then we'd try to vectorize anyway? Does the call to `CM.useMaxBandwidth` want to be negated?
In other words; Why are we only considering whether we exceed the number of registers when maxBandwidth is enabled?
https://github.com/llvm/llvm-project/pull/141736
More information about the llvm-commits
mailing list