Skip to content

Commit aed1898

Browse files
author
MUSTAPHA BARKI
authored
Merge branch 'llvm:main' into Uncontrolled-data-used-in-path-expression
2 parents 03adf39 + 074308c commit aed1898

File tree

721 files changed

+38890
-11838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

721 files changed

+38890
-11838
lines changed

.github/new-prs-labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,3 +1121,6 @@ tablegen:
11211121
- llvm/include/TableGen/**
11221122
- llvm/lib/TableGen/**
11231123
- llvm/utils/TableGen/**
1124+
1125+
infrastructure:
1126+
- .ci/**

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ jobs:
281281
- name: Set up the MSVC dev environment
282282
if: ${{ matrix.mingw != true }}
283283
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
284+
- name: Add the installed Clang at the start of the path
285+
if: ${{ matrix.mingw != true }}
286+
run: |
287+
echo "c:\Program Files\LLVM\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
284288
- name: Build and test
285289
run: |
286290
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}

.github/workflows/llvm-tests.yml renamed to .github/workflows/llvm-abi-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: LLVM Tests
1+
name: LLVM ABI Tests
22

33
permissions:
44
contents: read

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ class BinaryContext {
190190
/// Unique build ID if available for the binary.
191191
std::optional<std::string> FileBuildID;
192192

193+
/// GNU property note indicating AArch64 BTI.
194+
bool UsesBTI{false};
195+
193196
/// Set of all sections.
194197
struct CompareSections {
195198
bool operator()(const BinarySection *A, const BinarySection *B) const {
@@ -384,6 +387,9 @@ class BinaryContext {
384387
}
385388
void setFileBuildID(StringRef ID) { FileBuildID = std::string(ID); }
386389

390+
bool usesBTI() const { return UsesBTI; }
391+
void setUsesBTI(bool Value) { UsesBTI = Value; }
392+
387393
bool hasSymbolsWithFileName() const { return HasSymbolsWithFileName; }
388394
void setHasSymbolsWithFileName(bool Value) { HasSymbolsWithFileName = Value; }
389395

bolt/include/bolt/Passes/SplitFunctions.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,6 @@
1818
namespace llvm {
1919
namespace bolt {
2020

21-
/// Strategy used to partition blocks into fragments.
22-
enum SplitFunctionsStrategy : char {
23-
/// Split each function into a hot and cold fragment using profiling
24-
/// information.
25-
Profile2 = 0,
26-
/// Split each function into a hot, warm, and cold fragment using
27-
/// profiling information.
28-
CDSplit,
29-
/// Split each function into a hot and cold fragment at a randomly chosen
30-
/// split point (ignoring any available profiling information).
31-
Random2,
32-
/// Split each function into N fragments at a randomly chosen split points
33-
/// (ignoring any available profiling information).
34-
RandomN,
35-
/// Split all basic blocks of each function into fragments such that each
36-
/// fragment contains exactly a single basic block.
37-
All
38-
};
39-
4021
class SplitStrategy {
4122
public:
4223
using BlockIt = BinaryFunction::BasicBlockOrderType::iterator;

bolt/include/bolt/Rewrite/MetadataRewriters.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ std::unique_ptr<MetadataRewriter> createPseudoProbeRewriter(BinaryContext &);
2727

2828
std::unique_ptr<MetadataRewriter> createSDTRewriter(BinaryContext &);
2929

30+
std::unique_ptr<MetadataRewriter> createGNUPropertyRewriter(BinaryContext &);
31+
3032
} // namespace bolt
3133
} // namespace llvm
3234

bolt/include/bolt/Utils/CommandLineOpts.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,25 @@ enum HeatmapModeKind {
2929
HM_Optional // perf2bolt --heatmap
3030
};
3131

32+
/// Strategy used to partition blocks into fragments.
33+
enum SplitFunctionsStrategy : char {
34+
/// Split each function into a hot and cold fragment using profiling
35+
/// information.
36+
Profile2 = 0,
37+
/// Split each function into a hot, warm, and cold fragment using
38+
/// profiling information.
39+
CDSplit,
40+
/// Split each function into a hot and cold fragment at a randomly chosen
41+
/// split point (ignoring any available profiling information).
42+
Random2,
43+
/// Split each function into N fragments at a randomly chosen split points
44+
/// (ignoring any available profiling information).
45+
RandomN,
46+
/// Split all basic blocks of each function into fragments such that each
47+
/// fragment contains exactly a single basic block.
48+
All
49+
};
50+
3251
using HeatmapBlockSizes = std::vector<unsigned>;
3352
struct HeatmapBlockSpecParser : public llvm::cl::parser<HeatmapBlockSizes> {
3453
explicit HeatmapBlockSpecParser(llvm::cl::Option &O)
@@ -78,6 +97,7 @@ extern llvm::cl::opt<std::string> OutputFilename;
7897
extern llvm::cl::opt<std::string> PerfData;
7998
extern llvm::cl::opt<bool> PrintCacheMetrics;
8099
extern llvm::cl::opt<bool> PrintSections;
100+
extern llvm::cl::opt<SplitFunctionsStrategy> SplitStrategy;
81101

82102
// The format to use with -o in aggregation mode (perf2bolt)
83103
enum ProfileFormatKind { PF_Fdata, PF_YAML };

bolt/lib/Passes/LongJmp.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,10 @@ void LongJmpPass::relaxLocalBranches(BinaryFunction &BF) {
895895

896896
Error LongJmpPass::runOnFunctions(BinaryContext &BC) {
897897

898+
assert((opts::CompactCodeModel ||
899+
opts::SplitStrategy != opts::SplitFunctionsStrategy::CDSplit) &&
900+
"LongJmp cannot work with functions split in more than two fragments");
901+
898902
if (opts::CompactCodeModel) {
899903
BC.outs()
900904
<< "BOLT-INFO: relaxing branches for compact code model (<128MB)\n";

bolt/lib/Passes/SplitFunctions.cpp

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -86,29 +86,6 @@ static cl::opt<unsigned> SplitThreshold(
8686
"increase after splitting."),
8787
cl::init(0), cl::Hidden, cl::cat(BoltOptCategory));
8888

89-
static cl::opt<SplitFunctionsStrategy> SplitStrategy(
90-
"split-strategy", cl::init(SplitFunctionsStrategy::Profile2),
91-
cl::values(clEnumValN(SplitFunctionsStrategy::Profile2, "profile2",
92-
"split each function into a hot and cold fragment "
93-
"using profiling information")),
94-
cl::values(clEnumValN(SplitFunctionsStrategy::CDSplit, "cdsplit",
95-
"split each function into a hot, warm, and cold "
96-
"fragment using profiling information")),
97-
cl::values(clEnumValN(
98-
SplitFunctionsStrategy::Random2, "random2",
99-
"split each function into a hot and cold fragment at a randomly chosen "
100-
"split point (ignoring any available profiling information)")),
101-
cl::values(clEnumValN(
102-
SplitFunctionsStrategy::RandomN, "randomN",
103-
"split each function into N fragments at a randomly chosen split "
104-
"points (ignoring any available profiling information)")),
105-
cl::values(clEnumValN(
106-
SplitFunctionsStrategy::All, "all",
107-
"split all basic blocks of each function into fragments such that each "
108-
"fragment contains exactly a single basic block")),
109-
cl::desc("strategy used to partition blocks into fragments"),
110-
cl::cat(BoltOptCategory));
111-
11289
static cl::opt<double> CallScale(
11390
"call-scale",
11491
cl::desc("Call score scale coefficient (when --split-strategy=cdsplit)"),
@@ -724,14 +701,14 @@ Error SplitFunctions::runOnFunctions(BinaryContext &BC) {
724701
// If split strategy is not CDSplit, then a second run of the pass is not
725702
// needed after function reordering.
726703
if (BC.HasFinalizedFunctionOrder &&
727-
opts::SplitStrategy != SplitFunctionsStrategy::CDSplit)
704+
opts::SplitStrategy != opts::SplitFunctionsStrategy::CDSplit)
728705
return Error::success();
729706

730707
std::unique_ptr<SplitStrategy> Strategy;
731708
bool ForceSequential = false;
732709

733710
switch (opts::SplitStrategy) {
734-
case SplitFunctionsStrategy::CDSplit:
711+
case opts::SplitFunctionsStrategy::CDSplit:
735712
// CDSplit runs two splitting passes: hot-cold splitting (SplitPrfoile2)
736713
// before function reordering and hot-warm-cold splitting
737714
// (SplitCacheDirected) after function reordering.
@@ -742,21 +719,21 @@ Error SplitFunctions::runOnFunctions(BinaryContext &BC) {
742719
opts::AggressiveSplitting = true;
743720
BC.HasWarmSection = true;
744721
break;
745-
case SplitFunctionsStrategy::Profile2:
722+
case opts::SplitFunctionsStrategy::Profile2:
746723
Strategy = std::make_unique<SplitProfile2>();
747724
break;
748-
case SplitFunctionsStrategy::Random2:
725+
case opts::SplitFunctionsStrategy::Random2:
749726
Strategy = std::make_unique<SplitRandom2>();
750727
// If we split functions randomly, we need to ensure that across runs with
751728
// the same input, we generate random numbers for each function in the same
752729
// order.
753730
ForceSequential = true;
754731
break;
755-
case SplitFunctionsStrategy::RandomN:
732+
case opts::SplitFunctionsStrategy::RandomN:
756733
Strategy = std::make_unique<SplitRandomN>();
757734
ForceSequential = true;
758735
break;
759-
case SplitFunctionsStrategy::All:
736+
case opts::SplitFunctionsStrategy::All:
760737
Strategy = std::make_unique<SplitAll>();
761738
break;
762739
}

bolt/lib/Rewrite/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ add_llvm_library(LLVMBOLTRewrite
2525
PseudoProbeRewriter.cpp
2626
RewriteInstance.cpp
2727
SDTRewriter.cpp
28+
GNUPropertyRewriter.cpp
2829

2930
NO_EXPORT
3031
DISABLE_LLVM_LINK_LLVM_DYLIB

0 commit comments

Comments
 (0)