aboutsummaryrefslogtreecommitdiff
path: root/bolt/include
diff options
context:
space:
mode:
Diffstat (limited to 'bolt/include')
-rw-r--r--bolt/include/bolt/Core/BinaryContext.h6
-rw-r--r--bolt/include/bolt/Passes/SplitFunctions.h19
-rw-r--r--bolt/include/bolt/Rewrite/MetadataRewriters.h2
-rw-r--r--bolt/include/bolt/Utils/CommandLineOpts.h20
4 files changed, 28 insertions, 19 deletions
diff --git a/bolt/include/bolt/Core/BinaryContext.h b/bolt/include/bolt/Core/BinaryContext.h
index 082f1ce..8960b19 100644
--- a/bolt/include/bolt/Core/BinaryContext.h
+++ b/bolt/include/bolt/Core/BinaryContext.h
@@ -190,6 +190,9 @@ class BinaryContext {
/// Unique build ID if available for the binary.
std::optional<std::string> FileBuildID;
+ /// GNU property note indicating AArch64 BTI.
+ bool UsesBTI{false};
+
/// Set of all sections.
struct CompareSections {
bool operator()(const BinarySection *A, const BinarySection *B) const {
@@ -384,6 +387,9 @@ public:
}
void setFileBuildID(StringRef ID) { FileBuildID = std::string(ID); }
+ bool usesBTI() const { return UsesBTI; }
+ void setUsesBTI(bool Value) { UsesBTI = Value; }
+
bool hasSymbolsWithFileName() const { return HasSymbolsWithFileName; }
void setHasSymbolsWithFileName(bool Value) { HasSymbolsWithFileName = Value; }
diff --git a/bolt/include/bolt/Passes/SplitFunctions.h b/bolt/include/bolt/Passes/SplitFunctions.h
index 8bdc48b..2c1bf18 100644
--- a/bolt/include/bolt/Passes/SplitFunctions.h
+++ b/bolt/include/bolt/Passes/SplitFunctions.h
@@ -18,25 +18,6 @@
namespace llvm {
namespace bolt {
-/// Strategy used to partition blocks into fragments.
-enum SplitFunctionsStrategy : char {
- /// Split each function into a hot and cold fragment using profiling
- /// information.
- Profile2 = 0,
- /// Split each function into a hot, warm, and cold fragment using
- /// profiling information.
- CDSplit,
- /// Split each function into a hot and cold fragment at a randomly chosen
- /// split point (ignoring any available profiling information).
- Random2,
- /// Split each function into N fragments at a randomly chosen split points
- /// (ignoring any available profiling information).
- RandomN,
- /// Split all basic blocks of each function into fragments such that each
- /// fragment contains exactly a single basic block.
- All
-};
-
class SplitStrategy {
public:
using BlockIt = BinaryFunction::BasicBlockOrderType::iterator;
diff --git a/bolt/include/bolt/Rewrite/MetadataRewriters.h b/bolt/include/bolt/Rewrite/MetadataRewriters.h
index b71bd6c..2c09c879 100644
--- a/bolt/include/bolt/Rewrite/MetadataRewriters.h
+++ b/bolt/include/bolt/Rewrite/MetadataRewriters.h
@@ -27,6 +27,8 @@ std::unique_ptr<MetadataRewriter> createPseudoProbeRewriter(BinaryContext &);
std::unique_ptr<MetadataRewriter> createSDTRewriter(BinaryContext &);
+std::unique_ptr<MetadataRewriter> createGNUPropertyRewriter(BinaryContext &);
+
} // namespace bolt
} // namespace llvm
diff --git a/bolt/include/bolt/Utils/CommandLineOpts.h b/bolt/include/bolt/Utils/CommandLineOpts.h
index 859d6f3..0964c2c 100644
--- a/bolt/include/bolt/Utils/CommandLineOpts.h
+++ b/bolt/include/bolt/Utils/CommandLineOpts.h
@@ -29,6 +29,25 @@ enum HeatmapModeKind {
HM_Optional // perf2bolt --heatmap
};
+/// Strategy used to partition blocks into fragments.
+enum SplitFunctionsStrategy : char {
+ /// Split each function into a hot and cold fragment using profiling
+ /// information.
+ Profile2 = 0,
+ /// Split each function into a hot, warm, and cold fragment using
+ /// profiling information.
+ CDSplit,
+ /// Split each function into a hot and cold fragment at a randomly chosen
+ /// split point (ignoring any available profiling information).
+ Random2,
+ /// Split each function into N fragments at a randomly chosen split points
+ /// (ignoring any available profiling information).
+ RandomN,
+ /// Split all basic blocks of each function into fragments such that each
+ /// fragment contains exactly a single basic block.
+ All
+};
+
using HeatmapBlockSizes = std::vector<unsigned>;
struct HeatmapBlockSpecParser : public llvm::cl::parser<HeatmapBlockSizes> {
explicit HeatmapBlockSpecParser(llvm::cl::Option &O)
@@ -78,6 +97,7 @@ extern llvm::cl::opt<std::string> OutputFilename;
extern llvm::cl::opt<std::string> PerfData;
extern llvm::cl::opt<bool> PrintCacheMetrics;
extern llvm::cl::opt<bool> PrintSections;
+extern llvm::cl::opt<SplitFunctionsStrategy> SplitStrategy;
// The format to use with -o in aggregation mode (perf2bolt)
enum ProfileFormatKind { PF_Fdata, PF_YAML };