diff options
author | Teresa Johnson <tejohnson@google.com> | 2017-08-02 20:35:29 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2017-08-02 20:35:29 +0000 |
commit | ecd901314d48f0b525dce73c4d07919acc194696 (patch) | |
tree | ccd15803c9010eca37806eb7769d4d81ef2984d3 /llvm/lib/Passes | |
parent | 2e8a7d36ff0c7494fa859b14c4cf10b7dfb5c1f2 (diff) | |
download | bcm5719-llvm-ecd901314d48f0b525dce73c4d07919acc194696.tar.gz bcm5719-llvm-ecd901314d48f0b525dce73c4d07919acc194696.zip |
[PM] Split LoopUnrollPass and make partial unroller a function pass
Summary:
This is largely NFC*, in preparation for utilizing ProfileSummaryInfo
and BranchFrequencyInfo analyses. In this patch I am only doing the
splitting for the New PM, but I can do the same for the legacy PM as
a follow-on if this looks good.
*Not NFC since for partial unrolling we lose the updates done to the
loop traversal (adding new sibling and child loops) - according to
Chandler this is not very useful for partial unrolling, but it also
means that the debugging flag -unroll-revisit-child-loops no longer
works for partial unrolling.
Reviewers: chandlerc
Subscribers: mehdi_amini, mzolotukhin, eraman, llvm-commits
Differential Revision: https://reviews.llvm.org/D36157
llvm-svn: 309886
Diffstat (limited to 'llvm/lib/Passes')
-rw-r--r-- | llvm/lib/Passes/PassBuilder.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Passes/PassRegistry.def | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Passes/PassBuilder.cpp b/llvm/lib/Passes/PassBuilder.cpp index f2dd950f22e..0b449bd5d45 100644 --- a/llvm/lib/Passes/PassBuilder.cpp +++ b/llvm/lib/Passes/PassBuilder.cpp @@ -394,7 +394,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level, // inaccurate. if (Phase != ThinLTOPhase::PreLink || !PGOOpt || PGOOpt->SampleProfileFile.empty()) - LPM2.addPass(LoopUnrollPass::createFull(Level)); + LPM2.addPass(LoopFullUnrollPass(Level)); for (auto &C : LoopOptimizerEndEPCallbacks) C(LPM2, Level); @@ -723,7 +723,7 @@ PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level, // FIXME: It would be really good to use a loop-integrated instruction // combiner for cleanup here so that the unrolling and LICM can be pipelined // across the loop nests. - OptimizePM.addPass(createFunctionToLoopPassAdaptor(LoopUnrollPass::create(Level))); + OptimizePM.addPass(LoopUnrollPass(Level)); OptimizePM.addPass(InstCombinePass()); OptimizePM.addPass(RequireAnalysisPass<OptimizationRemarkEmitterAnalysis, Function>()); OptimizePM.addPass(createFunctionToLoopPassAdaptor(LICMPass())); diff --git a/llvm/lib/Passes/PassRegistry.def b/llvm/lib/Passes/PassRegistry.def index d59ec7f8584..5b8c3ada883 100644 --- a/llvm/lib/Passes/PassRegistry.def +++ b/llvm/lib/Passes/PassRegistry.def @@ -196,6 +196,7 @@ FUNCTION_PASS("speculative-execution", SpeculativeExecutionPass()) FUNCTION_PASS("sroa", SROA()) FUNCTION_PASS("tailcallelim", TailCallElimPass()) FUNCTION_PASS("unreachableblockelim", UnreachableBlockElimPass()) +FUNCTION_PASS("unroll", LoopUnrollPass()) FUNCTION_PASS("verify", VerifierPass()) FUNCTION_PASS("verify<domtree>", DominatorTreeVerifierPass()) FUNCTION_PASS("verify<loops>", LoopVerifierPass()) @@ -227,8 +228,7 @@ LOOP_PASS("loop-deletion", LoopDeletionPass()) LOOP_PASS("simplify-cfg", LoopSimplifyCFGPass()) LOOP_PASS("strength-reduce", LoopStrengthReducePass()) LOOP_PASS("indvars", IndVarSimplifyPass()) -LOOP_PASS("unroll", LoopUnrollPass::create()) -LOOP_PASS("unroll-full", LoopUnrollPass::createFull()) +LOOP_PASS("unroll-full", LoopFullUnrollPass()) LOOP_PASS("unswitch", SimpleLoopUnswitchPass()) LOOP_PASS("print-access-info", LoopAccessInfoPrinterPass(dbgs())) LOOP_PASS("print<ivusers>", IVUsersPrinterPass(dbgs())) |