[PATCH] Reimplement heuristic for estimating complete-unroll optimization effects.

Michael Zolotukhin mzolotukhin at apple.com
Mon Feb 23 20:29:01 PST 2015


================
Comment at: lib/Transforms/Scalar/LoopUnrollPass.cpp:546-551
@@ -450,1 +545,8 @@
+
+      // If we found no optimization opportunities on the first iteration, we
+      // won't find them on later ones too.
+      if (!NumberOfOptimizedInstructions) {
+        UnrolledLoopSize = UINT_MAX;
+        return;
+      }
     }
----------------
mzolotukhin wrote:
> chandlerc wrote:
> > Handle this before we process the terminators?
> Makes sense.
Actually, we can't do this before processing the terminators.

It's possible that we find nothing in one block, but find a lot in others - that means we should only perform this check when all blocks are processed, i.e. at the end of an iteration processing.

http://reviews.llvm.org/D7837

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list