[llvm] [AArch64] Cap upper-bound unrolling of loops with uncomputable trip counts (PR #205102)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 19 13:47:08 PDT 2026


================
@@ -5709,6 +5709,23 @@ void AArch64TTIImpl::getUnrollingPreferences(
 
   UP.UpperBound = true;
 
+  // A loop can have a known small maximum trip count while SCEV still cannot
+  // form an exact backedge count (getBackedgeTakenCount stays
+  // SCEVCouldNotCompute) - typically a data-dependent exit, e.g. shifting a
----------------
fhahn wrote:

nit: probably fine to skip SCEV implementation details, as the comment is already quite long. May be good to trim other parts as well

```suggestion
  // form an exact backedge count - typically a data-dependent exit, e.g. shifting a
```

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


More information about the llvm-commits mailing list