Skip to content

Commit 02bf7c6

Browse files
authored
Merge pull request #235 from AMD-Lightning-Internal/amd/merge/upstream_merge_20250121075126
merge main to amd-staging
2 parents 6b6c6d0 + 891d2f9 commit 02bf7c6

File tree

353 files changed

+904248
-12220
lines changed

Some content is hidden

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

353 files changed

+904248
-12220
lines changed

.github/workflows/build-ci-container.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
runs-on: depot-ubuntu-22.04-16
2424
outputs:
2525
container-name: ${{ steps.vars.outputs.container-name }}
26+
container-name-agent: ${{ steps.vars.outputs.container-name-agent }}
2627
container-name-tag: ${{ steps.vars.outputs.container-name-tag }}
28+
container-name-agent-tag: ${{ steps.vars.outputs.container-name-agent-tag }}
2729
container-filename: ${{ steps.vars.outputs.container-filename }}
2830
steps:
2931
- name: Checkout LLVM
@@ -90,6 +92,6 @@ jobs:
9092
podman push ${{ needs.build-ci-container.outputs.container-name-tag }}
9193
podman push ${{ needs.build-ci-container.outputs.container-name }}:latest
9294
93-
podman tag ${{ needs.build-ci-container.outpus.container-name-agent-tag }} ${{ needs.build-ci-container.outputs.container-name-agent }}:latest
95+
podman tag ${{ needs.build-ci-container.outputs.container-name-agent-tag }} ${{ needs.build-ci-container.outputs.container-name-agent }}:latest
9496
podman push ${{ needs.build-ci-container.outputs.container-name-agent-tag }}
9597
podman push ${{ needs.build-ci-container.outputs.container-name-agent }}:latest

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ jobs:
8383
matrix:
8484
runs-on:
8585
- ubuntu-22.04
86-
- windows-2022
8786
- macos-13
8887
- macos-14
8988

.github/workflows/release-binaries.yml

Lines changed: 46 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ on:
1818
type: choice
1919
options:
2020
- ubuntu-22.04
21-
- windows-2022
2221
- macos-13
2322
- macos-14
2423

@@ -60,6 +59,8 @@ jobs:
6059
enable-pgo: ${{ steps.vars.outputs.enable-pgo }}
6160
release-binary-basename: ${{ steps.vars.outputs.release-binary-basename }}
6261
release-binary-filename: ${{ steps.vars.outputs.release-binary-filename }}
62+
build-runs-on: ${{ steps.vars.outputs.build-runs-on }}
63+
test-runs-on: ${{ steps.vars.outputs.build-runs-on }}
6364

6465
steps:
6566
# It's good practice to use setup-python, but this is also required on macos-14
@@ -144,12 +145,40 @@ jobs:
144145
145146
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
146147
echo "build-flang=$build_flang" >> $GITHUB_OUTPUT
147-
148-
build-stage1:
149-
name: "Build Stage 1"
148+
case "${{ inputs.runs-on }}" in
149+
ubuntu-22.04)
150+
build_runs_on="depot-${{ inputs.runs-on }}-16"
151+
test_runs_on=$build_runs_on
152+
;;
153+
macos-13)
154+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
155+
build_runs_on="${{ inputs.runs-on }}"
156+
else
157+
build_runs_on="macos-13-large"
158+
fi
159+
test_runs_on="${{ inputs.runs-on }}"
160+
;;
161+
macos-14)
162+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
163+
build_runs_on="${{ inputs.runs-on }}"
164+
else
165+
build_runs_on="depot-macos-14"
166+
fi
167+
test_runs_on="${{ inputs.runs-on }}"
168+
;;
169+
*)
170+
test_runs_on="${{ inputs.runs-on }}"
171+
build_runs_on=$test_runs_on
172+
;;
173+
esac
174+
echo "build-runs-on=$build_runs_on" >> $GITHUB_OUTPUT
175+
echo "test-runs-on=$test_runs_on" >> $GITHUB_OUTPUT
176+
177+
build-release-package:
178+
name: "Build Release Package"
150179
needs: prepare
151180
if: github.repository == 'llvm/llvm-project'
152-
runs-on: ${{ inputs.runs-on }}
181+
runs-on: ${{ needs.prepare.outputs.build-runs-on }}
153182
steps:
154183

