[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:38 PST 2024


================
@@ -895,6 +895,21 @@ bool llvm::setLoopEstimatedTripCount(Loop *L, unsigned EstimatedTripCount,
   return true;
 }
 
+bool llvm::isInfiniteTripCount(Loop *L) {
+  if (BranchInst *ExitingBranch = getExpectedExitLoopLatchBranch(L)) {
+    uint64_t LoopWeight, ExitWeight;
----------------
mtrofin wrote:

pet peeve: can you initialize the values? yes, they should be set by extractBranchWeights, but its implementation could, technically, decide at a point to leave an input unchanged, and uninitialized value bugs are not fun.

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


More information about the llvm-commits mailing list