Skip to content

Commit e76f74d

Browse files
author
Pavel V Chupin
committed
Merge from 'main' to 'sycl-web' (96 commits)
2 parents 851741c + ed4e6e0 commit e76f74d

File tree

488 files changed

+22204
-5703
lines changed

Some content is hidden

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

488 files changed

+22204
-5703
lines changed

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ class MCPlusBuilder {
353353
}
354354

355355
virtual bool isUnconditionalBranch(const MCInst &Inst) const {
356-
return Analysis->isUnconditionalBranch(Inst);
356+
return Analysis->isUnconditionalBranch(Inst) && !isTailCall(Inst);
357357
}
358358

359359
virtual bool isIndirectBranch(const MCInst &Inst) const {
@@ -511,11 +511,6 @@ class MCPlusBuilder {
511511
return 0;
512512
}
513513

514-
virtual bool isADD64rr(const MCInst &Inst) const {
515-
llvm_unreachable("not implemented");
516-
return false;
517-
}
518-
519514
virtual bool isSUB(const MCInst &Inst) const {
520515
llvm_unreachable("not implemented");
521516
return false;

bolt/lib/Core/DebugData.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,8 @@ void DebugAbbrevWriter::addUnitAbbreviations(DWARFUnit &Unit) {
820820
auto hashAndAddAbbrev = [&](StringRef AbbrevData) -> bool {
821821
llvm::SHA1 Hasher;
822822
Hasher.update(AbbrevData);
823-
StringRef Key = Hasher.final();
823+
std::array<uint8_t, 20> Hash = Hasher.final();
824+
StringRef Key((const char *)Hash.data(), Hash.size());
824825
auto Iter = AbbrevDataCache.find(Key);
825826
if (Iter != AbbrevDataCache.end()) {
826827
UnitsAbbrevData[&Unit] = Iter->second.get();

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,8 +1103,6 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
11031103

11041104
bool isMoveMem2Reg(const MCInst &Inst) const override { return false; }
11051105

1106-
bool isADD64rr(const MCInst &Inst) const override { return false; }
1107-
11081106
bool isLeave(const MCInst &Inst) const override { return false; }
11091107

11101108
bool isPop(const MCInst &Inst) const override { return false; }

bolt/lib/Target/X86/X86MCPlusBuilder.cpp

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ bool isMOVSX64rm32(const MCInst &Inst) {
6868
return Inst.getOpcode() == X86::MOVSX64rm32;
6969
}
7070

71+
bool isADD64rr(const MCInst &Inst) { return Inst.getOpcode() == X86::ADD64rr; }
72+
73+
bool isADDri(const MCInst &Inst) {
74+
return Inst.getOpcode() == X86::ADD64ri32 ||
75+
Inst.getOpcode() == X86::ADD64ri8;
76+
}
77+
7178
class X86MCPlusBuilder : public MCPlusBuilder {
7279
public:
7380
X86MCPlusBuilder(const MCInstrAnalysis *Analysis, const MCInstrInfo *Info,
@@ -78,10 +85,6 @@ class X86MCPlusBuilder : public MCPlusBuilder {
7885
return Analysis->isBranch(Inst) && !isTailCall(Inst);
7986
}
8087

81-
bool isUnconditionalBranch(const MCInst &Inst) const override {
82-
return Analysis->isUnconditionalBranch(Inst) && !isTailCall(Inst);
83-
}
84-
8588
bool isNoop(const MCInst &Inst) const override {
8689
return X86::isNOP(Inst.getOpcode());
8790
}
@@ -296,19 +299,10 @@ class X86MCPlusBuilder : public MCPlusBuilder {
296299
return 0;
297300
}
298301

299-
bool isADD64rr(const MCInst &Inst) const override {
300-
return Inst.getOpcode() == X86::ADD64rr;
301-
}
302-
303302
bool isSUB(const MCInst &Inst) const override {
304303
return X86::isSUB(Inst.getOpcode());
305304
}
306305

307-
bool isADDri(const MCInst &Inst) const {
308-
return Inst.getOpcode() == X86::ADD64ri32 ||
309-
Inst.getOpcode() == X86::ADD64ri8;
310-
}
311-
312306
bool isLEA64r(const MCInst &Inst) const override {
313307
return Inst.getOpcode() == X86::LEA64r;
314308
}

bolt/test/AArch64/ext-double-jump.s

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This test checks that remove double jumps pass works properly with
2+
# non-local branches.
3+
4+
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
5+
# RUN: %clang %cflags -nostartfiles -nodefaultlibs %t.o -o %t.exe -Wl,-q
6+
# RUN: llvm-bolt %t.exe -o %t.bolt -peepholes=double-jumps
7+
8+
.text
9+
.align 4
10+
.global dummy1
11+
.type dummy1, %function
12+
dummy1:
13+
mov x2, x0
14+
ret
15+
.size dummy1, .-dummy1
16+
17+
.global dummy2
18+
.type dummy2, %function
19+
dummy2:
20+
mov x1, x0
21+
ret
22+
.size dummy2, .-dummy2
23+
24+
.global _start
25+
.type _start, %function
26+
_start:
27+
cbz x10, 1f
28+
b dummy1
29+
1:
30+
b dummy2
31+
.size _start, .-_start

clang-tools-extra/clang-tidy/tool/run-clang-tidy.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def make_absolute(f, directory):
9090

9191
def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
9292
header_filter, allow_enabling_alpha_checkers,
93-
extra_arg, extra_arg_before, quiet, config_path,
93+
extra_arg, extra_arg_before, quiet, config_file_path,
9494
config, line_filter, use_color):
9595
"""Gets a command line for clang-tidy."""
9696
start = [clang_tidy_binary]
@@ -121,8 +121,8 @@ def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
121121
start.append('-p=' + build_path)
122122
if quiet:
123123
start.append('-quiet')
124-
if config_path:
125-
start.append('--config-file=' + config_path)
124+
if config_file_path:
125+
start.append('--config-file=' + config_file_path)
126126
elif config:
127127
start.append('-config=' + config)
128128
start.append(f)
@@ -194,7 +194,7 @@ def run_tidy(args, clang_tidy_binary, tmpdir, build_path, queue, lock,
194194
tmpdir, build_path, args.header_filter,
195195
args.allow_enabling_alpha_checkers,
196196
args.extra_arg, args.extra_arg_before,
197-
args.quiet, args.config_path, args.config,
197+
args.quiet, args.config_file, args.config,
198198
args.line_filter, args.use_color)
199199

200200
proc = subprocess.Popen(invocation, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -304,7 +304,7 @@ def main():
304304
None, build_path, args.header_filter,
305305
args.allow_enabling_alpha_checkers,
306306
args.extra_arg, args.extra_arg_before,
307-
args.quiet, args.config_path, args.config,
307+
args.quiet, args.config_file, args.config,
308308
args.line_filter, args.use_color)
309309
invocation.append('-list-checks')
310310
invocation.append('-')

0 commit comments

Comments
 (0)