[llvm] [LV][NFC] Factor out MinBWs of values from the cost model (PR #194492)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 08:03:25 PDT 2026


================
@@ -563,12 +563,12 @@ bool VFSelectionContext::runtimeChecksRequired() {
   return false;
 }
 
+void VFSelectionContext::computeMinimalBitwidths() {
+  MinBWs = computeMinimumValueSizes(TheLoop->getBlocks(), *DB, &TTI);
+}
+
 const MapVector<Instruction *, uint64_t> &
-VFSelectionContext::getMinimalBitwidths() {
-  if (!MinBWsComputed) {
-    MinBWs = computeMinimumValueSizes(TheLoop->getBlocks(), *DB, &TTI);
-    MinBWsComputed = true;
-  }
+VFSelectionContext::getMinimalBitwidths() const {
----------------
david-arm wrote:

nit: Can this live in LoopVectorizationPlanner.h?

https://github.com/llvm/llvm-project/pull/194492


More information about the llvm-commits mailing list