OSDN Git Service

Move GVNHoist to the right position in the new pass manager pipeline.
authorDavide Italiano <davide@freebsd.org>
Thu, 1 Jun 2017 23:08:14 +0000 (23:08 +0000)
committerDavide Italiano <davide@freebsd.org>
Thu, 1 Jun 2017 23:08:14 +0000 (23:08 +0000)
GVNHoist was moved as part of simplification passes for the current
pass manager (but not for the new), so they're out-of-sync.

Differential Revision:  https://reviews.llvm.org/D33806

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304490 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Passes/PassBuilder.cpp

index eb81e58..17c6034 100644 (file)
@@ -310,6 +310,10 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
   // Catch trivial redundancies
   FPM.addPass(EarlyCSEPass());
 
+  // Hoisting of scalars and load expressions.
+  if (EnableGVNHoist)
+    FPM.addPass(GVNHoistPass());
+
   // Speculative execution if the target has divergent branches; otherwise nop.
   FPM.addPass(SpeculativeExecutionPass());
 
@@ -473,8 +477,6 @@ PassBuilder::buildModuleSimplificationPipeline(OptimizationLevel Level,
   EarlyFPM.addPass(SROA());
   EarlyFPM.addPass(EarlyCSEPass());
   EarlyFPM.addPass(LowerExpectIntrinsicPass());
-  if (EnableGVNHoist)
-    EarlyFPM.addPass(GVNHoistPass());
   MPM.addPass(createModuleToFunctionPassAdaptor(std::move(EarlyFPM)));
 
   // Interprocedural constant propagation now that basic cleanup has occured