Skip to content

Commit 414cebb

Browse files
Merge branch 'llvm:main' into gh-101657
2 parents a2062c6 + 4729242 commit 414cebb

File tree

2,016 files changed

+75672
-48665
lines changed

Some content is hidden

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

2,016 files changed

+75672
-48665
lines changed

.ci/compute_projects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
DEPENDENT_RUNTIMES_TO_TEST = {
7878
"clang": {"compiler-rt"},
7979
"clang-tools-extra": {"libc"},
80+
"libc": {"libc"},
8081
".ci": {"compiler-rt", "libc"},
8182
}
8283
DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {

.ci/compute_projects_test.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def test_top_level_file(self):
187187
self.assertEqual(env_variables["runtimes_check_targets"], "")
188188
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
189189

190-
def test_exclude_runtiems_in_projects(self):
190+
def test_exclude_libcxx_in_projects(self):
191191
env_variables = compute_projects.get_env_variables(
192192
["libcxx/CMakeLists.txt"], "Linux"
193193
)
@@ -197,6 +197,16 @@ def test_exclude_runtiems_in_projects(self):
197197
self.assertEqual(env_variables["runtimes_check_targets"], "")
198198
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
199199

200+
def test_include_libc_in_runtimes(self):
201+
env_variables = compute_projects.get_env_variables(
202+
["libc/CMakeLists.txt"], "Linux"
203+
)
204+
self.assertEqual(env_variables["projects_to_build"], "clang;lld")
205+
self.assertEqual(env_variables["project_check_targets"], "")
206+
self.assertEqual(env_variables["runtimes_to_build"], "libc")
207+
self.assertEqual(env_variables["runtimes_check_targets"], "check-libc")
208+
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
209+
200210
def test_exclude_docs(self):
201211
env_variables = compute_projects.get_env_variables(
202212
["llvm/docs/CIBestPractices.rst"], "Linux"

.github/new-prs-labeler.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,10 @@ llvm:instcombine:
632632
- llvm/test/Transforms/InstCombine/**
633633
- llvm/test/Transforms/InstSimplify/**
634634

635+
llvm:vectorcombine:
636+
- llvm/lib/Transforms/Vectorize/VectorCombine.cpp
637+
- llvm/test/Transforms/VectorCombine/**
638+
635639
clangd:
636640
- clang-tools-extra/clangd/**
637641

bolt/include/bolt/Core/BinarySection.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,6 @@ inline uint8_t *copyByteArray(const uint8_t *Data, uint64_t Size) {
523523
return Array;
524524
}
525525

526-
inline uint8_t *copyByteArray(StringRef Buffer) {
527-
return copyByteArray(reinterpret_cast<const uint8_t *>(Buffer.data()),
528-
Buffer.size());
529-
}
530-
531526
inline uint8_t *copyByteArray(ArrayRef<char> Buffer) {
532527
return copyByteArray(reinterpret_cast<const uint8_t *>(Buffer.data()),
533528
Buffer.size());

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,9 @@ class DataAggregator : public DataReader {
374374
/// Parse a single pair of binary full path and associated build-id
375375
std::optional<std::pair<StringRef, StringRef>> parseNameBuildIDPair();
376376

377+
/// Coordinate reading and parsing of perf.data file
378+
void parsePerfData(BinaryContext &BC);
379+
377380
/// Coordinate reading and parsing of pre-aggregated file
378381
///
379382
/// The regular perf2bolt aggregation job is to read perf output directly.

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,27 +1765,26 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
17651765

17661766
if (opts::ShowDensity) {
17671767
double Density = 0.0;
1768-
// Sorted by the density in descending order.
1769-
llvm::stable_sort(FuncDensityList,
1770-
[&](const std::pair<double, uint64_t> &A,
1771-
const std::pair<double, uint64_t> &B) {
1772-
if (A.first != B.first)
1773-
return A.first > B.first;
1774-
return A.second < B.second;
1775-
});
1768+
llvm::sort(FuncDensityList);
17761769

17771770
uint64_t AccumulatedSamples = 0;
1778-
uint32_t I = 0;
17791771
assert(opts::ProfileDensityCutOffHot <= 1000000 &&
17801772
"The cutoff value is greater than 1000000(100%)");
1781-
while (AccumulatedSamples <
1782-
TotalSampleCount *
1783-
static_cast<float>(opts::ProfileDensityCutOffHot) /
1784-
1000000 &&
1785-
I < FuncDensityList.size()) {
1786-
AccumulatedSamples += FuncDensityList[I].second;
1787-
Density = FuncDensityList[I].first;
1788-
I++;
1773+
// Subtract samples in zero-density functions (no fall-throughs) from
1774+
// TotalSampleCount (not used anywhere below).
1775+
for (const auto [CurDensity, CurSamples] : FuncDensityList) {
1776+
if (CurDensity != 0.0)
1777+
break;
1778+
TotalSampleCount -= CurSamples;
1779+
}
1780+
const uint64_t CutoffSampleCount =
1781+
1.f * TotalSampleCount * opts::ProfileDensityCutOffHot / 1000000;
1782+
// Process functions in decreasing density order
1783+
for (const auto [CurDensity, CurSamples] : llvm::reverse(FuncDensityList)) {
1784+
if (AccumulatedSamples >= CutoffSampleCount)
1785+
break;
1786+
AccumulatedSamples += CurSamples;
1787+
Density = CurDensity;
17891788
}
17901789
if (Density == 0.0) {
17911790
BC.errs() << "BOLT-WARNING: the output profile is empty or the "

0 commit comments

Comments
 (0)