[PATCH] D110057: [LoopFlatten] Move it to a LoopPassManager
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 20 09:49:36 PDT 2021
SjoerdMeijer updated this revision to Diff 373630.
SjoerdMeijer added a comment.
This removes the test changes, I had indeed incorrectly put this patch on top of D109958 <https://reviews.llvm.org/D109958>.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110057/new/
https://reviews.llvm.org/D110057
Files:
llvm/lib/Passes/PassBuilderPipelines.cpp
Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -290,6 +290,8 @@
if (EnableLoopInterchange)
LPM2.addPass(LoopInterchangePass());
+ if (EnableLoopFlatten)
+ LPM2.addPass(LoopFlattenPass());
// Do not enable unrolling in PreLinkThinLTO phase during sample PGO
// because it changes IR to makes profile annotation in back compile
@@ -314,8 +316,6 @@
/*UseBlockFrequencyInfo=*/true));
FPM.addPass(SimplifyCFGPass());
FPM.addPass(InstCombinePass());
- if (EnableLoopFlatten)
- FPM.addPass(createFunctionToLoopPassAdaptor(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(std::move(LPM2),
@@ -464,6 +464,8 @@
if (EnableLoopInterchange)
LPM2.addPass(LoopInterchangePass());
+ if (EnableLoopFlatten)
+ LPM2.addPass(LoopFlattenPass());
// Do not enable unrolling in PreLinkThinLTO phase during sample PGO
// because it changes IR to makes profile annotation in back compile
@@ -488,8 +490,6 @@
/*UseBlockFrequencyInfo=*/true));
FPM.addPass(SimplifyCFGPass());
FPM.addPass(InstCombinePass());
- if (EnableLoopFlatten)
- FPM.addPass(createFunctionToLoopPassAdaptor(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.
@@ -1538,9 +1538,6 @@
MainFPM.addPass(DSEPass());
MainFPM.addPass(MergedLoadStoreMotionPass());
- // More loops are countable; try to optimize them.
- if (EnableLoopFlatten && Level.getSpeedupLevel() > 1)
- MainFPM.addPass(createFunctionToLoopPassAdaptor(LoopFlattenPass()));
if (EnableConstraintElimination)
MainFPM.addPass(ConstraintEliminationPass());
@@ -1548,6 +1545,8 @@
LoopPassManager LPM;
LPM.addPass(IndVarSimplifyPass());
LPM.addPass(LoopDeletionPass());
+ if (EnableLoopFlatten && Level.getSpeedupLevel() > 1)
+ LPM.addPass(LoopFlattenPass());
// FIXME: Add loop interchange.
// Unroll small loops and perform peeling.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110057.373630.patch
Type: text/x-patch
Size: 2460 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210920/a785fe29/attachment.bin>
More information about the llvm-commits
mailing list