155184
- name: Checkout Actions
@@ -195,7 +224,7 @@ jobs:
195224
key: sccache-${{ runner.os }}-${{ runner.arch }}-release
196225
variant: sccache
197226

198-
- name: Build Stage 1 Clang
227+
- name: Configure
199228
id: build
200229
shell: bash
201230
run: |
@@ -208,182 +237,12 @@ jobs:
208237
-DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \
209238
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
210239
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
211-
ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build
212-
# There is a race condition on the MacOS builders and this command is here
213-
# to help debug that when it happens.
214-
ls -ltr ${{ steps.setup-stage.outputs.build-prefix }}/build
215-
216-
- name: Save Stage
217-
uses: ./workflows-main/.github/workflows/release-binaries-save-stage
218-
with:
219-
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }}
220-
221-
build-stage2:
222-
name: "Build Stage 2"
223-
needs:
224-
- prepare
225-
- build-stage1
226-
if: github.repository == 'llvm/llvm-project'
227-
runs-on: ${{ inputs.runs-on }}
228-
steps:
229-
- name: Checkout Actions
230-
uses: actions/checkout@v4
231-
with:
232-
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }}
233-
sparse-checkout: |
234-
.github/workflows/
235-
sparse-checkout-cone-mode: false
236-
path: workflows
237-
- name: Setup Stage
238-
id: setup-stage
239-
uses: ./workflows/.github/workflows/release-binaries-setup-stage
240-
with:
241-
previous-artifact: build-stage1
242-
243-
- name: Build Stage 2
244-
# Re-enable once PGO builds are supported.
245-
if: needs.prepare.outputs.enable-pgo == 'true'
246-
shell: bash
247-
run: |
248-
ninja -C ${{ steps.setup-stage.outputs.build-prefix}}/build stage2-instrumented
249-
250-
- name: Save Stage
251-
uses: ./workflows/.github/workflows/release-binaries-save-stage
252-
with:
253-
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }}
254-
255-
build-stage3-clang:
256-
name: "Build Stage 3 LLVM/Clang"
257-
needs:
258-
- prepare
259-
- build-stage2
260-
if: github.repository == 'llvm/llvm-project'
261-
runs-on: ${{ inputs.runs-on }}
262-
steps:
263-
- name: Checkout Actions
264-
uses: actions/checkout@v4
265-
with:
266-
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }}
267-
sparse-checkout: |
268-
.github/workflows/
269-
sparse-checkout-cone-mode: false
270-
path: workflows
271-
- name: Setup Stage
272-
id: setup-stage
273-
uses: ./workflows/.github/workflows/release-binaries-setup-stage
274-
with:
275-
previous-artifact: build-stage2
276-
277-
- name: Build LLVM/Clang
278-
shell: bash
279-
run: |
280-
# There is a race condition on the MacOS builders and this command is here
281-
# to help debug that when it happens.
282-
ls -ltr ${{ steps.setup-stage.outputs.build-prefix }}/build
283-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-clang
284-
# Build some of the larger binaries here too.
285-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \
286-
clang-scan-deps \
287-
modularize clangd \
288-
clangd-indexer \
289-
clang-check \
290-
${{ (runner.os == 'Linux' && 'clangd-fuzzer') || '' }} \
291-
clang-tidy \
292-
llc \
293-
lli \
294-
llvm-exegesis \
295-
llvm-opt-fuzzer \
296-
llvm-reduce \
297-
llvm-lto \
298-
dsymutil
299-
300-
- name: Save Stage
301-
uses: ./workflows/.github/workflows/release-binaries-save-stage
302-
with:
303-
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }}
304-
305-
build-stage3-flang:
306-
name: "Build Stage 3 Flang/MLIR/Bolt"
307-
needs:
308-
- prepare
309-
- build-stage3-clang
310-
runs-on: ${{ inputs.runs-on }}
311-
steps:
312-
- name: Checkout Actions
313-
uses: actions/checkout@v4
314-
with:
315-
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }}
316-
sparse-checkout: |
317-
.github/workflows/
318-
sparse-checkout-cone-mode: false
319-
path: workflows
320-
- name: Setup Stage
321-
id: setup-stage
322-
uses: ./workflows/.github/workflows/release-binaries-setup-stage
323-
with:
324-
previous-artifact: build-stage3-clang
325-
326-
- name: Build Flang / MLIR / Bolt
240+
- name: Build
327241
shell: bash
328242
run: |
329-
# Build some of the mlir tools that take a long time to link
330-
if [ "${{ needs.prepare.outputs.build-flang }}" = "true" ]; then
331-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ -j2 flang-new bbc
332-
fi
333-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/ \
334-
mlir-bytecode-parser-fuzzer \
335-
mlir-cpu-runner \
336-
mlir-lsp-server \
337-
mlir-opt \
338-
mlir-query \
339-
mlir-reduce \
340-
mlir-text-parser-fuzzer \
341-
mlir-translate \
342-
mlir-transform-opt \
343-
mlir-cat \
344-
mlir-minimal-opt \
345-
mlir-minimal-opt-canonicalize \
346-
mlir-pdll-lsp-server \
347-
llvm-bolt \
348-
llvm-bolt-heatmap
349-
350-
- name: Save Stage
351-
uses: ./workflows/.github/workflows/release-binaries-save-stage
352-
with:
353-
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }}
354-
355-
build-stage3-all:
356-
name: "Build Stage 3"
357-
needs:
358-
- prepare
359-
- build-stage3-flang
360-
runs-on: ${{ inputs.runs-on }}
361-
steps:
362-
- name: Checkout Actions
363-
uses: actions/checkout@v4
364-
with:
365-
ref: ${{ (github.event_name == 'pull_request' && github.sha) || 'main' }}
366-
sparse-checkout: |
367-
.github/workflows/
368-
sparse-checkout-cone-mode: false
369-
path: workflows
370-
- name: Setup Stage
371-
id: setup-stage
372-
uses: ./workflows/.github/workflows/release-binaries-setup-stage
373-
with:
374-
previous-artifact: build-stage3-flang
375-
376-
- name: Build Release Package
377-
shell: bash
378-
run: |
379-
which cmake
380-
ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package
381-
# Copy Release artifact to the workspace so it is easier to upload.
382-
# This is necessary, because on Windows, the build-prefix path can
383-
# only be used on bash steps, because it uses the form of /d/files/
384-
# and other steps expect D:\files.
243+
ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package
385244
mv ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/${{ needs.prepare.outputs.release-binary-filename }} .
386-
245+
387246
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
388247
with:
389248
name: ${{ runner.os }}-${{ runner.arch }}-release-binary
@@ -398,19 +257,18 @@ jobs:
398257
run: |
399258
find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname ${{ needs.prepare.outputs.release-binary-filename }} -delete
400259
rm -Rf ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/_CPack_Packages
401-
260+
402261
- name: Save Stage
403-
uses: ./workflows/.github/workflows/release-binaries-save-stage
262+
uses: ./workflows-main/.github/workflows/release-binaries-save-stage
404263
with:
405264
build-prefix: ${{ steps.setup-stage.outputs.build-prefix }}
406265

