Skip to content

Commit 6ab16e6

Browse files
committed
Merge branch 'susant/firaa' of github.com:SusanTan/llvm-project into susant/firaa
2 parents b031c9b + 89eb3b3 commit 6ab16e6

File tree

1,703 files changed

+50126
-21736
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,703 files changed

+50126
-21736
lines changed

.ci/metrics/metrics.py

Lines changed: 53 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class JobMetrics:
2424
status: int
2525
created_at_ns: int
2626
workflow_id: int
27+
workflow_name: str
2728

2829

2930
@dataclass
@@ -43,40 +44,60 @@ def get_sampled_workflow_metrics(github_repo: github.Repository):
4344
Returns a list of GaugeMetric objects, containing the relevant metrics about
4445
the workflow
4546
"""
47+
queued_job_counts = {}
48+
running_job_counts = {}
4649

4750
# Other states are available (pending, waiting, etc), but the meaning
4851
# is not documented (See #70540).
4952
# "queued" seems to be the info we want.
50-
queued_workflow_count = len(
51-
[
52-
x
53-
for x in github_repo.get_workflow_runs(status="queued")
54-
if x.name in WORKFLOWS_TO_TRACK
55-
]
56-
)
57-
running_workflow_count = len(
58-
[
59-
x
60-
for x in github_repo.get_workflow_runs(status="in_progress")
61-
if x.name in WORKFLOWS_TO_TRACK
62-
]
63-
)
53+
for queued_workflow in github_repo.get_workflow_runs(status="queued"):
54+
if queued_workflow.name not in WORKFLOWS_TO_TRACK:
55+
continue
56+
for queued_workflow_job in queued_workflow.jobs():
57+
job_name = queued_workflow_job.name
58+
# Workflows marked as queued can potentially only have some jobs
59+
# queued, so make sure to also count jobs currently in progress.
60+
if queued_workflow_job.status == "queued":
61+
if job_name not in queued_job_counts:
62+
queued_job_counts[job_name] = 1
63+
else:
64+
queued_job_counts[job_name] += 1
65+
elif queued_workflow_job.status == "in_progress":
66+
if job_name not in running_job_counts:
67+
running_job_counts[job_name] = 1
68+
else:
69+
running_job_counts[job_name] += 1
70+
71+
for running_workflow in github_repo.get_workflow_runs(status="in_progress"):
72+
if running_workflow.name not in WORKFLOWS_TO_TRACK:
73+
continue
74+
for running_workflow_job in running_workflow.jobs():
75+
job_name = running_workflow_job.name
76+
if running_workflow_job.status != "in_progress":
77+
continue
78+
79+
if job_name not in running_job_counts:
80+
running_job_counts[job_name] = 1
81+
else:
82+
running_job_counts[job_name] += 1
6483

6584
workflow_metrics = []
66-
workflow_metrics.append(
67-
GaugeMetric(
68-
"workflow_queue_size",
69-
queued_workflow_count,
70-
time.time_ns(),
85+
for queued_job in queued_job_counts:
86+
workflow_metrics.append(
87+
GaugeMetric(
88+
f"workflow_queue_size_{queued_job}",
89+
queued_job_counts[queued_job],
90+
time.time_ns(),
91+
)
7192
)
72-
)
73-
workflow_metrics.append(
74-
GaugeMetric(
75-
"running_workflow_count",
76-
running_workflow_count,
77-
time.time_ns(),
93+
for running_job in running_job_counts:
94+
workflow_metrics.append(
95+
GaugeMetric(
96+
f"running_workflow_count_{running_job}",
97+
running_job_counts[running_job],
98+
time.time_ns(),
99+
)
78100
)
79-
)
80101
# Always send a hearbeat metric so we can monitor is this container is still able to log to Grafana.
81102
workflow_metrics.append(
82103
GaugeMetric("metrics_container_heartbeat", 1, time.time_ns())
@@ -157,7 +178,7 @@ def get_per_workflow_metrics(
157178
# longer in a testing state and we can directly assert the workflow
158179
# result.
159180
for step in workflow_job.steps:
160-
if step.conclusion != "success":
181+
if step.conclusion != "success" and step.conclusion != "skipped":
161182
job_result = 0
162183
break
163184

@@ -179,6 +200,7 @@ def get_per_workflow_metrics(
179200
job_result,
180201
created_at_ns,
181202
workflow_run.id,
203+
workflow_run.name,
182204
)
183205
)
184206

@@ -235,8 +257,6 @@ def upload_metrics(workflow_metrics, metrics_userid, api_key):
235257
def main():
236258
# Authenticate with Github
237259
auth = Auth.Token(os.environ["GITHUB_TOKEN"])
238-
github_object = Github(auth=auth)
239-
github_repo = github_object.get_repo("llvm/llvm-project")
240260

241261
grafana_api_key = os.environ["GRAFANA_API_KEY"]
242262
grafana_metrics_userid = os.environ["GRAFANA_METRICS_USERID"]
@@ -248,20 +268,19 @@ def main():
248268
# Enter the main loop. Every five minutes we wake up and dump metrics for
249269
# the relevant jobs.
250270
while True:
271+
github_object = Github(auth=auth)
272+
github_repo = github_object.get_repo("llvm/llvm-project")
273+
251274
current_metrics = get_per_workflow_metrics(github_repo, workflows_to_track)
252275
current_metrics += get_sampled_workflow_metrics(github_repo)
253-
# Always send a hearbeat metric so we can monitor is this container is still able to log to Grafana.
254-
current_metrics.append(
255-
GaugeMetric("metrics_container_heartbeat", 1, time.time_ns())
256-
)
257276

258277
upload_metrics(current_metrics, grafana_metrics_userid, grafana_api_key)
259278
print(f"Uploaded {len(current_metrics)} metrics", file=sys.stderr)
260279

261280
for workflow_metric in reversed(current_metrics):
262281
if isinstance(workflow_metric, JobMetrics):
263282
workflows_to_track[
264-
workflow_metric.job_name
283+
workflow_metric.workflow_name
265284
] = workflow_metric.workflow_id
266285

267286
time.sleep(SCRAPE_INTERVAL_SECONDS)

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
3939
runs-on: libcxx-self-hosted-linux
40-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
40+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
4141
continue-on-error: false
4242
strategy:
4343
fail-fast: false
@@ -48,8 +48,8 @@ jobs:
4848
'generic-cxx26',
4949
'generic-modules'
5050
]
51-
cc: [ 'clang-20' ]
52-
cxx: [ 'clang++-20' ]
51+
cc: [ 'clang-21' ]
52+
cxx: [ 'clang++-21' ]
5353
include:
5454
- config: 'generic-gcc'
5555
cc: 'gcc-14'
@@ -75,7 +75,7 @@ jobs:
7575
stage2:
7676
if: github.repository_owner == 'llvm'
7777
runs-on: libcxx-self-hosted-linux
78-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
78+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
7979
needs: [ stage1 ]
8080
continue-on-error: false
8181
strategy:
@@ -88,18 +88,22 @@ jobs:
8888
'generic-cxx20',
8989
'generic-cxx23'
9090
]
91-
cc: [ 'clang-20' ]
92-
cxx: [ 'clang++-20' ]
91+
cc: [ 'clang-21' ]
92+
cxx: [ 'clang++-21' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
9595
cc: 'gcc-14'
9696
cxx: 'g++-14'
97-
- config: 'generic-cxx23'
98-
cc: 'clang-18'
99-
cxx: 'clang++-18'
97+
- config: 'generic-cxx26'
98+
cc: 'clang-20'
99+
cxx: 'clang++-20'
100100
- config: 'generic-cxx26'
101101
cc: 'clang-19'
102102
cxx: 'clang++-19'
103+
# Release transition
104+
- config: 'generic-cxx23'
105+
cc: 'clang-18'
106+
cxx: 'clang++-18'
103107
steps:
104108
- uses: actions/checkout@v4
105109
- name: ${{ matrix.config }}
@@ -163,14 +167,14 @@ jobs:
163167
- config: 'generic-msan'
164168
machine: libcxx-self-hosted-linux
165169
runs-on: ${{ matrix.machine }}
166-
container: ghcr.io/llvm/libcxx-linux-builder:d8a0709b1090350a7fe3604d8ab78c7d62f10698
170+
container: ghcr.io/llvm/libcxx-linux-builder:b319dfef21f6c7b0bc6a356d6b9f41a3b3b98ae9
167171
steps:
168172
- uses: actions/checkout@v4
169173
- name: ${{ matrix.config }}
170174
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
171175
env:
172-
CC: clang-20
173-
CXX: clang++-20
176+
CC: clang-21
177+
CXX: clang++-21
174178
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
175179
if: always()
176180
with:

.github/workflows/premerge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
call C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat -arch=amd64 -host_arch=amd64
145145
bash .ci/monolithic-windows.sh "${{ steps.vars.outputs.windows-projects }}" "${{ steps.vars.outputs.windows-check-targets }}"
146146
147-
permerge-check-macos:
147+
premerge-check-macos:
148148
runs-on: macos-14
149149
if: >-
150150
github.repository_owner == 'llvm' &&

.github/workflows/release-binaries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@ jobs:
133133
# add extra CMake args to disable them.
134134
# See https://github.com/llvm/llvm-project/issues/99767
135135
if [ "$RUNNER_OS" = "macOS" ]; then
136-
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_COMPILER_RT_ENABLE_IOS=OFF"
136+
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_COMPILER_RT_ENABLE_IOS=OFF"
137137
if [ "$RUNNER_ARCH" = "ARM64" ]; then
138138
arches=arm64
139139
else
140140
arches=x86_64
141141
fi
142-
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
142+
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
143143
fi
144144
145145
build_flang="true"

bolt/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,11 @@ endif()
202202

203203
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc.in
204204
${CMAKE_CURRENT_BINARY_DIR}/include/bolt/RuntimeLibs/RuntimeLibraryVariables.inc @ONLY)
205+
206+
set(BOLT_ENUM_TARGETS "")
207+
foreach(t ${BOLT_TARGETS_TO_BUILD})
208+
set(BOLT_ENUM_TARGETS "${BOLT_ENUM_TARGETS}BOLT_TARGET(${t})\n")
209+
endforeach(t)
210+
211+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/bolt/Core/TargetConfig.def.in
212+
${CMAKE_CURRENT_BINARY_DIR}/include/bolt/Core/TargetConfig.def @ONLY)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===-- TargetConfig.def.in - Information about available targets ---------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// This file is configured by the build system to define the available bolt
10+
// targets.
11+
//
12+
// The variant of this file not ending with .in has been autogenerated by the
13+
// LLVM build. Do not edit!
14+
//
15+
//===----------------------------------------------------------------------===//
16+
17+
#ifndef BOLT_TARGET
18+
# error Please define the macro BOLT_TARGET(TargetName)
19+
#endif
20+
21+
@BOLT_ENUM_TARGETS@
22+
23+
#undef BOLT_TARGET

bolt/tools/binary-analysis/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
2+
${BOLT_TARGETS_TO_BUILD}
33
MC
44
Object
55
Support

bolt/tools/binary-analysis/binary-analysis.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,15 @@ int main(int argc, char **argv) {
8888
llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
8989

9090
// Initialize targets and assembly printers/parsers.
91-
llvm::InitializeAllTargetInfos();
92-
llvm::InitializeAllTargetMCs();
93-
llvm::InitializeAllAsmParsers();
94-
llvm::InitializeAllDisassemblers();
95-
96-
llvm::InitializeAllTargets();
97-
llvm::InitializeAllAsmPrinters();
91+
#define BOLT_TARGET(target) \
92+
LLVMInitialize##target##TargetInfo(); \
93+
LLVMInitialize##target##TargetMC(); \
94+
LLVMInitialize##target##AsmParser(); \
95+
LLVMInitialize##target##Disassembler(); \
96+
LLVMInitialize##target##Target(); \
97+
LLVMInitialize##target##AsmPrinter();
98+
99+
#include "bolt/Core/TargetConfig.def"
98100

99101
ParseCommandLine(argc, argv);
100102

bolt/tools/driver/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
2+
${BOLT_TARGETS_TO_BUILD}
33
MC
44
Object
55
Support

bolt/tools/driver/llvm-bolt.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,15 @@ int main(int argc, char **argv) {
183183
std::string ToolPath = llvm::sys::fs::getMainExecutable(argv[0], nullptr);
184184

185185
// Initialize targets and assembly printers/parsers.
186-
llvm::InitializeAllTargetInfos();
187-
llvm::InitializeAllTargetMCs();
188-
llvm::InitializeAllAsmParsers();
189-
llvm::InitializeAllDisassemblers();
190-
191-
llvm::InitializeAllTargets();
192-
llvm::InitializeAllAsmPrinters();
186+
#define BOLT_TARGET(target) \
187+
LLVMInitialize##target##TargetInfo(); \
188+
LLVMInitialize##target##TargetMC(); \
189+
LLVMInitialize##target##AsmParser(); \
190+
LLVMInitialize##target##Disassembler(); \
191+
LLVMInitialize##target##Target(); \
192+
LLVMInitialize##target##AsmPrinter();
193+
194+
#include "bolt/Core/TargetConfig.def"
193195

194196
ToolName = argv[0];
195197

bolt/tools/heatmap/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
2+
${BOLT_TARGETS_TO_BUILD}
33
MC
44
Object
55
Support

bolt/tools/heatmap/heatmap.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,15 @@ int main(int argc, char **argv) {
7676
opts::OutputFilename = "-";
7777

7878
// Initialize targets and assembly printers/parsers.
79-
llvm::InitializeAllTargetInfos();
80-
llvm::InitializeAllTargetMCs();
81-
llvm::InitializeAllAsmParsers();
82-
llvm::InitializeAllDisassemblers();
83-
84-
llvm::InitializeAllTargets();
85-
llvm::InitializeAllAsmPrinters();
79+
#define BOLT_TARGET(target) \
80+
LLVMInitialize##target##TargetInfo(); \
81+
LLVMInitialize##target##TargetMC(); \
82+
LLVMInitialize##target##AsmParser(); \
83+
LLVMInitialize##target##Disassembler(); \
84+
LLVMInitialize##target##Target(); \
85+
LLVMInitialize##target##AsmPrinter();
86+
87+
#include "bolt/Core/TargetConfig.def"
8688

8789
ToolName = argv[0];
8890
std::string ToolPath = GetExecutablePath(argv[0]);

bolt/tools/llvm-bolt-fuzzer/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
set(LLVM_LINK_COMPONENTS
2-
${LLVM_TARGETS_TO_BUILD}
2+
${BOLT_TARGETS_TO_BUILD}
33
)
44

55
add_llvm_fuzzer(llvm-bolt-fuzzer

0 commit comments

Comments
 (0)