Skip to content

Commit b6a0834

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-unroll-replicate-by-vf
2 parents ab6665c + a161268 commit b6a0834

File tree

452 files changed

+10992
-4690
lines changed

Some content is hidden

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

452 files changed

+10992
-4690
lines changed

.ci/compute_projects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
DEPENDENT_RUNTIMES_TO_TEST = {
7878
"clang": {"compiler-rt"},
7979
"clang-tools-extra": {"libc"},
80+
"libc": {"libc"},
8081
".ci": {"compiler-rt", "libc"},
8182
}
8283
DEPENDENT_RUNTIMES_TO_TEST_NEEDS_RECONFIG = {

.ci/compute_projects_test.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def test_top_level_file(self):
187187
self.assertEqual(env_variables["runtimes_check_targets"], "")
188188
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
189189

190-
def test_exclude_runtiems_in_projects(self):
190+
def test_exclude_libcxx_in_projects(self):
191191
env_variables = compute_projects.get_env_variables(
192192
["libcxx/CMakeLists.txt"], "Linux"
193193
)
@@ -197,6 +197,16 @@ def test_exclude_runtiems_in_projects(self):
197197
self.assertEqual(env_variables["runtimes_check_targets"], "")
198198
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
199199

200+
def test_include_libc_in_runtimes(self):
201+
env_variables = compute_projects.get_env_variables(
202+
["libc/CMakeLists.txt"], "Linux"
203+
)
204+
self.assertEqual(env_variables["projects_to_build"], "clang;lld")
205+
self.assertEqual(env_variables["project_check_targets"], "")
206+
self.assertEqual(env_variables["runtimes_to_build"], "libc")
207+
self.assertEqual(env_variables["runtimes_check_targets"], "check-libc")
208+
self.assertEqual(env_variables["runtimes_check_targets_needs_reconfig"], "")
209+
200210
def test_exclude_docs(self):
201211
env_variables = compute_projects.get_env_variables(
202212
["llvm/docs/CIBestPractices.rst"], "Linux"

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,27 +1765,26 @@ Error PrintProgramStats::runOnFunctions(BinaryContext &BC) {
17651765

17661766
if (opts::ShowDensity) {
17671767
double Density = 0.0;
1768-
// Sorted by the density in descending order.
1769-
llvm::stable_sort(FuncDensityList,
1770-
[&](const std::pair<double, uint64_t> &A,
1771-
const std::pair<double, uint64_t> &B) {
1772-
if (A.first != B.first)
1773-
return A.first > B.first;
1774-
return A.second < B.second;
1775-
});
1768+
llvm::sort(FuncDensityList);
17761769

17771770
uint64_t AccumulatedSamples = 0;
1778-
uint32_t I = 0;
17791771
assert(opts::ProfileDensityCutOffHot <= 1000000 &&
17801772
"The cutoff value is greater than 1000000(100%)");
1781-
while (AccumulatedSamples <
1782-
TotalSampleCount *
1783-
static_cast<float>(opts::ProfileDensityCutOffHot) /
1784-
1000000 &&
1785-
I < FuncDensityList.size()) {
1786-
AccumulatedSamples += FuncDensityList[I].second;
1787-
Density = FuncDensityList[I].first;
1788-
I++;
1773+
// Subtract samples in zero-density functions (no fall-throughs) from
1774+
// TotalSampleCount (not used anywhere below).
1775+
for (const auto [CurDensity, CurSamples] : FuncDensityList) {
1776+
if (CurDensity != 0.0)
1777+
break;
1778+
TotalSampleCount -= CurSamples;
1779+
}
1780+
const uint64_t CutoffSampleCount =
1781+
1.f * TotalSampleCount * opts::ProfileDensityCutOffHot / 1000000;
1782+
// Process functions in decreasing density order
1783+
for (const auto [CurDensity, CurSamples] : llvm::reverse(FuncDensityList)) {
1784+
if (AccumulatedSamples >= CutoffSampleCount)
1785+
break;
1786+
AccumulatedSamples += CurSamples;
1787+
Density = CurDensity;
17891788
}
17901789
if (Density == 0.0) {
17911790
BC.errs() << "BOLT-WARNING: the output profile is empty or the "

bolt/test/X86/zero-density.s

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Check that trampoline functions are excluded from density computation.
2+
3+
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
4+
# RUN: ld.lld %t.o -o %t
5+
# RUN: link_fdata %s %t %t.preagg PREAGG
6+
# RUN: llvm-strip -NLjmp %t
7+
# RUN: perf2bolt %t -p %t.preagg --pa -o %t.fdata | FileCheck %s
8+
# CHECK: Functions with density >= {{.*}} account for 99.00% total sample counts.
9+
# CHECK-NOT: the output profile is empty or the --profile-density-cutoff-hot option is set too low.
10+
11+
.text
12+
.globl trampoline
13+
trampoline:
14+
mov main,%rax
15+
jmpq *%rax
16+
.size trampoline,.-trampoline
17+
# PREAGG: f #trampoline# #trampoline# 2
18+
19+
.globl main
20+
main:
21+
.cfi_startproc
22+
vmovaps %zmm31,%zmm3
23+
24+
add $0x4,%r9
25+
add $0x40,%r10
26+
dec %r14
27+
Ljmp:
28+
jne main
29+
# PREAGG: T #Ljmp# #main# #Ljmp# 10
30+
ret
31+
.cfi_endproc
32+
.size main,.-main

bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ f1:
1818
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
1919
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
2020
// CHECK-NEXT: This happens in the following basic block:
21+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
22+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
23+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
24+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
2125
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
2226
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
2327
// CHECK-NEXT: {{[0-9a-f]+}}: ret
@@ -40,6 +44,10 @@ f_intermediate_overwrite1:
4044
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
4145
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
4246
// CHECK-NEXT: This happens in the following basic block:
47+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
48+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
49+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
50+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
4351
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
4452
// CHECK-NEXT: {{[0-9a-f]+}}: autiasp
4553
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -63,6 +71,10 @@ f_intermediate_overwrite2:
6371
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
6472
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x30, x0
6573
// CHECK-NEXT: This happens in the following basic block:
74+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
75+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
76+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
77+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
6678
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
6779
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
6880
// CHECK-NEXT: {{[0-9a-f]+}}: autiasp
@@ -102,6 +114,10 @@ f_intermediate_overwrite3:
102114
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
103115
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w30, w0
104116
// CHECK-NEXT: This happens in the following basic block:
117+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
118+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
119+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
120+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
105121
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
106122
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
107123
// CHECK-NEXT: {{[0-9a-f]+}}: autiasp
@@ -126,6 +142,10 @@ f_nonx30_ret:
126142
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
127143
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x16, x30
128144
// CHECK-NEXT: This happens in the following basic block:
145+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
146+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
147+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
148+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
129149
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
130150
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
131151
// CHECK-NEXT: {{[0-9a-f]+}}: mov x16, x30
@@ -325,6 +345,10 @@ f_autia1716:
325345
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
326346
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
327347
// CHECK-NEXT: This happens in the following basic block:
348+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
349+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
350+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
351+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
328352
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
329353
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
330354
// CHECK-NEXT: {{[0-9a-f]+}}: autia1716
@@ -347,6 +371,10 @@ f_autib1716:
347371
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
348372
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
349373
// CHECK-NEXT: This happens in the following basic block:
374+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
375+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
376+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
377+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
350378
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
351379
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
352380
// CHECK-NEXT: {{[0-9a-f]+}}: autib1716
@@ -369,6 +397,10 @@ f_autiax12:
369397
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
370398
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
371399
// CHECK-NEXT: This happens in the following basic block:
400+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
401+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
402+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
403+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
372404
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
373405
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
374406
// CHECK-NEXT: {{[0-9a-f]+}}: autia x12, sp
@@ -391,6 +423,10 @@ f_autibx12:
391423
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
392424
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
393425
// CHECK-NEXT: This happens in the following basic block:
426+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
427+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
428+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
429+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
394430
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
395431
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
396432
// CHECK-NEXT: {{[0-9a-f]+}}: autib x12, sp
@@ -442,6 +478,10 @@ f_autdax12:
442478
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
443479
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
444480
// CHECK-NEXT: This happens in the following basic block:
481+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
482+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
483+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
484+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
445485
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
446486
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
447487
// CHECK-NEXT: {{[0-9a-f]+}}: autda x12, sp
@@ -464,6 +504,10 @@ f_autdbx12:
464504
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
465505
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
466506
// CHECK-NEXT: This happens in the following basic block:
507+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
508+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
509+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
510+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
467511
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
468512
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
469513
// CHECK-NEXT: {{[0-9a-f]+}}: autdb x12, sp
@@ -515,6 +559,10 @@ f_autizax12:
515559
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
516560
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
517561
// CHECK-NEXT: This happens in the following basic block:
562+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
563+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
564+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
565+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
518566
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
519567
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
520568
// CHECK-NEXT: {{[0-9a-f]+}}: autiza x12
@@ -537,6 +585,10 @@ f_autizbx12:
537585
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
538586
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
539587
// CHECK-NEXT: This happens in the following basic block:
588+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
589+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
590+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
591+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
540592
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
541593
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
542594
// CHECK-NEXT: {{[0-9a-f]+}}: autizb x12
@@ -588,6 +640,10 @@ f_autdzax12:
588640
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
589641
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
590642
// CHECK-NEXT: This happens in the following basic block:
643+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
644+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
645+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
646+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
591647
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
592648
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
593649
// CHECK-NEXT: {{[0-9a-f]+}}: autdza x12
@@ -610,6 +666,10 @@ f_autdzbx12:
610666
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
611667
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
612668
// CHECK-NEXT: This happens in the following basic block:
669+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
670+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
671+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
672+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
613673
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
614674
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
615675
// CHECK-NEXT: {{[0-9a-f]+}}: autdzb x12
@@ -868,6 +928,10 @@ f_autia171615:
868928
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
869929
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
870930
// CHECK-NEXT: This happens in the following basic block:
931+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
932+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
933+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
934+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
871935
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
872936
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
873937
// CHECK-NEXT: {{[0-9a-f]+}}: autia171615
@@ -890,10 +954,20 @@ f_autib171615:
890954
// CHECK-NEXT: The 1 instructions that write to the affected registers after any authentication are:
891955
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
892956
// CHECK-NEXT: This happens in the following basic block:
957+
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
958+
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
959+
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
960+
// CHECK-NEXT: {{[0-9a-f]+}}: bl g
893961
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
894962
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
895963
// CHECK-NEXT: {{[0-9a-f]+}}: autib171615
896964
// CHECK-NEXT: {{[0-9a-f]+}}: ret
897965
ret
898966
.size f_autib171615, .-f_autib171615
899967

968+
.globl g
969+
.type g,@function
970+
g:
971+
nop
972+
ret
973+
.size g, .-g

bolt/utils/nfc-check-setup.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,29 @@
77
import sys
88
import textwrap
99

10+
def get_relevant_bolt_changes(dir: str) -> str:
11+
# Return a list of bolt source changes that are relevant to testing.
12+
all_changes = subprocess.run(
13+
shlex.split("git show HEAD --name-only --pretty=''"),
14+
cwd=dir,
15+
text=True,
16+
stdout=subprocess.PIPE,
17+
)
18+
keep_bolt = subprocess.run(
19+
shlex.split("grep '^bolt'"),
20+
input=all_changes.stdout,
21+
text=True,
22+
stdout=subprocess.PIPE,
23+
)
24+
keep_relevant = subprocess.run(
25+
shlex.split(
26+
"grep -v -e '^bolt/docs' -e '^bolt/utils/docker' -e '^bolt/utils/dot2html'"
27+
),
28+
input=keep_bolt.stdout,
29+
text=True,
30+
stdout=subprocess.PIPE,
31+
)
32+
return keep_relevant.stdout
1033

1134
def get_git_ref_or_rev(dir: str) -> str:
1235
# Run 'git symbolic-ref -q --short HEAD || git rev-parse --short HEAD'
@@ -36,6 +59,12 @@ def main():
3659
default=os.getcwd(),
3760
help="Path to BOLT build directory, default is current " "directory",
3861
)
62+
parser.add_argument(
63+
"--check-bolt-sources",
64+
default=False,
65+
action="store_true",
66+
help="Create a marker file (.llvm-bolt.changes) if any relevant BOLT sources are modified",
67+
)
3968
parser.add_argument(
4069
"--switch-back",
4170
default=False,
@@ -71,6 +100,16 @@ def main():
71100
# memorize the old hash for logging
72101
old_ref = get_git_ref_or_rev(source_dir)
73102

103+
if args.check_bolt_sources:
104+
marker = f"{args.build_dir}/.llvm-bolt.changes"
105+
if os.path.exists(marker):
106+
os.remove(marker)
107+
file_changes = get_relevant_bolt_changes(source_dir)
108+
# Create a marker file if any relevant BOLT source files changed.
109+
if len(file_changes) > 0:
110+
print(f"BOLT source changes were found:\n{file_changes}")
111+
open(marker, "a").close()
112+
74113
# determine whether a stash is needed
75114
stash = subprocess.run(
76115
shlex.split("git status --porcelain"),

clang/bindings/python/tests/cindex/test_file.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
inputs_dir = os.path.join(os.path.dirname(__file__), "INPUTS")
1111

12+
1213
class TestFile(unittest.TestCase):
1314
def test_file(self):
1415
index = Index.create()

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ C Language Changes
222222
223223
char buf1[3] = "foo"; // -Wunterminated-string-initialization
224224
char buf2[3] = "flarp"; // -Wexcess-initializers
225+
char buf3[3] = "fo\0"; // This is fine, no warning.
225226
226227
This diagnostic can be suppressed by adding the new ``nonstring`` attribute
227228
to the field or variable being initialized. #GH137705

clang/include/clang/Basic/BuiltinsAArch64.def

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ TARGET_HEADER_BUILTIN(_InterlockedIncrement64, "LLiLLiD*", "nh", INTRIN_H,
155155
TARGET_HEADER_BUILTIN(_InterlockedOr64, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
156156
TARGET_HEADER_BUILTIN(_InterlockedXor64, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
157157

158+
TARGET_HEADER_BUILTIN(_InterlockedAdd_acq, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
159+
TARGET_HEADER_BUILTIN(_InterlockedAdd_rel, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
160+
TARGET_HEADER_BUILTIN(_InterlockedAdd_nf, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
161+
TARGET_HEADER_BUILTIN(_InterlockedAdd64_acq, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
162+
TARGET_HEADER_BUILTIN(_InterlockedAdd64_rel, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
163+
TARGET_HEADER_BUILTIN(_InterlockedAdd64_nf, "LLiLLiD*LLi", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
164+
158165
TARGET_HEADER_BUILTIN(_InterlockedExchangeAdd_acq, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
159166
TARGET_HEADER_BUILTIN(_InterlockedExchangeAdd_rel, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")
160167
TARGET_HEADER_BUILTIN(_InterlockedExchangeAdd_nf, "NiNiD*Ni", "nh", INTRIN_H, ALL_MS_LANGUAGES, "")

0 commit comments

Comments
 (0)