[llvm] [AArch64] Enable unrolling for small multi-exit loops (PR #131998)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 01:12:16 PDT 2025


================
@@ -4687,6 +4746,16 @@ void AArch64TTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
   // Disable partial & runtime unrolling on -Os.
   UP.PartialOptSizeThreshold = 0;
 
+  // Scan the loop: don't unroll loops with calls as this could prevent
+  // inlining. Don't unroll vector loops either, as they don't benefit much from
+  // unrolling.
+  for (auto *BB : L->getBlocks()) {
+    for (auto &I : *BB) {
+      if (!shouldUnrollLoopWithInstruction(I, *this))
----------------
david-arm wrote:

Done!

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


More information about the llvm-commits mailing list