aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Passes/PassBuilder.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Passes/PassBuilder.h')
-rw-r--r--include/llvm/Passes/PassBuilder.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/llvm/Passes/PassBuilder.h b/include/llvm/Passes/PassBuilder.h
index d76c13984d11..efa36d957fbd 100644
--- a/include/llvm/Passes/PassBuilder.h
+++ b/include/llvm/Passes/PassBuilder.h
@@ -27,6 +27,14 @@ class StringRef;
class AAManager;
class TargetMachine;
+/// A struct capturing PGO tunables.
+struct PGOOptions {
+ std::string ProfileGenFile = "";
+ std::string ProfileUseFile = "";
+ bool RunProfileGen = false;
+ bool SamplePGO = false;
+};
+
/// \brief This class provides access to building LLVM's passes.
///
/// It's members provide the baseline state available to passes during their
@@ -35,6 +43,7 @@ class TargetMachine;
/// construction.
class PassBuilder {
TargetMachine *TM;
+ Optional<PGOOptions> PGOOpt;
public:
/// \brief LLVM-provided high-level optimization levels.
@@ -123,7 +132,9 @@ public:
Oz
};
- explicit PassBuilder(TargetMachine *TM = nullptr) : TM(TM) {}
+ explicit PassBuilder(TargetMachine *TM = nullptr,
+ Optional<PGOOptions> PGOOpt = None)
+ : TM(TM), PGOOpt(PGOOpt) {}
/// \brief Cross register the analysis managers through their proxies.
///