[llvm] [LV] Emit better debug and opt-report messages when vectorization is disallowed in the LoopVectorizer (PR #158513)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 14:37:22 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
index 296ec3ea7..9862d5cc5 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp
@@ -183,7 +183,7 @@ bool LoopVectorizeHints::allowVectorization(
     Function *F, Loop *L, bool VectorizeOnlyWhenForced) const {
   if (getForce() == LoopVectorizeHints::FK_Disabled) {
     if (Force.Value == LoopVectorizeHints::FK_Disabled) {
-    LLVM_DEBUG(dbgs() << "LV: Not vectorizing: #pragma vectorize disable.\n");
+      LLVM_DEBUG(dbgs() << "LV: Not vectorizing: #pragma vectorize disable.\n");
       ORE.emit(
           OptimizationRemarkMissed(LV_NAME, "MissedExplicitlyDisabled",
                                    TheLoop->getStartLoc(), TheLoop->getHeader())
@@ -197,8 +197,9 @@ bool LoopVectorizeHints::allowVectorization(
                    << "loop not vectorized: loop transformations are disabled";)
     } else {
       // This should be unreachable unless there is a bug.
-      LLVM_DEBUG(dbgs() << "LV: [FIXME] Not vectorizing: loop vect disabled for "
-                           "an unknown reason!\n");
+      LLVM_DEBUG(
+          dbgs() << "LV: [FIXME] Not vectorizing: loop vect disabled for "
+                    "an unknown reason!\n");
       ORE.emit(OptimizationRemarkMissed(LV_NAME, "MissedUnknown",
                                         TheLoop->getStartLoc(),
                                         TheLoop->getHeader())

``````````

</details>


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


More information about the llvm-commits mailing list