Skip to content

Commit 175299b

Browse files
committed
Merge branch 'main' into pr-riscv-shuffle-vcompress
2 parents 73f6e22 + c55a080 commit 175299b

File tree

430 files changed

+17840
-3668
lines changed

Some content is hidden

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

430 files changed

+17840
-3668
lines changed

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ class DataAggregator : public DataReader {
170170
std::string BuildIDBinaryName;
171171

172172
/// Memory map info for a single file as recorded in perf.data
173-
/// When a binary has multiple text segments, the Size is computed as the
174-
/// difference of the last address of these segments from the BaseAddress.
175-
/// The base addresses of all text segments must be the same.
176173
struct MMapInfo {
177174
uint64_t BaseAddress{0}; /// Base address of the mapped binary.
178175
uint64_t MMapAddress{0}; /// Address of the executable segment.
@@ -496,11 +493,6 @@ class DataAggregator : public DataReader {
496493
/// and return a file name matching a given \p FileBuildID.
497494
std::optional<StringRef> getFileNameForBuildID(StringRef FileBuildID);
498495

499-
/// Get a constant reference to the parsed binary mmap entries.
500-
const std::unordered_map<uint64_t, MMapInfo> &getBinaryMMapInfo() {
501-
return BinaryMMapInfo;
502-
}
503-
504496
friend class YAMLProfileWriter;
505497
};
506498
} // namespace bolt

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ cl::opt<bool> ReadPreAggregated(
9595
"pa", cl::desc("skip perf and read data from a pre-aggregated file format"),
9696
cl::cat(AggregatorCategory));
9797

98-
cl::opt<std::string>
99-
ReadPerfEvents("perf-script-events",
100-
cl::desc("skip perf event collection by supplying a "
101-
"perf-script output in a textual format"),
102-
cl::ReallyHidden, cl::init(""), cl::cat(AggregatorCategory));
103-
10498
static cl::opt<bool>
10599
TimeAggregator("time-aggr",
106100
cl::desc("time BOLT aggregator"),
@@ -173,9 +167,8 @@ void DataAggregator::findPerfExecutable() {
173167
void DataAggregator::start() {
174168
outs() << "PERF2BOLT: Starting data aggregation job for " << Filename << "\n";
175169

176-
// Don't launch perf for pre-aggregated files or when perf input is specified
177-
// by the user.
178-
if (opts::ReadPreAggregated || !opts::ReadPerfEvents.empty())
170+
// Don't launch perf for pre-aggregated files
171+
if (opts::ReadPreAggregated)
179172
return;
180173

181174
findPerfExecutable();
@@ -471,13 +464,6 @@ void DataAggregator::filterBinaryMMapInfo() {
471464

472465
int DataAggregator::prepareToParse(StringRef Name, PerfProcessInfo &Process,
473466
PerfProcessErrorCallbackTy Callback) {
474-
if (!opts::ReadPerfEvents.empty()) {
475-
outs() << "PERF2BOLT: using pre-processed perf events for '" << Name
476-
<< "' (perf-script-events)\n";
477-
ParsingBuf = opts::ReadPerfEvents;
478-
return 0;
479-
}
480-
481467
std::string Error;
482468
outs() << "PERF2BOLT: waiting for perf " << Name
483469
<< " collection to finish...\n";
@@ -2070,6 +2056,15 @@ std::error_code DataAggregator::parseMMapEvents() {
20702056
if (FileMMapInfo.first == "(deleted)")
20712057
continue;
20722058

2059+
// Consider only the first mapping of the file for any given PID
2060+
auto Range = GlobalMMapInfo.equal_range(FileMMapInfo.first);
2061+
bool PIDExists = llvm::any_of(make_range(Range), [&](const auto &MI) {
2062+
return MI.second.PID == FileMMapInfo.second.PID;
2063+
});
2064+
2065+
if (PIDExists)
2066+
continue;
2067+
20732068
GlobalMMapInfo.insert(FileMMapInfo);
20742069
}
20752070

@@ -2121,22 +2116,12 @@ std::error_code DataAggregator::parseMMapEvents() {
21212116
<< " using file offset 0x" << Twine::utohexstr(MMapInfo.Offset)
21222117
<< ". Ignoring profile data for this mapping\n";
21232118
continue;
2119+
} else {
2120+
MMapInfo.BaseAddress = *BaseAddress;
21242121
}
2125-
MMapInfo.BaseAddress = *BaseAddress;
21262122
}
21272123

2128-
// Try to add MMapInfo to the map and update its size. Large binaries may
2129-
// span to multiple text segments, so the mapping is inserted only on the
2130-
// first occurrence.
2131-
if (!BinaryMMapInfo.insert(std::make_pair(MMapInfo.PID, MMapInfo)).second)
2132-
assert(MMapInfo.BaseAddress == BinaryMMapInfo[MMapInfo.PID].BaseAddress &&
2133-
"Base address on multiple segment mappings should match");
2134-
2135-
// Update mapping size.
2136-
const uint64_t EndAddress = MMapInfo.MMapAddress + MMapInfo.Size;
2137-
const uint64_t Size = EndAddress - BinaryMMapInfo[MMapInfo.PID].BaseAddress;
2138-
if (Size > BinaryMMapInfo[MMapInfo.PID].Size)
2139-
BinaryMMapInfo[MMapInfo.PID].Size = Size;
2124+
BinaryMMapInfo.insert(std::make_pair(MMapInfo.PID, MMapInfo));
21402125
}
21412126

21422127
if (BinaryMMapInfo.empty()) {

bolt/unittests/Core/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ set(LLVM_LINK_COMPONENTS
88
add_bolt_unittest(CoreTests
99
BinaryContext.cpp
1010
MCPlusBuilder.cpp
11-
MemoryMaps.cpp
1211
DynoStats.cpp
1312

1413
DISABLE_LLVM_LINK_LLVM_DYLIB
@@ -18,8 +17,6 @@ target_link_libraries(CoreTests
1817
PRIVATE
1918
LLVMBOLTCore
2019
LLVMBOLTRewrite
21-
LLVMBOLTProfile
22-
LLVMTestingSupport
2320
)
2421

2522
foreach (tgt ${BOLT_TARGETS_TO_BUILD})

bolt/unittests/Core/MemoryMaps.cpp

Lines changed: 0 additions & 142 deletions
This file was deleted.

clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -467,18 +467,9 @@ class DefineOutline : public Tweak {
467467
}
468468
}
469469

470-
// For function templates, the same limitations as for class templates
471-
// apply.
472-
if (const TemplateParameterList *Params =
473-
MD->getDescribedTemplateParams()) {
474-
// FIXME: Is this really needed? It inhibits application on
475-
// e.g. std::enable_if.
476-
for (NamedDecl *P : *Params) {
477-
if (!P->getIdentifier())
478-
return false;
479-
}
470+
// Function templates must be defined in the same file.
471+
if (MD->getDescribedTemplate())
480472
SameFile = true;
481-
}
482473

483474
// The refactoring is meaningless for unnamed classes and namespaces,
484475
// unless we're outlining in the same file

clang-tools-extra/clangd/unittests/tweaks/DefineOutlineTests.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ TEST_F(DefineOutlineTest, TriggersOnFunctionDecl) {
118118
template <> void fo^o<int>() {}
119119
)cpp");
120120

121-
// Not available on member function templates with unnamed template
122-
// parameters.
123-
EXPECT_UNAVAILABLE(R"cpp(
124-
struct Foo { template <typename> void ba^r() {} };
125-
)cpp");
126-
127121
// Not available on methods of unnamed classes.
128122
EXPECT_UNAVAILABLE(R"cpp(
129123
struct Foo {
@@ -410,14 +404,14 @@ inline typename O1<T, U...>::template O2<V, A>::E O1<T, U...>::template O2<V, A>
410404
{
411405
R"cpp(
412406
struct Foo {
413-
template <typename T, bool B = true>
407+
template <typename T, typename, bool B = true>
414408
T ^bar() { return {}; }
415409
};)cpp",
416410
R"cpp(
417411
struct Foo {
418-
template <typename T, bool B = true>
412+
template <typename T, typename, bool B = true>
419413
T bar() ;
420-
};template <typename T, bool B>
414+
};template <typename T, typename, bool B>
421415
inline T Foo::bar() { return {}; }
422416
)cpp",
423417
""},
@@ -426,13 +420,13 @@ inline T Foo::bar() { return {}; }
426420
{
427421
R"cpp(
428422
template <typename T> struct Foo {
429-
template <typename U> T ^bar(const T& t, const U& u) { return {}; }
423+
template <typename U, bool> T ^bar(const T& t, const U& u) { return {}; }
430424
};)cpp",
431425
R"cpp(
432426
template <typename T> struct Foo {
433-
template <typename U> T bar(const T& t, const U& u) ;
427+
template <typename U, bool> T bar(const T& t, const U& u) ;
434428
};template <typename T>
435-
template <typename U>
429+
template <typename U, bool>
436430
inline T Foo<T>::bar(const T& t, const U& u) { return {}; }
437431
)cpp",
438432
""},

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ Hover
7373
Code completion
7474
^^^^^^^^^^^^^^^
7575

76+
- Added completion for C++20 keywords.
77+
7678
Code actions
7779
^^^^^^^^^^^^
7880

clang/docs/LanguageExtensions.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,9 @@ elementwise to the input.
647647

648648
Unless specified otherwise operation(±0) = ±0 and operation(±infinity) = ±infinity
649649

650+
The integer elementwise intrinsics, including ``__builtin_elementwise_popcount``,
651+
can be called in a ``constexpr`` context.
652+
650653
============================================== ====================================================================== =========================================
651654
Name Operation Supported element types
652655
============================================== ====================================================================== =========================================

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ Non-comprehensive list of changes in this release
372372
- ``__builtin_reduce_mul`` function can now be used in constant expressions.
373373
- ``__builtin_reduce_and`` function can now be used in constant expressions.
374374
- ``__builtin_reduce_or`` and ``__builtin_reduce_xor`` functions can now be used in constant expressions.
375+
- ``__builtin_elementwise_popcount`` function can now be used in constant expressions.
375376

376377
New Compiler Flags
377378
------------------
@@ -587,6 +588,8 @@ Improvements to Clang's diagnostics
587588
- For an rvalue reference bound to a temporary struct with an integer member, Clang will detect constant integer overflow
588589
in the initializer for the integer member (#GH46755).
589590

591+
- Fixed a false negative ``-Wunused-private-field`` diagnostic when a defaulted comparison operator is defined out of class (#GH116961).
592+
590593
Improvements to Clang's time-trace
591594
----------------------------------
592595

@@ -728,6 +731,8 @@ Bug Fixes to AST Handling
728731
sometimes incorrectly return null even if a comment was present. (#GH108145)
729732
- Clang now correctly parses the argument of the ``relates``, ``related``, ``relatesalso``,
730733
and ``relatedalso`` comment commands.
734+
- Clang now uses the location of the begin of the member expression for ``CallExpr``
735+
involving deduced ``this``. (#GH116928)
731736

732737
Miscellaneous Bug Fixes
733738
^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)