[llvm] LoopVectorize: Set branch_weight for conditional branches (PR #72450)
David Li via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 16 13:42:14 PST 2023
================
@@ -396,6 +398,19 @@ static cl::opt<bool> UseWiderVFIfCallVariantsPresent(
cl::Hidden,
cl::desc("Try wider VFs if they enable the use of vector variants"));
+// Likelyhood of bypassing the vectorized loop because assumptions about SCEV
+// variables not overflowing do not hold. See `emitSCEVChecks`.
+static constexpr uint32_t SCEVCheckBypassWeights[] = {1, 127};
+// Likelyhood of bypassing the vectorized loop because pointers overlap. See
+// `emitMemRuntimeChecks`.
+static constexpr uint32_t MemCheckBypassWeights[] = {1, 127};
+// Likelyhood of bypassing the vectorized loop because there are zero trips left
+// after prolog. See `emitIterationCountCheck`.
+static constexpr uint32_t MinItersBypassWeights[] = {1, 127};
+// Likelyhood of bypassing the vectorized loop because of zero trips necessary.
+// See `emitMinimumVectorEpilogueIterCountCheck`.
+static constexpr uint32_t EpilogueMinItersBypassWeights[] = {1, 127};
----------------
david-xl wrote:
How are the default values selected? 127 seems too large as default e.g.for the epilogue minBy pass. The average trip count of the remainder loop is 0.5*mainUF*mainVF, how likely it is larger than EVF*EUF?
https://github.com/llvm/llvm-project/pull/72450
More information about the llvm-commits
mailing list