Skip to content

Commit 519bf7b

Browse files
Merge remote-tracking branch 'upstream/main' into vinay-issue-119281-misc
2 parents 56c7755 + 6b654a0 commit 519bf7b

File tree

1,477 files changed

+106378
-24778
lines changed

Some content is hidden

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

1,477 files changed

+106378
-24778
lines changed

.ci/metrics/metrics.py

Lines changed: 38 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -130,34 +130,6 @@ def get_per_workflow_metrics(
130130
workflow_jobs = workflow_run.jobs()
131131
if workflow_jobs.totalCount == 0:
132132
continue
133-
if workflow_jobs.totalCount > 1:
134-
raise ValueError(
135-
f"Encountered an unexpected number of jobs: {workflow_jobs.totalCount}"
136-
)
137-
138-
created_at = workflow_jobs[0].created_at
139-
started_at = workflow_jobs[0].started_at
140-
completed_at = workflow_jobs[0].completed_at
141-
142-
job_result = int(workflow_jobs[0].conclusion == "success")
143-
if job_result:
144-
# We still might want to mark the job as a failure if one of the steps
145-
# failed. This is required due to use setting continue-on-error in
146-
# the premerge pipeline to prevent sending emails while we are
147-
# testing the infrastructure.
148-
# TODO(boomanaiden154): Remove this once the premerge pipeline is no
149-
# longer in a testing state and we can directly assert the workflow
150-
# result.
151-
for step in workflow_jobs[0].steps:
152-
if step.conclusion != "success":
153-
job_result = 0
154-
break
155-
156-
queue_time = started_at - created_at
157-
run_time = completed_at - started_at
158-
159-
if run_time.seconds == 0:
160-
continue
161133

162134
if (
163135
workflows_to_track[workflow_run.name] is None
@@ -170,20 +142,45 @@ def get_per_workflow_metrics(
170142
):
171143
break
172144

173-
# The timestamp associated with the event is expected by Grafana to be
174-
# in nanoseconds.
175-
created_at_ns = int(created_at.timestamp()) * 10**9
176-
177-
workflow_metrics.append(
178-
JobMetrics(
179-
workflow_run.name,
180-
queue_time.seconds,
181-
run_time.seconds,
182-
job_result,
183-
created_at_ns,
184-
workflow_run.id,
145+
for workflow_job in workflow_jobs:
146+
created_at = workflow_job.created_at
147+
started_at = workflow_job.started_at
148+
completed_at = workflow_job.completed_at
149+
150+
job_result = int(workflow_job.conclusion == "success")
151+
if job_result:
152+
# We still might want to mark the job as a failure if one of the steps
153+
# failed. This is required due to use setting continue-on-error in
154+
# the premerge pipeline to prevent sending emails while we are
155+
# testing the infrastructure.
156+
# TODO(boomanaiden154): Remove this once the premerge pipeline is no
157+
# longer in a testing state and we can directly assert the workflow
158+
# result.
159+
for step in workflow_job.steps:
160+
if step.conclusion != "success":
161+
job_result = 0
162+
break
163+
164+
queue_time = started_at - created_at
165+
run_time = completed_at - started_at
166+
167+
if run_time.seconds == 0:
168+
continue
169+
170+
# The timestamp associated with the event is expected by Grafana to be
171+
# in nanoseconds.
172+
created_at_ns = int(created_at.timestamp()) * 10**9
173+
174+
workflow_metrics.append(
175+
JobMetrics(
176+
workflow_run.name + "-" + workflow_job.name,
177+
queue_time.seconds,
178+
run_time.seconds,
179+
job_result,
180+
created_at_ns,
181+
workflow_run.id,
182+
)
185183
)
186-
)
187184

188185
return workflow_metrics
189186

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
'generic-cxx26',
4949
'generic-modules'
5050
]
51-
cc: [ 'clang-19' ]
52-
cxx: [ 'clang++-19' ]
51+
cc: [ 'clang-20' ]
52+
cxx: [ 'clang++-20' ]
5353
include:
5454
- config: 'generic-gcc'
5555
cc: 'gcc-14'
@@ -88,18 +88,18 @@ jobs:
8888
'generic-cxx20',
8989
'generic-cxx23'
9090
]
91-
cc: [ 'clang-19' ]
92-
cxx: [ 'clang++-19' ]
91+
cc: [ 'clang-20' ]
92+
cxx: [ 'clang++-20' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
9595
cc: 'gcc-14'
9696
cxx: 'g++-14'
9797
- config: 'generic-cxx23'
98-
cc: 'clang-17'
99-
cxx: 'clang++-17'
100-
- config: 'generic-cxx26'
10198
cc: 'clang-18'
10299
cxx: 'clang++-18'
100+
- config: 'generic-cxx26'
101+
cc: 'clang-19'
102+
cxx: 'clang++-19'
103103
steps:
104104
- uses: actions/checkout@v4
105105
- name: ${{ matrix.config }}
@@ -169,8 +169,8 @@ jobs:
169169
- name: ${{ matrix.config }}
170170
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
171171
env:
172-
CC: clang-19
173-
CXX: clang++-19
172+
CC: clang-20
173+
CXX: clang++-20
174174
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
175175
if: always()
176176
with:

.github/workflows/premerge.yaml

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
if: github.repository_owner == 'llvm'
1717
runs-on: llvm-premerge-linux-runners
1818
concurrency:
19-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
19+
group: ${{ github.workflow }}-linux-${{ github.event.pull_request.number || github.sha }}
2020
cancel-in-progress: true
2121
steps:
2222
- name: Checkout LLVM
@@ -70,3 +70,65 @@ jobs:
7070
export CXX=/opt/llvm/bin/clang++
7171
7272
./.ci/monolithic-linux.sh "$(echo ${linux_projects} | tr ' ' ';')" "$(echo ${linux_check_targets})" "$(echo ${linux_runtimes} | tr ' ' ';')" "$(echo ${linux_runtime_check_targets})"
73+
74+
premerge-checks-windows:
75+
if: github.repository_owner == 'llvm'
76+
runs-on: llvm-premerge-windows-runners
77+
concurrency:
78+
group: ${{ github.workflow }}-windows-${{ github.event.pull_request.number || github.sha }}
79+
cancel-in-progress: true
80+
defaults:
81+
run:
82+
shell: bash
83+
steps:
84+
- name: Checkout LLVM
85+
uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 2
88+
- name: Setup ccache
89+
uses: hendrikmuhs/[email protected]
90+
with:
91+
variant: "sccache"
92+
max-size: "2000M"
93+
- name: Compute Projects
94+
id: vars
95+
run: |
96+
modified_files=$(git diff --name-only HEAD~1...HEAD)
97+
modified_dirs=$(echo "$modified_files" | cut -d'/' -f1 | sort | uniq)
98+
99+
echo $modified_files
100+
echo $modified_dirs
101+
102+
. ./.ci/compute-projects.sh
103+
104+
all_projects="bolt clang clang-tools-extra compiler-rt cross-project-tests flang libc libclc lld lldb llvm mlir openmp polly pstl"
105+
modified_projects="$(keep-modified-projects ${all_projects})"
106+
107+
windows_projects_to_test=$(exclude-windows $(compute-projects-to-test 1 ${modified_projects}))
108+
windows_check_targets=$(check-targets ${windows_projects_to_test} | sort | uniq | tr -d '\r' | tr '\n' ' ')
109+
windows_projects=$(add-dependencies ${windows_projects_to_test} | sort | uniq | tr -d '\r' | tr '\n' ';')
110+
111+
if [[ "${windows_projects}" == "" ]]; then
112+
echo "No projects to build"
113+
fi
114+
115+
echo "Building projects: ${windows_projects}"
116+
echo "Running project checks targets: ${windows_check_targets}"
117+
118+
echo "windows-projects=${windows_projects}" >> $GITHUB_OUTPUT
119+
echo "windows-check-targets=${windows_check_targets}" >> $GITHUB_OUTPUT
120+
- name: Build and Test
121+
# Mark the job as a success even if the step fails so that people do
122+
# not get notified while the new premerge pipeline is in an
123+
# experimental state.
124+
# TODO(boomanaiden154): Remove this once the pipeline is stable and we
125+
# are ready for people to start recieving notifications.
126+
continue-on-error: true
127+
if: ${{ steps.vars.outputs.windows-projects != '' }}
128+
shell: cmd
129+
run: |
130+
set MAX_PARALLEL_COMPILE_JOBS=64
131+
set MAX_PARALLEL_LINK_JOBS=64
132+
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
133+
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
134+

.github/workflows/release-binaries-all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
matrix:
8484
runs-on:
8585
- ubuntu-22.04
86+
- ubuntu-22.04-arm
8687
- macos-13
8788
- macos-14
8889

.github/workflows/release-binaries.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
type: choice
1919
options:
2020
- ubuntu-22.04
21+
- ubuntu-22.04-arm
2122
- macos-13
2223
- macos-14
2324

@@ -55,6 +56,7 @@ jobs:
5556
ref: ${{ steps.vars.outputs.ref }}
5657
upload: ${{ steps.vars.outputs.upload }}
5758
target-cmake-flags: ${{ steps.vars.outputs.target-cmake-flags }}
59+
ccache: ${{ steps.vars.outputs.ccache }}
5860
build-flang: ${{ steps.vars.outputs.build-flang }}
5961
enable-pgo: ${{ steps.vars.outputs.enable-pgo }}
6062
release-binary-basename: ${{ steps.vars.outputs.release-binary-basename }}
@@ -119,8 +121,16 @@ jobs:
119121
echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT
120122
echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT
121123
122-
# Detect necessary CMake flags
123124
target="$RUNNER_OS-$RUNNER_ARCH"
125+
# The hendrikmuhs/ccache-action action does not support installing sccache
126+
# on arm64 Linux.
127+
if [ "$target" = "Linux-ARM64" ]; then
128+
echo ccache=ccache >> $GITHUB_OUTPUT
129+
else
130+
echo ccache=sccache >> $GITHUB_OUTPUT
131+
fi
132+
133+
# Detect necessary CMake flags
124134
echo "enable-pgo=false" >> $GITHUB_OUTPUT
125135
target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF"
126136
# The macOS builds try to cross compile some libraries so we need to
@@ -146,7 +156,7 @@ jobs:
146156
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
147157
echo "build-flang=$build_flang" >> $GITHUB_OUTPUT
148158
case "${{ inputs.runs-on }}" in
149-
ubuntu-22.04)
159+
ubuntu-22.04*)
150160
build_runs_on="depot-${{ inputs.runs-on }}-16"
151161
test_runs_on=$build_runs_on
152162
;;
@@ -221,12 +231,14 @@ jobs:
221231
with:
222232
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
223233
max-size: 2G
224-
key: sccache-${{ runner.os }}-${{ runner.arch }}-release
225-
variant: sccache
234+
key: ${{ needs.prepare.outputs.ccache }}-${{ runner.os }}-${{ runner.arch }}-release
235+
variant: ${{ needs.prepare.outputs.ccache }}
226236

