Skip to content

Commit 7360386

Browse files
committed
Merge branch 'main' into reland-m-prefetch
2 parents 7da648b + 45cd708 commit 7360386

File tree

2,030 files changed

+58808
-38835
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,030 files changed

+58808
-38835
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
3939
runs-on: libcxx-self-hosted-linux
40-
container: ghcr.io/llvm/libcxx-linux-builder:b6bb9dc5abd7c6452c13a53fa8949cb259db459b
40+
container: ghcr.io/llvm/libcxx-linux-builder:2b57ebb50b6d418e70382e655feaa619b558e254
4141
continue-on-error: false
4242
strategy:
4343
fail-fast: false
@@ -75,7 +75,7 @@ jobs:
7575
stage2:
7676
if: github.repository_owner == 'llvm'
7777
runs-on: libcxx-self-hosted-linux
78-
container: ghcr.io/llvm/libcxx-linux-builder:b6bb9dc5abd7c6452c13a53fa8949cb259db459b
78+
container: ghcr.io/llvm/libcxx-linux-builder:2b57ebb50b6d418e70382e655feaa619b558e254
7979
needs: [ stage1 ]
8080
continue-on-error: false
8181
strategy:
@@ -163,7 +163,7 @@ jobs:
163163
- config: 'generic-msan'
164164
machine: libcxx-self-hosted-linux
165165
runs-on: ${{ matrix.machine }}
166-
container: ghcr.io/llvm/libcxx-linux-builder:b6bb9dc5abd7c6452c13a53fa8949cb259db459b
166+
container: ghcr.io/llvm/libcxx-linux-builder:2b57ebb50b6d418e70382e655feaa619b558e254
167167
steps:
168168
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
169169
- name: ${{ matrix.config }}

CONTRIBUTING.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ describes how to get involved, raise issues and submit patches.
99

1010
## Getting in touch
1111

