Skip to content

Commit d8076d5

Browse files
authored
Merge branch 'main' into nvptx-symbol-transform
2 parents 7e0ec5a + 5c94dd7 commit d8076d5

File tree

2,633 files changed

+125934
-37505
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,633 files changed

+125934
-37505
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ jobs:
146146
'generic-no-experimental',
147147
'generic-no-filesystem',
148148
'generic-no-localization',
149+
'generic-no-terminal',
149150
'generic-no-random_device',
150151
'generic-no-threads',
151152
'generic-no-tzdb',

.mailmap

Lines changed: 1 addition & 1 deletion

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2502,7 +2502,7 @@ void BinaryFunction::annotateCFIState() {
25022502
}
25032503
}
25042504

2505-
if (!StateStack.empty()) {
2505+
if (opts::Verbosity >= 1 && !StateStack.empty()) {
25062506
BC.errs() << "BOLT-WARNING: non-empty CFI stack at the end of " << *this
25072507
<< '\n';
25082508
}

bolt/lib/Core/BinaryFunctionProfile.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ void BinaryFunction::inferFallThroughCounts() {
336336
if (SuccBI.Count == 0) {
337337
SuccBI.Count = Inferred;
338338
SuccBI.MispredictedCount = BinaryBasicBlock::COUNT_INFERRED;
339-
Succ->ExecutionCount += Inferred;
339+
Succ->ExecutionCount =
340+
std::max(Succ->getKnownExecutionCount(), Inferred);
340341
}
341342
}
342343
}

bolt/test/X86/end-symbol.test

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# RUN: yaml2obj %p/Inputs/plt-sec.yaml &> %t.exe
22
# RUN: llvm-bolt %t.exe -o %t.out
3-
# RUN: (llvm-readelf --program-headers %t.out | grep LOAD | tail -n 1 ; llvm-nm %t.out) \
4-
# RUN: | FileCheck %s
3+
4+
# RUN: llvm-readelf --program-headers %t.out | grep LOAD | tail -n 1 > %t.load
5+
# RUN: llvm-nm %t.out >> %t.load
6+
# RUN: FileCheck %s < %t.load
57

68
## Check that llvm-bolt correctly updates _end symbol to match the end of the
79
## last loadable segment.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Test that infer-fall-throughs would correctly infer the wrong fall-through
2+
## edge count in the example
3+
4+
# RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o
5+
# RUN: link_fdata %s %t.o %t.fdata
6+
# RUN: llvm-strip --strip-unneeded %t.o
7+
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
8+
# RUN: llvm-bolt %t.exe -o %t.bolt \
9+
# RUN: --print-estimate-edge-counts --data=%t.fdata \
10+
# RUN: 2>&1 | FileCheck --check-prefix=WITHOUTINFERENCE %s
11+
# RUN: llvm-bolt %t.exe -o %t.bolt --infer-fall-throughs \
12+
# RUN: --print-estimate-edge-counts --data=%t.fdata \
13+
# RUN: 2>&1 | FileCheck --check-prefix=CORRECTINFERENCE %s
14+
15+
16+
# WITHOUTINFERENCE: Binary Function "main" after estimate-edge-counts
17+
# WITHOUTINFERENCE: {{^\.Ltmp0}}
18+
# WITHOUTINFERENCE: Successors: .Ltmp1 (mispreds: 0, count: 10), .LFT0 (mispreds: 0, count: 0)
19+
# WITHOUTINFERENCE: {{^\.LFT0}}
20+
# WITHOUTINFERENCE: Exec Count : 490
21+
22+
# CORRECTINFERENCE: Binary Function "main" after estimate-edge-counts
23+
# CORRECTINFERENCE: {{^\.Ltmp0}}
24+
# CORRECTINFERENCE: Successors: .Ltmp1 (mispreds: 0, count: 10), .LFT0 (inferred count: 490)
25+
# CORRECTINFERENCE: {{^\.LFT0}}
26+
# CORRECTINFERENCE: Exec Count : 490
27+
28+
29+
.globl main
30+
.type main, @function
31+
main:
32+
LLmain_LLstart:
33+
jmp LLstart
34+
# FDATA: 1 main #LLmain_LLstart# 1 main #LLstart# 0 500
35+
LLstart:
36+
jge LLexit
37+
# FDATA: 1 main #LLstart# 1 main #LLexit# 0 10
38+
# FDATA: 1 main #LLstart# 1 main #LLmore# 0 0
39+
LLmore:
40+
movl $5, %eax
41+
# FDATA: 1 main #LLmore# 1 main #LLexit# 0 490
42+
LLexit:
43+
ret
44+
.LLmain_end:
45+
.size main, .LLmain_end-main