227237
- name: Configure
228238
id: build
229239
shell: bash
240+
env:
241+
CCACHE_BIN: ${{ needs.prepare.outputs.ccache }}
230242
run: |
231243
# There were some issues on the ARM64 MacOS runners with trying to build x86 object,
232244
# so we need to set some extra cmake flags to disable this.
@@ -235,8 +247,8 @@ jobs:
235247
-C clang/cmake/caches/Release.cmake \
236248
-DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \
237249
-DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \
238-
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
239-
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
250+
-DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_BIN \
251+
-DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_BIN
240252
- name: Build
241253
shell: bash
242254
run: |

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,6 @@ BinaryFunction::processIndirectBranch(MCInst &Instruction, unsigned Size,
795795

796796
auto Begin = Instructions.begin();
797797
if (BC.isAArch64()) {
798-
PreserveNops = BC.HasRelocations;
799798
// Start at the last label as an approximation of the current basic block.
800799
// This is a heuristic, since the full set of labels have yet to be
801800
// determined
@@ -2300,6 +2299,10 @@ Error BinaryFunction::buildCFG(MCPlusBuilder::AllocatorIdTy AllocatorId) {
23002299
BC.errs() << "BOLT-WARNING: failed to post-process indirect branches for "
23012300
<< *this << '\n';
23022301
}
2302+
2303+
if (BC.isAArch64())
2304+
PreserveNops = BC.HasRelocations;
2305+
23032306
// In relocation mode we want to keep processing the function but avoid
23042307
// optimizing it.
23052308
setSimple(false);

bolt/test/AArch64/remove-nops.s

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Verify that llvm-bolt removes nop instructions from functions with indirect
2+
## branches that have defined control flow.
3+
4+
# REQUIRES: system-linux
5+
6+
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
7+
# RUN: %clang %cflags --target=aarch64-unknown-linux %t.o -o %t.exe -Wl,-q
8+
# RUN: llvm-bolt %t.exe -o %t.bolt --print-normalized 2>&1 | FileCheck %s
9+
# RUN: llvm-objdump -d --disassemble-symbols=_start %t.bolt \
10+
# RUN: | FileCheck %s --check-prefix=CHECK-OBJDUMP
11+
12+
# CHECK-OBJDUMP-LABEL: _start
13+
# CHECK-OBJDUMP-NOT: nop
14+
15+
.section .text
16+
.align 4
17+
.globl _start
18+
.type _start, %function
19+
_start:
20+
# CHECK-LABEL: Binary Function "_start"
21+
nop
22+
# CHECK-NOT: nop
23+
br x0
24+
# CHECK: br x0 # TAILCALL
25+
.size _start, .-_start
26+
27+
## Force relocation mode.
28+
.reloc 0, R_AARCH64_NONE

clang-tools-extra/clangd/Diagnostics.cpp

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,17 @@ std::vector<Diag> StoreDiags::take(const clang::tidy::ClangTidyContext *Tidy) {
577577
for (auto &Diag : Output) {
578578
if (const char *ClangDiag = getDiagnosticCode(Diag.ID)) {
579579
// Warnings controlled by -Wfoo are better recognized by that name.
580-
StringRef Warning = DiagnosticIDs::getWarningOptionForDiag(Diag.ID);
580+
StringRef Warning = [&] {
581+
if (OrigSrcMgr) {
582+
return OrigSrcMgr->getDiagnostics()
583+
.getDiagnosticIDs()
584+
->getWarningOptionForDiag(Diag.ID);
585+
}
586+
if (!DiagnosticIDs::IsCustomDiag(Diag.ID))
587+
return DiagnosticIDs{}.getWarningOptionForDiag(Diag.ID);
588+
return StringRef{};
589+
}();
590+
581591
if (!Warning.empty()) {
582592
Diag.Name = ("-W" + Warning).str();
583593
} else {
@@ -894,20 +904,23 @@ void StoreDiags::flushLastDiag() {
894904
Output.push_back(std::move(*LastDiag));
895905
}
896906

897-
bool isBuiltinDiagnosticSuppressed(unsigned ID,
898-
const llvm::StringSet<> &Suppress,
899-
const LangOptions &LangOpts) {
907+
bool isDiagnosticSuppressed(const clang::Diagnostic &Diag,
908+
const llvm::StringSet<> &Suppress,
909+
const LangOptions &LangOpts) {
900910
// Don't complain about header-only stuff in mainfiles if it's a header.
901911
// FIXME: would be cleaner to suppress in clang, once we decide whether the
902912
// behavior should be to silently-ignore or respect the pragma.
903-
if (ID == diag::pp_pragma_sysheader_in_main_file && LangOpts.IsHeaderFile)
913+
if (Diag.getID() == diag::pp_pragma_sysheader_in_main_file &&
914+
LangOpts.IsHeaderFile)
904915
return true;
905916

906-
if (const char *CodePtr = getDiagnosticCode(ID)) {
917+
if (const char *CodePtr = getDiagnosticCode(Diag.getID())) {
907918
if (Suppress.contains(normalizeSuppressedCode(CodePtr)))
908919
return true;
909920
}
910-
StringRef Warning = DiagnosticIDs::getWarningOptionForDiag(ID);
921+
StringRef Warning =
922+
Diag.getDiags()->getDiagnosticIDs()->getWarningOptionForDiag(
923+
Diag.getID());
911924
if (!Warning.empty() && Suppress.contains(Warning))
912925
return true;
913926
return false;

0 commit comments

Comments
 (0)