12-
Join the [LLVM Discourse forums](https://discourse.llvm.org/), [Discord
13-
chat](https://discord.gg/xS7Z362), or #llvm IRC channel on
14-
[OFTC](https://oftc.net/).
12+
Join the [LLVM Discourse forums](https://discourse.llvm.org/) or [Discord
13+
chat](https://discord.gg/xS7Z362).
1514

1615
The LLVM project has adopted a [code of conduct](https://llvm.org/docs/CodeOfConduct.html) for
1716
participants to all modes of communication within the project.

bolt/Maintainers.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ what goes in or not.
55

66
The list is sorted by surname and formatted to allow easy grepping and
77
beautification by scripts. The fields are: name (N), email (E), web-address
8-
(W), PGP key ID and fingerprint (P), description (D), snail-mail address
9-
(S) and (I) IRC handle. Each entry should contain at least the (N), (E) and
10-
(D) fields.
8+
(W), PGP key ID and fingerprint (P), and description (D). Each entry should
9+
contain at least the (N), (E) and (D) fields.
1110

1211
N: Maksim Panchenko, Rafael Auler
1312

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,6 @@ class DataAggregator : public DataReader {
197197

198198
BoltAddressTranslation *BAT{nullptr};
199199

200-
/// Whether pre-aggregated profile needs to convert branch profile into call
201-
/// to continuation fallthrough profile.
202-
bool NeedsConvertRetProfileToCallCont{false};
203-
204200
/// Update function execution profile with a recorded trace.
205201
/// A trace is region of code executed between two LBR entries supplied in
206202
/// execution order.

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -720,23 +720,6 @@ bool DataAggregator::doBranch(uint64_t From, uint64_t To, uint64_t Count,
720720
: isReturn(Func.disassembleInstructionAtOffset(Offset));
721721
};
722722

723-
// Returns whether \p Offset in \p Func may be a call continuation excluding
724-
// entry points and landing pads.
725-
auto checkCallCont = [&](const BinaryFunction &Func, const uint64_t Offset) {
726-
// No call continuation at a function start.
727-
if (!Offset)
728-
return false;
729-
730-
// FIXME: support BAT case where the function might be in empty state
731-
// (split fragments declared non-simple).
732-
if (!Func.hasCFG())
733-
return false;
734-
735-
// The offset should not be an entry point or a landing pad.
736-
const BinaryBasicBlock *ContBB = Func.getBasicBlockAtOffset(Offset);
737-
return ContBB && !ContBB->isEntryPoint() && !ContBB->isLandingPad();
738-
};
739-
740723
// Mutates \p Addr to an offset into the containing function, performing BAT
741724
// offset translation and parent lookup.
742725
//
@@ -749,8 +732,7 @@ bool DataAggregator::doBranch(uint64_t From, uint64_t To, uint64_t Count,
749732

750733
Addr -= Func->getAddress();
751734

752-
bool IsRetOrCallCont =
753-
IsFrom ? checkReturn(*Func, Addr) : checkCallCont(*Func, Addr);
735+
bool IsRet = IsFrom && checkReturn(*Func, Addr);
754736

755737
if (BAT)
756738
Addr = BAT->translate(Func->getAddress(), Addr, IsFrom);
@@ -761,24 +743,16 @@ bool DataAggregator::doBranch(uint64_t From, uint64_t To, uint64_t Count,
761743
NumColdSamples += Count;
762744

763745
if (!ParentFunc)
764-
return std::pair{Func, IsRetOrCallCont};
746+
return std::pair{Func, IsRet};
765747

766-
return std::pair{ParentFunc, IsRetOrCallCont};
748+
return std::pair{ParentFunc, IsRet};
767749
};
768750

769-
uint64_t ToOrig = To;
770751
auto [FromFunc, IsReturn] = handleAddress(From, /*IsFrom*/ true);
771-
auto [ToFunc, IsCallCont] = handleAddress(To, /*IsFrom*/ false);
752+
auto [ToFunc, _] = handleAddress(To, /*IsFrom*/ false);
772753
if (!FromFunc && !ToFunc)
773754
return false;
774755

775-
// Record call to continuation trace.
776-
if (NeedsConvertRetProfileToCallCont && FromFunc != ToFunc &&
777-
(IsReturn || IsCallCont)) {
778-
LBREntry First{ToOrig - 1, ToOrig - 1, false};
779-
LBREntry Second{ToOrig, ToOrig, false};
780-
return doTrace(First, Second, Count);
781-
}
782756
// Ignore returns.
783757
if (IsReturn)
784758
return true;
@@ -1235,21 +1209,14 @@ std::error_code DataAggregator::parseAggregatedLBREntry() {
12351209
ErrorOr<StringRef> TypeOrErr = parseString(FieldSeparator);
12361210
if (std::error_code EC = TypeOrErr.getError())
12371211
return EC;
1238-
// Pre-aggregated profile with branches and fallthroughs needs to convert
1239-
// return profile into call to continuation fall-through.
1240-
auto Type = AggregatedLBREntry::BRANCH;
1241-
if (TypeOrErr.get() == "B") {
1242-
NeedsConvertRetProfileToCallCont = true;
1212+
auto Type = AggregatedLBREntry::TRACE;
1213+
if (LLVM_LIKELY(TypeOrErr.get() == "T")) {
1214+
} else if (TypeOrErr.get() == "B") {
12431215
Type = AggregatedLBREntry::BRANCH;
12441216
} else if (TypeOrErr.get() == "F") {
1245-
NeedsConvertRetProfileToCallCont = true;
12461217
Type = AggregatedLBREntry::FT;
12471218
} else if (TypeOrErr.get() == "f") {
1248-
NeedsConvertRetProfileToCallCont = true;
12491219
Type = AggregatedLBREntry::FT_EXTERNAL_ORIGIN;
1250-
} else if (TypeOrErr.get() == "T") {
1251-
// Trace is expanded into B and [Ff]
1252-
Type = AggregatedLBREntry::TRACE;
12531220
} else {
12541221
reportError("expected T, B, F or f");
12551222
return make_error_code(llvm::errc::io_error);

bolt/test/X86/callcont-fallthru.s

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,12 @@
44
# RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
55
## Link against a DSO to ensure PLT entries.
66
# RUN: %clangxx %cxxflags %s %t.so -o %t -Wl,-q -nostdlib
7-
# RUN: link_fdata %s %t %t.pa1 PREAGG1
8-
# RUN: link_fdata %s %t %t.pa2 PREAGG2
9-
# RUN: link_fdata %s %t %t.pa3 PREAGG3
107
# RUN: link_fdata %s %t %t.pat PREAGGT1
118
# RUN: link_fdata %s %t %t.pat2 PREAGGT2
129
# RUN: link_fdata %s %t %t.patplt PREAGGPLT
1310

14-
## Check normal case: fallthrough is not LP or secondary entry.
1511
# RUN: llvm-strip --strip-unneeded %t -o %t.strip
1612
# RUN: llvm-objcopy --remove-section=.eh_frame %t.strip %t.noeh
17-
# RUN: llvm-bolt %t.strip --pa -p %t.pa1 -o %t.out \
18-
# RUN: --print-cfg --print-only=main | FileCheck %s
19-
20-
## Check that getFallthroughsInTrace correctly handles a trace starting at plt
21-
## call continuation
22-
# RUN: llvm-bolt %t.strip --pa -p %t.pa2 -o %t.out2 \
23-
# RUN: --print-cfg --print-only=main | FileCheck %s --check-prefix=CHECK2
24-
25-
## Check that we don't treat secondary entry points as call continuation sites.
26-
# RUN: llvm-bolt %t --pa -p %t.pa3 -o %t.out \
27-
# RUN: --print-cfg --print-only=main | FileCheck %s --check-prefix=CHECK3
28-
29-
## Check fallthrough to a landing pad case.
30-
# RUN: llvm-bolt %t.strip --pa -p %t.pa3 -o %t.out \
31-
# RUN: --print-cfg --print-only=main | FileCheck %s --check-prefix=CHECK3
3213

3314
## Check pre-aggregated traces attach call continuation fallthrough count
3415
# RUN: llvm-bolt %t.noeh --pa -p %t.pat -o %t.out \
@@ -77,7 +58,6 @@ Ltmp0_br:
7758
## Check PLT traces are accepted
7859
# PREAGGPLT: T #Ltmp0_br# #puts@plt# #puts@plt# 3
7960
## Target is an external-origin call continuation
80-
# PREAGG1: B X:0 #Ltmp1# 2 0
8161
# PREAGGT1: T X:0 #Ltmp1# #Ltmp4_br# 2
8262
# CHECK: callq puts@PLT
8363
# CHECK-NEXT: count: 2
@@ -97,18 +77,15 @@ Ltmp4_br:
9777
movl $0xa, -0x18(%rbp)
9878
callq foo
9979
## Target is a binary-local call continuation
100-
# PREAGG1: B #Lfoo_ret# #Ltmp3# 1 0
10180
# PREAGGT1: T #Lfoo_ret# #Ltmp3# #Ltmp3_br# 1
10281
# CHECK: callq foo
10382
# CHECK-NEXT: count: 1
10483

10584
## PLT call continuation fallthrough spanning the call
106-
# PREAGG2: F #Ltmp1# #Ltmp3_br# 3
10785
# CHECK2: callq foo
10886
# CHECK2-NEXT: count: 3
10987

11088
## Target is a secondary entry point (unstripped) or a landing pad (stripped)
111-
# PREAGG3: B X:0 #Ltmp3# 2 0
11289
# PREAGGT2: T X:0 #Ltmp3# #Ltmp3_br# 2
11390
# CHECK3: callq foo
11491
# CHECK3-NEXT: count: 0

clang-tools-extra/Maintainers.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ assistance.
1515
Lead Maintainer
1616
---------------
1717
| Aaron Ballman
18-
| [email protected] (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord), AaronBallman (IRC)
18+
| [email protected] (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord)
1919

2020

2121
clang-tidy
@@ -33,7 +33,7 @@ clang-tidy
3333
clang-query
3434
-----------
3535
| Aaron Ballman
36-
| [email protected] (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord), AaronBallman (IRC)
36+
| [email protected] (email), aaron.ballman (Phabricator), AaronBallman (GitHub), AaronBallman (Discourse), aaronballman (Discord)
3737

3838

3939
clang-doc

clang-tools-extra/clang-change-namespace/ChangeNamespace.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static SourceLocation getStartOfNextLine(SourceLocation Loc,
113113
const SourceManager &SM,
114114
const LangOptions &LangOpts) {
115115
std::unique_ptr<Lexer> Lex = getLexerStartingFromLoc(Loc, SM, LangOpts);
116-
if (!Lex.get())
116+
if (!Lex)
117117
return SourceLocation();
118118
llvm::SmallVector<char, 16> Line;
119119
// FIXME: this is a bit hacky to get ReadToEndOfLine work.
@@ -647,9 +647,8 @@ static SourceLocation getLocAfterNamespaceLBrace(const NamespaceDecl *NsDecl,
647647
const LangOptions &LangOpts) {
648648
std::unique_ptr<Lexer> Lex =
649649
getLexerStartingFromLoc(NsDecl->getBeginLoc(), SM, LangOpts);
650-
assert(Lex.get() &&
651-
"Failed to create lexer from the beginning of namespace.");
652-
if (!Lex.get())
650+
assert(Lex && "Failed to create lexer from the beginning of namespace.");
651+
if (!Lex)
653652
return SourceLocation();
654653
Token Tok;
655654
while (!Lex->LexFromRawLexer(Tok) && Tok.isNot(tok::TokenKind::l_brace)) {

clang-tools-extra/clang-doc/Representation.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ struct CommentInfo {
6060
// the vector.
6161
bool operator<(const CommentInfo &Other) const;
6262

63+
// TODO: The Kind field should be an enum, so we can switch on it easily.
6364
SmallString<16>
6465
Kind; // Kind of comment (FullComment, ParagraphComment, TextComment,
6566
// InlineCommandComment, HTMLStartTagComment, HTMLEndTagComment,
@@ -415,7 +416,13 @@ struct TypedefInfo : public SymbolInfo {
415416

416417
TypeInfo Underlying;
417418

418-
// Inidicates if this is a new C++ "using"-style typedef:
419+
// Underlying type declaration
420+
SmallString<16> TypeDeclaration;
421+
422+
/// Comment description for the typedef.
423+
std::vector<CommentInfo> Description;
424+
425+
// Indicates if this is a new C++ "using"-style typedef:
419426
// using MyVector = std::vector<int>
420427
// False means it's a C-style typedef:
421428
// typedef std::vector<int> MyVector;
@@ -458,7 +465,8 @@ struct EnumValueInfo {
458465
// constant. This will be empty for implicit enumeration values.
459466
SmallString<16> ValueExpr;
460467

461-
std::vector<CommentInfo> Description; /// Comment description of this field.
468+
/// Comment description of this field.
469+
std::vector<CommentInfo> Description;
462470
};
463471

464472
// TODO: Expand to allow for documenting templating.
@@ -527,6 +535,7 @@ struct ClangDocContext {
527535
std::vector<std::string> UserStylesheets;
528536
// JavaScript files that will be imported in all HTML files.
529537
std::vector<std::string> JsScripts;
538+
// Base directory for remote repositories.
530539
StringRef Base;
531540
Index Idx;
532541
};

0 commit comments

Comments
 (0)