bolt/test/X86/instrumentation-eh_frame_hdr.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
// RUN: %clangxx %cxxflags -static -Wl,-q %s -o %t.exe -Wl,--entry=_start
77
// RUN: llvm-bolt %t.exe -o %t.instr -instrument \
88
// RUN: --instrumentation-file=%t.fdata -instrumentation-sleep-time=1
9-
// RUN: (llvm-readelf -SW %t.instr | grep -v bolt; llvm-readelf -lW %t.instr | \
10-
// RUN: grep LOAD | tail -n 1) | FileCheck %s
9+
// RUN: llvm-readelf -SW %t.instr | grep -v bolt > %t.sections
10+
// RUN: llvm-readelf -lW %t.instr | grep LOAD | tail -n 1 >> %t.sections
11+
// RUN: FileCheck %s < %t.sections
1112

1213
// CHECK: {{.*}} .eh_frame_hdr PROGBITS [[#%x, EH_ADDR:]]
1314
// CHECK: LOAD 0x[[#%x, LD_OFFSET:]] 0x[[#%x, LD_VADDR:]] 0x[[#%x, LD_FSIZE:]]

clang-tools-extra/clang-doc/HTMLGenerator.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,19 @@ static std::unique_ptr<HTMLNode> genHTML(const CommentInfo &I) {
678678
return std::move(ParagraphComment);
679679
}
680680

681+
if (I.Kind == "BlockCommandComment") {
682+
auto BlockComment = std::make_unique<TagNode>(HTMLTag::TAG_DIV);
683+
BlockComment->Children.emplace_back(
684+
std::make_unique<TagNode>(HTMLTag::TAG_DIV, I.Name));
685+
for (const auto &Child : I.Children) {
686+
std::unique_ptr<HTMLNode> Node = genHTML(*Child);
687+
if (Node)
688+
BlockComment->Children.emplace_back(std::move(Node));
689+
}
690+
if (BlockComment->Children.empty())
691+
return nullptr;
692+
return std::move(BlockComment);
693+
}
681694
if (I.Kind == "TextComment") {
682695
if (I.Text == "")
683696
return nullptr;

clang-tools-extra/clang-tidy/modernize/UseStdFormatCheck.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ void UseStdFormatCheck::registerMatchers(MatchFinder *Finder) {
5050
Finder->addMatcher(
5151
callExpr(argumentCountAtLeast(1),
5252
hasArgument(0, stringLiteral(isOrdinary())),
53-
callee(functionDecl(unless(cxxMethodDecl()),
54-
matchers::matchesAnyListedName(
53+
callee(functionDecl(matchers::matchesAnyListedName(
5554
StrFormatLikeFunctions))
5655
.bind("func_decl")))
5756
.bind("strformat"),
@@ -93,7 +92,8 @@ void UseStdFormatCheck::check(const MatchFinder::MatchResult &Result) {
9392
diag(StrFormatCall->getBeginLoc(), "use '%0' instead of %1")
9493
<< ReplacementFormatFunction << OldFunction->getIdentifier();
9594
Diag << FixItHint::CreateReplacement(
96-
CharSourceRange::getTokenRange(StrFormatCall->getSourceRange()),
95+
CharSourceRange::getTokenRange(StrFormatCall->getExprLoc(),
96+
StrFormatCall->getEndLoc()),
9797
ReplacementFormatFunction);
9898
Converter.applyFixes(Diag, *Result.SourceManager);
9999

clang-tools-extra/clang-tidy/modernize/UseStdPrintCheck.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ void UseStdPrintCheck::registerMatchers(MatchFinder *Finder) {
100100
unusedReturnValue(
101101
callExpr(argumentCountAtLeast(1),
102102
hasArgument(0, stringLiteral(isOrdinary())),
103-
callee(functionDecl(unless(cxxMethodDecl()),
104-
matchers::matchesAnyListedName(
103+
callee(functionDecl(matchers::matchesAnyListedName(
105104
PrintfLikeFunctions))
106105
.bind("func_decl")))
107106
.bind("printf")),
@@ -112,8 +111,7 @@ void UseStdPrintCheck::registerMatchers(MatchFinder *Finder) {
112111
unusedReturnValue(
113112
callExpr(argumentCountAtLeast(2),
114113
hasArgument(1, stringLiteral(isOrdinary())),
115-
callee(functionDecl(unless(cxxMethodDecl()),
116-
matchers::matchesAnyListedName(
114+
callee(functionDecl(matchers::matchesAnyListedName(
117115
FprintfLikeFunctions))
118116
.bind("func_decl")))
119117
.bind("fprintf")),
@@ -152,7 +150,7 @@ void UseStdPrintCheck::check(const MatchFinder::MatchResult &Result) {
152150
<< ReplacementFunction << OldFunction->getIdentifier();
153151

154152
Diag << FixItHint::CreateReplacement(
155-
CharSourceRange::getTokenRange(PrintfCall->getBeginLoc(),
153+
CharSourceRange::getTokenRange(PrintfCall->getExprLoc(),
156154
PrintfCall->getEndLoc()),
157155
ReplacementFunction);
158156
Converter.applyFixes(Diag, *Result.SourceManager);

0 commit comments

Comments
 (0)