Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit e1c01cc

Browse files
committed
[PM] Enable the main loop pass pipelines with everything but
loop-unswitch in the main pipelines for the new PM. All of these now work, and Clang built using this pipeline can build the test suite and SPEC without hitting any asserts of ASan failures. There are still some bugs hiding though -- 7 tests regress with the new PM. I'm going to be investigating these, but it seems worthwhile to at least get the pipelines in place so that others can play with them, and they aren't completely broken. Differential Revision: https://reviews.llvm.org/D29113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293225 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent bf34add commit e1c01cc

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

lib/Passes/PassBuilder.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -318,19 +318,18 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
318318
// the other we have is `LoopInstSimplify`.
319319
LoopPassManager LPM1(DebugLogging), LPM2(DebugLogging);
320320

321-
// FIXME: Enable these when the loop pass manager can support enforcing loop
322-
// simplified and LCSSA form as well as updating the loop nest after
323-
// transformations and we finsih porting the loop passes.
324-
#if 0
325321
// Rotate Loop - disable header duplication at -Oz
326322
LPM1.addPass(LoopRotatePass(Level != Oz));
327323
LPM1.addPass(LICMPass());
324+
#if 0
325+
// The LoopUnswitch pass isn't yet ported to the new pass manager.
328326
LPM1.addPass(LoopUnswitchPass(/* OptimizeForSize */ Level != O3));
327+
#endif
329328
LPM2.addPass(IndVarSimplifyPass());
330-
LPM2.addPass(LoopIdiomPass());
329+
LPM2.addPass(LoopIdiomRecognizePass());
331330
LPM2.addPass(LoopDeletionPass());
332-
LPM2.addPass(SimpleLoopUnrollPass());
333-
#endif
331+
LPM2.addPass(LoopUnrollPass::createFull());
332+
334333
FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM1)));
335334
FPM.addPass(SimplifyCFGPass());
336335
FPM.addPass(InstCombinePass());
@@ -365,12 +364,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
365364
FPM.addPass(JumpThreadingPass());
366365
FPM.addPass(CorrelatedValuePropagationPass());
367366
FPM.addPass(DSEPass());
368-
// FIXME: Enable this when the loop pass manager can support enforcing loop
369-
// simplified and LCSSA form as well as updating the loop nest after
370-
// transformations and we finsih porting the loop passes.
371-
#if 0
372367
FPM.addPass(createFunctionToLoopPassAdaptor(LICMPass()));
373-
#endif
374368

375369
// Finally, do an expensive DCE pass to catch all the dead code exposed by
376370
// the simplifications and basic cleanup after all the simplifications.

test/Other/new-pm-defaults.ll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,18 @@
8787
; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
8888
; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis
8989
; CHECK-O-NEXT: Starting Loop pass manager run.
90+
; CHECK-O-NEXT: Running pass: LoopRotatePass
91+
; CHECK-O-NEXT: Running pass: LICM
92+
; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
9093
; CHECK-O-NEXT: Finished Loop pass manager run.
9194
; CHECK-O-NEXT: Running pass: SimplifyCFGPass
9295
; CHECK-O-NEXT: Running pass: InstCombinePass
9396
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopStandardAnalysisResults{{.*}}>
9497
; CHECK-O-NEXT: Starting Loop pass manager run.
98+
; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
99+
; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
100+
; CHECK-O-NEXT: Running pass: LoopDeletionPass
101+
; CHECK-O-NEXT: Running pass: LoopUnrollPass
95102
; CHECK-O-NEXT: Finished Loop pass manager run.
96103
; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
97104
; CHECK-Os-NEXT: Running pass: GVN
@@ -109,6 +116,7 @@
109116
; CHECK-O-NEXT: Running pass: JumpThreadingPass
110117
; CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass
111118
; CHECK-O-NEXT: Running pass: DSEPass
119+
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LICMPass{{.*}}>
112120
; CHECK-O-NEXT: Running pass: ADCEPass
113121
; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis
114122
; CHECK-O-NEXT: Running pass: SimplifyCFGPass

0 commit comments

Comments
 (0)