[llvm] r304490 - Move GVNHoist to the right position in the new pass manager pipeline.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 16:08:14 PDT 2017


Author: davide
Date: Thu Jun  1 18:08:14 2017
New Revision: 304490

URL: http://llvm.org/viewvc/llvm-project?rev=304490&view=rev
Log:
Move GVNHoist to the right position in the new pass manager pipeline.

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

Modified:
    llvm/trunk/lib/Passes/PassBuilder.cpp

Modified: llvm/trunk/lib/Passes/PassBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Passes/PassBuilder.cpp?rev=304490&r1=304489&r2=304490&view=diff
==============================================================================
--- llvm/trunk/lib/Passes/PassBuilder.cpp (original)
+++ llvm/trunk/lib/Passes/PassBuilder.cpp Thu Jun  1 18:08:14 2017
@@ -310,6 +310,10 @@ PassBuilder::buildFunctionSimplification
   // 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::buildModuleSimplificationPi
   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




More information about the llvm-commits mailing list