[llvm] [LoopVectorize][NFC] Move "LV: Selecting VF" debug output (PR #120744)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 20 07:19:20 PST 2024


https://github.com/david-arm created https://github.com/llvm/llvm-project/pull/120744

Move the debug output that prints out the selected VF from selectVectorizationFactor -> computeBestVF. This means that the output will still be written even after removing the assert for the legacy and vplan cost models matching.

>From ef634d42651264e56392959b154b4dffa0823bef Mon Sep 17 00:00:00 2001
From: David Sherwood <david.sherwood at arm.com>
Date: Fri, 20 Dec 2024 15:17:11 +0000
Subject: [PATCH] [LoopVectorize][NFC] Move "LV: Selecting VF" debug output

Move the debug output that prints out the selected VF from
selectVectorizationFactor -> computeBestVF. This means that
the output will still be written even after removing the
assert for the legacy and vplan cost models matching.
---
 llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index a8511483e00fbe..020067fc43837d 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -4769,7 +4769,6 @@ VectorizationFactor LoopVectorizationPlanner::selectVectorizationFactor() {
                  !isMoreProfitable(ChosenFactor, ScalarCost)) dbgs()
              << "LV: Vectorization seems to be not beneficial, "
              << "but was forced by a user.\n");
-  LLVM_DEBUG(dbgs() << "LV: Selecting VF: " << ChosenFactor.Width << ".\n");
   return ChosenFactor;
 }
 #endif
@@ -7698,6 +7697,7 @@ VectorizationFactor LoopVectorizationPlanner::computeBestVF() {
          "when vectorizing, the scalar cost must be computed.");
 #endif
 
+  LLVM_DEBUG(dbgs() << "LV: Selecting VF: " << BestFactor.Width << ".\n");
   return BestFactor;
 }
 



More information about the llvm-commits mailing list