[llvm] r268252 - Move createReversePostOrderFunctionAttrsPass right after the inliner is done

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Mon May 2 09:53:16 PDT 2016


Author: mehdi_amini
Date: Mon May  2 11:53:16 2016
New Revision: 268252

URL: http://llvm.org/viewvc/llvm-project?rev=268252&view=rev
Log:
Move createReversePostOrderFunctionAttrsPass right after the inliner is done

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

Differential Revision: http://reviews.llvm.org/D19809

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
    llvm/trunk/test/Other/pass-pipelines.ll

Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=268252&r1=268251&r2=268252&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Mon May  2 11:53:16 2016
@@ -399,6 +399,14 @@ void PassManagerBuilder::populateModuleP
 
   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 @@ void PassManagerBuilder::populateModuleP
     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 @@ void PassManagerBuilder::populateModuleP
     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

Modified: llvm/trunk/test/Other/pass-pipelines.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/pass-pipelines.ll?rev=268252&r1=268251&r2=268252&view=diff
==============================================================================
--- llvm/trunk/test/Other/pass-pipelines.ll (original)
+++ llvm/trunk/test/Other/pass-pipelines.ll Mon May  2 11:53:16 2016
@@ -55,6 +55,9 @@
 ; Next we break out of the main Function passes inside the CGSCC pipeline with
 ; a barrier pass.
 ; CHECK-O2: A No-Op Barrier Pass
+; Inferring function attribute should be immediately after the CGSCC pipeline.
+; CHECK-O2-NEXT: CallGraph
+; CHECK-O2-NEXT: Deduce function attributes in RPO
 ; CHECK-O2-NOT: Manager
 ; Next is the late function pass pipeline.
 ; CHECK-O2: FunctionPass Manager




More information about the llvm-commits mailing list