[llvm] [LV][NFC] Introduce LoopVectorizationUtils for shared utility functions (PR #194951)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 03:29:37 PDT 2026


================
@@ -1693,14 +1725,15 @@ bool LoopVectorizationLegality::canVectorizeLoopNestCFG(
 bool LoopVectorizationLegality::isVectorizableEarlyExitLoop() {
   BasicBlock *LatchBB = TheLoop->getLoopLatch();
   if (!LatchBB) {
-    reportVectorizationFailure("Loop does not have a latch",
-                               "Cannot vectorize early exit loop",
-                               "NoLatchEarlyExit", ORE, TheLoop);
+    LoopVectorizationUtils::reportVectorizationFailure(
+        Hints->vectorizeAnalysisPassName(), "Loop does not have a latch",
----------------
david-arm wrote:

It feels a shame that we know have to pass in `Hints->vectorizeAnalysisPassName()` - it adds a fair amount of extra code. Is it not possible for `reportVectorizationFailure` to figure this out? You could also just pass in `Hints` and that would reduce the duplication a bit.

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


More information about the llvm-commits mailing list