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

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 10:33:09 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;
----------------
paulwalker-arm wrote:

Of the three only `UncountableExitingBlocks` looks to be used by this patch.  I'd just like confirmation this it intentional and will be built upon in a following PR.

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


More information about the llvm-commits mailing list