[PATCH] D19809: Move createReversePostOrderFunctionAttrsPass right after the inliner is done

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 09:14:52 PDT 2016


joker.eph created this revision.
joker.eph added reviewers: chandlerc, ashutosh.nema.
joker.eph added subscribers: bogner, llvm-commits.
Herald added a subscriber: joker.eph.

This is where it was originally, until LoopVersioningLICM was 
inserted before in r259986, I don't believe it was on purpose.

http://reviews.llvm.org/D19809

Files:
  lib/Transforms/IPO/PassManagerBuilder.cpp

Index: lib/Transforms/IPO/PassManagerBuilder.cpp
===================================================================
--- lib/Transforms/IPO/PassManagerBuilder.cpp
+++ lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -399,6 +399,14 @@
 
   addFunctionSimplificationPasses(MPM);
 
+  // FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
+  // pass manager that we are specifically trying to avoid. To prevent this
+  // we must insert a no-op module pass to reset the pass manager.
+  MPM.add(createBarrierNoopPass());
+
+  if (!DisableUnitAtATime)
+    MPM.add(createReversePostOrderFunctionAttrsPass());
+
   // If we are planning to perform ThinLTO later, let's not bloat the code with
   // unrolling/vectorization/... now. We'll first run the inliner + CGSCC passes
   // during ThinLTO and perform the rest of the optimizations afterward.
@@ -410,11 +418,6 @@
     return;
   }
 
-  // FIXME: This is a HACK! The inliner pass above implicitly creates a CGSCC
-  // pass manager that we are specifically trying to avoid. To prevent this
-  // we must insert a no-op module pass to reset the pass manager.
-  MPM.add(createBarrierNoopPass());
-
   // Scheduling LoopVersioningLICM when inlining is over, because after that
   // we may see more accurate aliasing. Reason to run this late is that too
   // early versioning may prevent further inlining due to increase of code
@@ -425,9 +428,6 @@
     MPM.add(createLICMPass());                  // Hoist loop invariants
   }
 
-  if (!DisableUnitAtATime)
-    MPM.add(createReversePostOrderFunctionAttrsPass());
-
   if (!DisableUnitAtATime && OptLevel > 1 && !PrepareForLTO)
     // Remove avail extern fns and globals definitions if we aren't
     // compiling an object file for later LTO. For LTO we want to preserve


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19809.55831.patch
Type: text/x-patch
Size: 1792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160502/291e6db6/attachment.bin>


More information about the llvm-commits mailing list