[clang] [llvm] [LV][NFC] Rename PreferPredicateOverEpilogue to PreferTailFolding (PR #191803)

Luke Lau via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 16 05:28:57 PDT 2026


================
@@ -205,36 +205,26 @@ static cl::opt<bool> ForceTargetSupportsMaskedMemoryOps(
     cl::desc("Assume the target supports masked memory operations (used for "
              "testing)."));
 
-// Option prefer-predicate-over-epilogue indicates that an epilogue is undesired,
-// that predication is preferred, and this lists all options. I.e., the
-// vectorizer will try to fold the tail-loop (epilogue) into the vector body
-// and predicate the instructions accordingly. If tail-folding fails, there are
-// different fallback strategies depending on these values:
-namespace PreferPredicateTy {
-  enum Option {
-    ScalarEpilogue = 0,
-    PredicateElseScalarEpilogue,
-    PredicateOrDontVectorize
-  };
-} // namespace PreferPredicateTy
-
-static cl::opt<PreferPredicateTy::Option> PreferPredicateOverEpilogue(
-    "prefer-predicate-over-epilogue",
-    cl::init(PreferPredicateTy::ScalarEpilogue),
-    cl::Hidden,
-    cl::desc("Tail-folding and predication preferences over creating a scalar "
-             "epilogue loop."),
-    cl::values(clEnumValN(PreferPredicateTy::ScalarEpilogue,
-                         "scalar-epilogue",
-                         "Don't tail-predicate loops, create scalar epilogue"),
-              clEnumValN(PreferPredicateTy::PredicateElseScalarEpilogue,
-                         "predicate-else-scalar-epilogue",
-                         "prefer tail-folding, create scalar epilogue if tail "
-                         "folding fails."),
-              clEnumValN(PreferPredicateTy::PredicateOrDontVectorize,
-                         "predicate-dont-vectorize",
-                         "prefers tail-folding, don't attempt vectorization if "
-                         "tail-folding fails.")));
+// Option tail-folding-policy indicates that an epilogue is undesired, that
+// tail folding is preferred, and this lists all options. I.e., the vectorizer
+// will try to fold the tail-loop (epilogue) into the vector body and predicate
+// the instructions accordingly. If tail-folding fails, there are different
+// fallback strategies depending on these values:
+namespace TailFoldingPolicyTy {
+enum Option { None = 0, PreferFoldTail, MustFoldTail };
+} // namespace TailFoldingPolicyTy
+
+static cl::opt<TailFoldingPolicyTy::Option> TailFoldingPolicy(
+    "tail-folding-policy", cl::init(TailFoldingPolicyTy::None), cl::Hidden,
+    cl::desc("Tail-folding preferences over creating an epilogue loop."),
+    cl::values(
+        clEnumValN(TailFoldingPolicyTy::None, "none", "Don't tail-fold loops."),
----------------
lukel97 wrote:

My slight preference would be something like `dont-fold-tail`, since `none` seems to imply that there is no policy at all

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


More information about the cfe-commits mailing list