Skip to content
Snippets Groups Projects
Commit 79b733bc authored by Chandler Carruth's avatar Chandler Carruth
Browse files

[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

llvm-svn: 293225
parent 44f1281f
No related branches found
No related tags found
No related merge requests found
...@@ -318,19 +318,18 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level, ...@@ -318,19 +318,18 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
// the other we have is `LoopInstSimplify`. // the other we have is `LoopInstSimplify`.
LoopPassManager LPM1(DebugLogging), LPM2(DebugLogging); LoopPassManager LPM1(DebugLogging), LPM2(DebugLogging);
// FIXME: Enable these when the loop pass manager can support enforcing loop
// simplified and LCSSA form as well as updating the loop nest after
// transformations and we finsih porting the loop passes.
#if 0
// Rotate Loop - disable header duplication at -Oz // Rotate Loop - disable header duplication at -Oz
LPM1.addPass(LoopRotatePass(Level != Oz)); LPM1.addPass(LoopRotatePass(Level != Oz));
LPM1.addPass(LICMPass()); LPM1.addPass(LICMPass());
#if 0
// The LoopUnswitch pass isn't yet ported to the new pass manager.
LPM1.addPass(LoopUnswitchPass(/* OptimizeForSize */ Level != O3)); LPM1.addPass(LoopUnswitchPass(/* OptimizeForSize */ Level != O3));
#endif
LPM2.addPass(IndVarSimplifyPass()); LPM2.addPass(IndVarSimplifyPass());
LPM2.addPass(LoopIdiomPass()); LPM2.addPass(LoopIdiomRecognizePass());
LPM2.addPass(LoopDeletionPass()); LPM2.addPass(LoopDeletionPass());
LPM2.addPass(SimpleLoopUnrollPass()); LPM2.addPass(LoopUnrollPass::createFull());
#endif
FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM1))); FPM.addPass(createFunctionToLoopPassAdaptor(std::move(LPM1)));
FPM.addPass(SimplifyCFGPass()); FPM.addPass(SimplifyCFGPass());
FPM.addPass(InstCombinePass()); FPM.addPass(InstCombinePass());
...@@ -365,12 +364,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level, ...@@ -365,12 +364,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
FPM.addPass(JumpThreadingPass()); FPM.addPass(JumpThreadingPass());
FPM.addPass(CorrelatedValuePropagationPass()); FPM.addPass(CorrelatedValuePropagationPass());
FPM.addPass(DSEPass()); FPM.addPass(DSEPass());
// FIXME: Enable this when the loop pass manager can support enforcing loop
// simplified and LCSSA form as well as updating the loop nest after
// transformations and we finsih porting the loop passes.
#if 0
FPM.addPass(createFunctionToLoopPassAdaptor(LICMPass())); FPM.addPass(createFunctionToLoopPassAdaptor(LICMPass()));
#endif
// Finally, do an expensive DCE pass to catch all the dead code exposed by // Finally, do an expensive DCE pass to catch all the dead code exposed by
// the simplifications and basic cleanup after all the simplifications. // the simplifications and basic cleanup after all the simplifications.
......
...@@ -87,11 +87,18 @@ ...@@ -87,11 +87,18 @@
; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy ; CHECK-O-NEXT: Running analysis: InnerAnalysisManagerProxy
; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis ; CHECK-O-NEXT: Running analysis: ScalarEvolutionAnalysis
; CHECK-O-NEXT: Starting Loop pass manager run. ; CHECK-O-NEXT: Starting Loop pass manager run.
; CHECK-O-NEXT: Running pass: LoopRotatePass
; CHECK-O-NEXT: Running pass: LICM
; CHECK-O-NEXT: Running analysis: OuterAnalysisManagerProxy
; CHECK-O-NEXT: Finished Loop pass manager run. ; CHECK-O-NEXT: Finished Loop pass manager run.
; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
; CHECK-O-NEXT: Running pass: InstCombinePass ; CHECK-O-NEXT: Running pass: InstCombinePass
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopStandardAnalysisResults{{.*}}> ; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LoopStandardAnalysisResults{{.*}}>
; CHECK-O-NEXT: Starting Loop pass manager run. ; CHECK-O-NEXT: Starting Loop pass manager run.
; CHECK-O-NEXT: Running pass: IndVarSimplifyPass
; CHECK-O-NEXT: Running pass: LoopIdiomRecognizePass
; CHECK-O-NEXT: Running pass: LoopDeletionPass
; CHECK-O-NEXT: Running pass: LoopUnrollPass
; CHECK-O-NEXT: Finished Loop pass manager run. ; CHECK-O-NEXT: Finished Loop pass manager run.
; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass ; CHECK-Os-NEXT: Running pass: MergedLoadStoreMotionPass
; CHECK-Os-NEXT: Running pass: GVN ; CHECK-Os-NEXT: Running pass: GVN
...@@ -109,6 +116,7 @@ ...@@ -109,6 +116,7 @@
; CHECK-O-NEXT: Running pass: JumpThreadingPass ; CHECK-O-NEXT: Running pass: JumpThreadingPass
; CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass ; CHECK-O-NEXT: Running pass: CorrelatedValuePropagationPass
; CHECK-O-NEXT: Running pass: DSEPass ; CHECK-O-NEXT: Running pass: DSEPass
; CHECK-O-NEXT: Running pass: FunctionToLoopPassAdaptor<{{.*}}LICMPass{{.*}}>
; CHECK-O-NEXT: Running pass: ADCEPass ; CHECK-O-NEXT: Running pass: ADCEPass
; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis ; CHECK-O-NEXT: Running analysis: PostDominatorTreeAnalysis
; CHECK-O-NEXT: Running pass: SimplifyCFGPass ; CHECK-O-NEXT: Running pass: SimplifyCFGPass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment