[llvm] [LV] Repalce dead invalidateCostModelingDecisions with assert (NFC) (PR #190837)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 7 12:59:04 PDT 2026
https://github.com/fhahn created https://github.com/llvm/llvm-project/pull/190837
Replace dead invalidateCostModelingDecisions with assertion that no decisions have been taken yet.
>From 45afc75df5112d522b24fe8e4be898283e883b24 Mon Sep 17 00:00:00 2001
From: Florian Hahn <flo at fhahn.com>
Date: Fri, 3 Apr 2026 17:31:07 +0100
Subject: [PATCH] [LV] Repalce dead invalidateCostModelingDecisions with assert
(NFC)
Replace dead invalidateCostModelingDecisions with assertion that no
decisions have been taken yet.
---
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index e907b5621b817..adf28024df467 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -3796,12 +3796,10 @@ ElementCount LoopVectorizationCostModel::getMaximizedVFForTarget(
MaxVF =
clampVFByMaxTripCount(MaxVF, MaxTripCount, UserIC, FoldTailByMasking);
- if (MaxVectorElementCount != MaxVF) {
- // Invalidate any widening decisions we might have made, in case the loop
- // requires prediction (decided later), but we have already made some
- // load/store widening decisions.
- invalidateCostModelingDecisions();
- }
+ assert(MaxVectorElementCount == MaxVF ||
+ (WideningDecisions.empty() && CallWideningDecisions.empty() &&
+ Uniforms.empty() && Scalars.empty()) &&
+ "No decisions should have been taken at this point");
}
return MaxVF;
}
More information about the llvm-commits
mailing list