[PATCH] [LoopReroll] Run LICM before Loop Rerolling.

James Molloy james.molloy at arm.com
Mon Feb 16 09:08:42 PST 2015


Hi hfinkel,

Loop rerolling bails out if any value is not used by any iteration. Make sure all invariant values are hoisted first.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7674

Files:
  lib/Transforms/IPO/PassManagerBuilder.cpp

Index: lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- lib/Transforms/IPO/PassManagerBuilder.cpp
+++ lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -262,8 +262,12 @@
 
   addExtensionsToPM(EP_ScalarOptimizerLate, MPM);
 
-  if (RerollLoops)
+  if (RerollLoops) {
+    // Run LICM before loop rerolling, as rerolling cannot handle any
+    // loop-invariant values at all.
+    MPM.add(createLICMPass());
     MPM.add(createLoopRerollPass());
+  }
   if (!RunSLPAfterLoopVectorization) {
     if (SLPVectorize)
       MPM.add(createSLPVectorizerPass());   // Vectorize parallel scalar chains.

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7674.20037.patch
Type: text/x-patch
Size: 656 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150216/9cb899dd/attachment.bin>


More information about the llvm-commits mailing list