From f5021155617ebe068bafca83240d8534e2d72235 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sun, 17 Jul 2022 14:03:23 -0700 Subject: [PATCH] [LegacyPM] Remove PGO options from PassManagerBuilder They have been dead since legacy PGO/SamplePGO passes were removed. --- .../llvm/Transforms/IPO/PassManagerBuilder.h | 13 ----------- llvm/lib/Transforms/IPO/PassManagerBuilder.cpp | 14 ------------ llvm/tools/opt/opt.cpp | 26 ---------------------- 3 files changed, 53 deletions(-) diff --git a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h index c8ea1f5..61451ad 100644 --- a/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h +++ b/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h @@ -171,19 +171,6 @@ public: unsigned LicmMssaOptCap; unsigned LicmMssaNoAccForPromotionCap; - /// Enable profile instrumentation pass. - bool EnablePGOInstrGen; - /// Enable profile context sensitive instrumentation pass. - bool EnablePGOCSInstrGen; - /// Enable profile context sensitive profile use pass. - bool EnablePGOCSInstrUse; - /// Profile data file name that the instrumentation will be written to. - std::string PGOInstrGen; - /// Path of the profile data file. - std::string PGOInstrUse; - /// Path of the sample Profile data file. - std::string PGOSampleUse; - private: /// ExtensionList - This is list of all of the extensions that are registered. std::vector> Extensions; diff --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp index c491cfd..60e71f4 100644 --- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp +++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp @@ -193,12 +193,6 @@ PassManagerBuilder::PassManagerBuilder() { VerifyOutput = false; MergeFunctions = false; PrepareForLTO = false; - EnablePGOInstrGen = false; - EnablePGOCSInstrGen = false; - EnablePGOCSInstrUse = false; - PGOInstrGen = ""; - PGOInstrUse = ""; - PGOSampleUse = ""; PrepareForThinLTO = EnablePrepareForThinLTO; PerformThinLTO = EnablePerformThinLTO; DivergentTarget = false; @@ -656,14 +650,6 @@ void PassManagerBuilder::populateModulePassManager( MPM.add(createLowerTypeTestsPass(nullptr, nullptr, true)); } - // For SamplePGO in ThinLTO compile phase, we do not want to unroll loops - // as it will change the CFG too much to make the 2nd profile annotation - // in backend more difficult. - bool PrepareForThinLTOUsingPGOSampleProfile = - PrepareForThinLTO && !PGOSampleUse.empty(); - if (PrepareForThinLTOUsingPGOSampleProfile) - DisableUnrollLoops = true; - // Infer attributes about declarations if possible. MPM.add(createInferFunctionAttrsLegacyPass()); diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp index 1160412..b4833c6 100644 --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -352,32 +352,6 @@ static void AddOptimizationPasses(legacy::PassManagerBase &MPM, if (TM) TM->adjustPassManager(Builder); - switch (PGOKindFlag) { - case InstrGen: - Builder.EnablePGOInstrGen = true; - Builder.PGOInstrGen = ProfileFile; - break; - case InstrUse: - Builder.PGOInstrUse = ProfileFile; - break; - case SampleUse: - Builder.PGOSampleUse = ProfileFile; - break; - default: - break; - } - - switch (CSPGOKindFlag) { - case CSInstrGen: - Builder.EnablePGOCSInstrGen = true; - break; - case CSInstrUse: - Builder.EnablePGOCSInstrUse = true; - break; - default: - break; - } - Builder.populateFunctionPassManager(FPM); Builder.populateModulePassManager(MPM); } -- 2.7.4