[llvm] [LoopUnroll] Allow expensive trip count emitting which is estimated to be infinite (PR #79869)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 08:41:40 PST 2024


================
@@ -330,6 +330,10 @@ getLoopEstimatedTripCount(Loop *L,
 bool setLoopEstimatedTripCount(Loop *L, unsigned EstimatedTripCount,
                                unsigned EstimatedLoopInvocationWeight);
 
+// Return true if loop's estimated trip count based on branch weight metadata is
+// infinite, i.e. weight ratio is X:0.
+bool isInfiniteTripCount(Loop *L);
----------------
mtrofin wrote:

`const Loop& L`. `const` because you shouldn't need to mutate `L`, pass-by-reference to signal `nullptr` isn't something we expect handling.

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


More information about the llvm-commits mailing list