[llvm] [LV][NFC]Preselect folding style before choosing maxing VF, NFC. (PR #81885)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 14:24:38 PST 2024


================
@@ -1509,15 +1509,25 @@ class LoopVectorizationCostModel {
   }
 
   /// Returns the TailFoldingStyle that is best for the current loop.
-  TailFoldingStyle
-  getTailFoldingStyle(bool IVUpdateMayOverflow = true) const {
-    if (!CanFoldTailByMasking)
-      return TailFoldingStyle::None;
+  TailFoldingStyle getTailFoldingStyle(bool IVUpdateMayOverflow = true) const {
+    return IVUpdateMayOverflow ? ChosenTailFoldingStyle.first
+                               : ChosenTailFoldingStyle.second;
+  }
+
+  void selectTailFoldinStyle() {
----------------
fhahn wrote:

could you add some documentation here?

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


More information about the llvm-commits mailing list