407266
upload-release-binaries:
408267
name: "Upload Release Binaries"
409268
needs:
410269
- prepare
411-
- build-stage3-all
270+
- build-release-package
412271
if: >-
413-
always() &&
414272
github.event_name != 'pull_request' &&
415273
needs.prepare.outputs.upload == 'true'
416274
runs-on: ubuntu-22.04
@@ -463,14 +321,14 @@ jobs:
463321
upload \
464322
--files ${{ needs.prepare.outputs.release-binary-filename }}*
465323
466-
test-stage3:
467-
name: "Test Stage 3"
324+
test-release:
325+
name: "Test Release"
468326
needs:
469327
- prepare
470-
- build-stage3-all
328+
- build-release-package
471329
if: >-
472330
github.repository == 'llvm/llvm-project'
473-
runs-on: ${{ inputs.runs-on }}
331+
runs-on: ${{ needs.prepare.outputs.test-runs-on }}
474332
steps:
475333
- name: Checkout Actions
476334
uses: actions/checkout@v4
@@ -484,7 +342,7 @@ jobs:
484342
id: setup-stage
485343
uses: ./workflows/.github/workflows/release-binaries-setup-stage
486344
with:
487-
previous-artifact: build-stage3-all
345+
previous-artifact: build-release-package
488346

