[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


================
@@ -0,0 +1,103 @@
+//===----------- VectorizeUtils.h - Utilities for LoopVectorize -----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// This file provides declaration for utilities functions that are used by the
+/// LoopVectorize and its related files. Those utilities don't depend on any
+/// state.
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_VECTORIZE_LOOPVECTORIZATIONUTILS_H
+#define LLVM_TRANSFORMS_VECTORIZE_LOOPVECTORIZATIONUTILS_H
+
+#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Analysis/OptimizationRemarkEmitter.h"
+#include "llvm/Analysis/ScalarEvolution.h"
+#include "llvm/Support/Compiler.h"
+
+namespace llvm {
+namespace LoopVectorizationUtils {
+
+// Loop vectorization hints how the epilogue/tail loop should be
+// lowered.
+enum EpilogueLowering {
----------------
david-arm wrote:

Perhaps this change is best left for a different PR where it's more obvious why it's needed? It leads to a lot of extra code changes in LoopVectorize.cpp too.

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


More information about the llvm-commits mailing list