[llvm-branch-commits] [llvm] a03ffa9 - [NewPM] Fix placement of LoopFlatten

Arthur Eubanks via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 14 09:54:38 PST 2021


Author: Arthur Eubanks
Date: 2021-01-14T09:49:31-08:00
New Revision: a03ffa98503bb6d5a990e61df060ed480c3e3f3b

URL: https://github.com/llvm/llvm-project/commit/a03ffa98503bb6d5a990e61df060ed480c3e3f3b
DIFF: https://github.com/llvm/llvm-project/commit/a03ffa98503bb6d5a990e61df060ed480c3e3f3b.diff

LOG: [NewPM] Fix placement of LoopFlatten

https://reviews.llvm.org/D90402 was inconsistent with where it put
LoopFlatten between the two pass managers. It also missed adding it to
the non-O1 function simplification pipeline.

PR48738

Reviewed By: SjoerdMeijer

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

Added: 
    

Modified: 
    llvm/lib/Passes/PassBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp
index d5c0c47bd9a6..7f3f132ab82b 100644
--- a/llvm/lib/Passes/PassBuilder.cpp
+++ b/llvm/lib/Passes/PassBuilder.cpp
@@ -562,8 +562,6 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
   LPM1.addPass(LICMPass(PTO.LicmMssaOptCap, PTO.LicmMssaNoAccForPromotionCap));
   LPM1.addPass(SimpleLoopUnswitchPass());
 
-  if (EnableLoopFlatten)
-    FPM.addPass(LoopFlattenPass());
   LPM2.addPass(LoopIdiomRecognizePass());
   LPM2.addPass(IndVarSimplifyPass());
 
@@ -594,6 +592,8 @@ PassBuilder::buildO1FunctionSimplificationPipeline(OptimizationLevel Level,
       DebugLogging));
   FPM.addPass(SimplifyCFGPass());
   FPM.addPass(InstCombinePass());
+  if (EnableLoopFlatten)
+    FPM.addPass(LoopFlattenPass());
   // The loop passes in LPM2 (LoopFullUnrollPass) do not preserve MemorySSA.
   // *All* loop passes must preserve it, in order to be able to use it.
   FPM.addPass(createFunctionToLoopPassAdaptor(
@@ -756,6 +756,8 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
       DebugLogging));
   FPM.addPass(SimplifyCFGPass());
   FPM.addPass(InstCombinePass());
+  if (EnableLoopFlatten)
+    FPM.addPass(LoopFlattenPass());
   // The loop passes in LPM2 (LoopIdiomRecognizePass, IndVarSimplifyPass,
   // LoopDeletionPass and LoopFullUnrollPass) do not preserve MemorySSA.
   // *All* loop passes must preserve it, in order to be able to use it.


        


More information about the llvm-branch-commits mailing list