Skip to content

Commit ff1b1e9

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-separate-vpirflags
2 parents 1b729db + dcef154 commit ff1b1e9

File tree

2,199 files changed

+77694
-59085
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,199 files changed

+77694
-59085
lines changed

.github/new-prs-labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,9 @@ tools:llvm-exegesis:
709709
- llvm/test/tools/llvm-exegesis/**
710710
- llvm/unittests/tools/llvm-exegesis/**
711711

712+
tools:llvm-reduce:
713+
- llvm/tools/llvm-reduce/**
714+
712715
platform:windows:
713716
- lld/COFF/**
714717
- clang/lib/Driver/MSVC.cpp

bolt/lib/Core/BinaryContext.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2425,6 +2425,10 @@ BinaryContext::createInstructionPatch(uint64_t Address,
24252425

24262426
std::pair<size_t, size_t>
24272427
BinaryContext::calculateEmittedSize(BinaryFunction &BF, bool FixBranches) {
2428+
// Use the original size for non-simple functions.
2429+
if (!BF.isSimple() || BF.isIgnored())
2430+
return std::make_pair(BF.getSize(), 0);
2431+
24282432
// Adjust branch instruction to match the current layout.
24292433
if (FixBranches)
24302434
BF.fixBranches();

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3579,6 +3579,8 @@ bool BinaryFunction::validateCFG() const {
35793579
}
35803580

35813581
void BinaryFunction::fixBranches() {
3582+
assert(isSimple() && "Expected function with valid CFG.");
3583+
35823584
auto &MIB = BC.MIB;
35833585
MCContext *Ctx = BC.Ctx.get();
35843586

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ void DIEBuilder::updateReferences() {
175175
LocExpr.Die.replaceValue(getState().DIEAlloc, LocExpr.Attr, LocExpr.Form,
176176
Value);
177177
}
178-
179-
return;
180178
}
181179

182180
uint32_t DIEBuilder::allocDIE(const DWARFUnit &DU, const DWARFDie &DDie,

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,6 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
783783
Inst.setOpcode(RISCV::ADD);
784784
Inst.insert(Inst.begin(), MCOperand::createReg(Reg));
785785
Inst.insert(Inst.begin() + 1, MCOperand::createReg(RISCV::X0));
786-
return;
787786
}
788787

789788
InstructionListType createLoadImmediate(const MCPhysReg Dest,

bolt/test/RISCV/reloc-label-diff.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ _test_end:
2020
.data
2121
// CHECK: Hex dump of section '.data':
2222
// CHECK: 0x{{.*}} 04000000
23+
.reloc ., R_RISCV_ADD32, _test_end
24+
.reloc ., R_RISCV_SUB32, _start
2325
.word _test_end - _start

bolt/test/RISCV/reorder-blocks-reverse.s

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
.p2align 1
88
_start:
99
nop
10+
.reloc ., R_RISCV_BRANCH, 1f
1011
beq t0, t1, 1f
1112
nop
1213
beq t0, t2, 2f
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Check that fixBranches() is not invoked on a broken CFG which could lead to
2+
## unintended consequences including a firing assertion.
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 --split-functions --split-strategy=cdsplit \
9+
# RUN: --data=%t.fdata --reorder-blocks=ext-tsp 2>&1 | FileCheck %s
10+
11+
# CHECK: internal call detected
12+
13+
.text
14+
15+
.globl foo
16+
.type foo, @function
17+
foo:
18+
ret
19+
.size foo, .-foo
20+
21+
## main contains an internal call. ValidateInternalCalls pass will modify CFG
22+
## (making it invalid) and mark the function as non-simple. After that, we
23+
## cannot make any assumption about the CFG.
24+
25+
.globl main
26+
.type main, @function
27+
main:
28+
call .L1
29+
ret
30+
.L1:
31+
pushq %rbp
32+
movq %rsp, %rbp
33+
movl $1, %edi
34+
LLmain_foo1:
35+
call foo
36+
# FDATA: 1 main #LLmain_foo1# 1 foo 0 0 600
37+
movl $4, %edi
38+
xorl %eax, %eax
39+
popq %rbp
40+
retq
41+
.Lmain_end:
42+
.size main, .Lmain_end-main

clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ int main(int argc, char **argv) {
9696
cl::SetVersionPrinter(printVersion);
9797
cl::ParseCommandLineOptions(argc, argv);
9898

99-
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts(new DiagnosticOptions());
99+
DiagnosticOptions DiagOpts;
100100
DiagnosticsEngine Diagnostics(
101-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts.get());
101+
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts);
102102

103103
// Determine a formatting style from options.
104104
auto FormatStyleOrError = format::getStyle(FormatStyleOpt, FormatStyleConfig,

clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ int main(int argc, const char **argv) {
126126
if (int Result = Tool.run(Factory.get()))
127127
return Result;
128128
LangOptions DefaultLangOptions;
129-
IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
130-
clang::TextDiagnosticPrinter DiagnosticPrinter(errs(), &*DiagOpts);
129+
DiagnosticOptions DiagOpts;
130+
clang::TextDiagnosticPrinter DiagnosticPrinter(errs(), DiagOpts);
131131
DiagnosticsEngine Diagnostics(
132-
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), &*DiagOpts,
132+
IntrusiveRefCntPtr<DiagnosticIDs>(new DiagnosticIDs()), DiagOpts,
133133
&DiagnosticPrinter, false);
134134
auto &FileMgr = Tool.getFiles();
135135
SourceManager Sources(Diagnostics, FileMgr);

0 commit comments

Comments
 (0)