[llvm] [LoopVectorize] Teach LoopVectorizationLegality about more early exits (PR #107004)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 13 08:50:07 PDT 2024


================
@@ -551,6 +588,17 @@ class LoopVectorizationLegality {
   /// (potentially) make a better decision on the maximum VF and enable
   /// the use of those function variants.
   bool VecCallVariantsFound = false;
+
+  /// Indicates whether this loop has a speculative early exit, i.e. an
+  /// uncountable exiting block that is not the latch.
+  bool HasSpeculativeEarlyExit = false;
+
+  /// Keep track of all the loop exiting blocks.
+  SmallVector<BasicBlock *, 4> CountableExitingBlocks;
+  SmallVector<BasicBlock *, 4> UncountableExitingBlocks;
+
+  /// Keep track of the destinations of all uncountable exits.
+  SmallVector<BasicBlock *, 4> UncountableExitBlocks;
----------------
david-arm wrote:

Yeah, these will be used in follow-on patches. However, if you prefer to keep this initial patch clean I can remove them and add them later. I was just trying to reduce the size of follow-on patches by moving it into this patch that's all.

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


More information about the llvm-commits mailing list