489347
- name: Run Tests
490348
shell: bash

clang-tools-extra/clangd/FindTarget.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,7 @@ struct TargetFinder {
496496
return;
497497
case NestedNameSpecifier::Identifier:
498498
if (Resolver) {
499-
add(QualType(Resolver->resolveNestedNameSpecifierToType(NNS), 0),
500-
Flags);
499+
add(Resolver->resolveNestedNameSpecifierToType(NNS), Flags);
501500
}
502501
return;
503502
case NestedNameSpecifier::TypeSpec:

clang-tools-extra/clangd/XRefs.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,9 +2034,10 @@ static void unwrapFindType(
20342034

20352035
// For smart pointer types, add the underlying type
20362036
if (H)
2037-
if (const auto* PointeeType = H->getPointeeType(T.getNonReferenceType().getTypePtr())) {
2038-
unwrapFindType(QualType(PointeeType, 0), H, Out);
2039-
return Out.push_back(T);
2037+
if (auto PointeeType = H->getPointeeType(T.getNonReferenceType());
2038+
!PointeeType.isNull()) {
2039+
unwrapFindType(PointeeType, H, Out);
2040+
return Out.push_back(T);
20402041
}
20412042

20422043
return Out.push_back(T);

clang/docs/ClangOffloadBundler.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,3 +542,5 @@ The compressed offload bundle begins with a header followed by the compressed bi
542542

543543
- **Compressed Data**:
544544
The actual compressed binary data follows the header. Its size can be inferred from the total size of the file minus the header size.
545+
546+
> **Note**: Version 3 of the format is under development. It uses 64-bit fields for Total File Size and Uncompressed Binary Size to support files larger than 4GB. To experiment with version 3, set the environment variable `COMPRESSED_BUNDLE_FORMAT_VERSION=3`. This support is experimental and not recommended for production use.

clang/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,8 @@ Improvements to Clang's diagnostics
828828
}
829829
- Diagnose invalid declarators in the declaration of constructors and destructors (#GH121706).
830830

831+
- Fix false positives warning for non-std functions with name `infinity` (#123231).
832+
831833
Improvements to Clang's time-trace
832834
----------------------------------
833835

@@ -995,6 +997,7 @@ Bug Fixes to C++ Support
995997
- Fixed a crash caused by the incorrect construction of template arguments for CTAD alias guides when type
996998
constraints are applied. (#GH122134)
997999
- Fixed canonicalization of pack indexing types - Clang did not always recognized identical pack indexing. (#GH123033)
1000+
- Fixed a nested lambda substitution issue for constraint evaluation. (#GH123441)
9981001

9991002

10001003
Bug Fixes to AST Handling
@@ -1165,6 +1168,7 @@ RISC-V Support
11651168
CUDA/HIP Language Changes
11661169
^^^^^^^^^^^^^^^^^^^^^^^^^
11671170
- Fixed a bug about overriding a constexpr pure-virtual member function with a non-constexpr virtual member function which causes compilation failure when including standard C++ header `format`.
1171+
- Added initial support for version 3 of the compressed offload bundle format, which uses 64-bit fields for Total File Size and Uncompressed Binary Size. This enables support for files larger than 4GB. The support is currently experimental and can be enabled by setting the environment variable `COMPRESSED_BUNDLE_FORMAT_VERSION=3`.
11681172

11691173
CUDA Support
11701174
^^^^^^^^^^^^

0 commit comments

Comments
 (0)