summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-05-02 16:53:16 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-05-02 16:53:16 +0000
commit45c7b3ecb574c84a559b6d00983dd19ec5041bc3 (patch)
tree312041b387bc9f7b68e86b9d5ba3b1037b6389c7
parentd02872c7b47e70f571ee395e715e776d0e638423 (diff)
downloadbcm5719-llvm-45c7b3ecb574c84a559b6d00983dd19ec5041bc3.tar.gz
bcm5719-llvm-45c7b3ecb574c84a559b6d00983dd19ec5041bc3.zip
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@apple.com> llvm-svn: 268252
-rw-r--r--llvm/lib/Transforms/IPO/PassManagerBuilder.cpp16
-rw-r--r--llvm/test/Other/pass-pipelines.ll3
2 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index b4af849baf3..71ec8aeafa2 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -399,6 +399,14 @@ void PassManagerBuilder::populateModulePassManager(
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::populateModulePassManager(
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::populateModulePassManager(
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
diff --git a/llvm/test/Other/pass-pipelines.ll b/llvm/test/Other/pass-pipelines.ll
index 778376a7d39..5e3e38ef1d9 100644
--- a/llvm/test/Other/pass-pipelines.ll
+++ b/llvm/test/Other/pass-pipelines.ll
@@ -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
OpenPOWER on IntegriCloud