Skip to content

Commit 3f26c0c

Browse files
authored
merge main into amd-staging (#748)
2 parents a78dcd3 + 497f35c commit 3f26c0c

File tree

269 files changed

+10512
-3882
lines changed

Some content is hidden

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

269 files changed

+10512
-3882
lines changed

.ci/premerge_advisor_explain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ def main(
129129
# If the job succeeds and there is not an existing comment, we
130130
# should not write one to reduce noise.
131131
comments = []
132-
with open("comments", "w") as comment_file_handle:
132+
comments_file_name = f"comments-{platform.system()}-{platform.machine()}"
133+
with open(comments_file_name, "w") as comment_file_handle:
133134
json.dump(comments, comment_file_handle)
134135

135136

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Test Issue Write
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
paths:
9+
- '.github/workflows/issue-write-test.yaml'
10+
- '.github/workflows/issue-write.yml'
11+
12+
jobs:
13+
test-issue-write:
14+
name: "Test Issue Write"
15+
runs-on: ubuntu-24.04
16+
if: github.repository == 'llvm/llvm-project'
17+
steps:
18+
- name: Write Comment
19+
run: |
20+
echo '[{"body": "This is a comment for testing the issue write workflow"}]' > comments-foo
21+
echo '[{"body": "This is another comment for testing the issue write workflow that was placed in a separate file"}]' > comments-bar
22+
- name: Upload Comment
23+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
24+
with:
25+
name: workflow-args-foo
26+
path: |
27+
comments-foo
28+
- name: Upload Comment
29+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
30+
with:
31+
name: workflow-args-bar
32+
path: |
33+
comments-bar

.github/workflows/issue-write.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- "PR Request Release Note"
99
- "Code lint"
1010
- "CI Checks"
11+
- "Test Issue Write"
1112
types:
1213
- completed
1314

@@ -40,13 +41,18 @@ jobs:
4041
artifact-name: workflow-args
4142

4243
- name: 'Comment on PR'
43-
if: steps.download-artifact.outputs.artifact-id != ''
44+
if: steps.download-artifact.outputs.artifact-ids != ''
4445
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
4546
with:
4647
github-token: ${{ secrets.GITHUB_TOKEN }}
4748
script: |
4849
var fs = require('fs');
49-
const comments = JSON.parse(fs.readFileSync('./comments'));
50+
var comments = []
51+
for (local_file of fs.readdirSync('.')) {
52+
if (local_file.startsWith("comments")) {
53+
comments.push(...JSON.parse(fs.readFileSync(local_file)))
54+
}
55+
}
5056
if (!comments || comments.length == 0) {
5157
return;
5258
}
@@ -155,5 +161,5 @@ jobs:
155161
- name: Dump comments file
156162
if: >-
157163
always() &&
158-
steps.download-artifact.outputs.artifact-id != ''
164+
steps.download-artifact.outputs.artifact-ids != ''
159165
run: cat comments

.github/workflows/premerge.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ jobs:
124124
if: ${{ always() && !startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') }}
125125
continue-on-error: true
126126
with:
127-
name: workflow-args
127+
name: workflow-args-x86-linux
128128
path: |
129-
comments
129+
comments-Linux-x86_64
130130
131131
premerge-checks-windows:
132132
name: Build and Test Windows
@@ -185,6 +185,14 @@ jobs:
185185
path: artifacts/
186186
retention-days: 5
187187
include-hidden-files: 'true'
188+
- name: Upload Comment
189+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
190+
if: always()
191+
continue-on-error: true
192+
with:
193+
name: workflow-args-windows
194+
path: |
195+
comments-Windows-x86_64
188196
189197
premerge-check-macos:
190198
name: MacOS Premerge Checks

.github/workflows/test-unprivileged-download-artifact.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,23 @@ jobs:
2121
if: github.repository_owner == 'llvm'
2222
runs-on: ubuntu-24.04
2323
steps:
24-
- name: Create Test File
24+
- name: Create Test Files
2525
run: |
26-
echo "test" > comment
27-
- name: Upload Test File
26+
echo "foo" > comment1
27+
echo "bar" > comment2
28+
- name: Upload Test File 1
2829
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
2930
with:
30-
name: workflow-args
31+
name: artifact-name-1
3132
path: |
32-
comment
33+
comment1
34+
- name: Upload Test File 2
35+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
36+
with:
37+
name: artifact-name-2
38+
path: |
39+
comment2
40+
3341

3442
test-download:
3543
name: Test Unprivileged Download Artifact
@@ -47,8 +55,10 @@ jobs:
4755
id: download-artifact
4856
with:
4957
run-id: ${{ github.run_id }}
50-
artifact-name: workflow-args
58+
artifact-name: artifact-name-
5159
- name: Assert That Contents are the Same
5260
run: |
53-
cat comment
54-
[[ "$(cat comment)" == "test" ]]
61+
cat comment1
62+
[[ "$(cat comment1)" == "foo" ]]
63+
cat comment2
64+
[[ "$(cat comment2)" == "bar" ]]

.github/workflows/unprivileged-download-artifact/action.yml

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ outputs:
1919
The filename of the downloaded artifact or the empty string if the
2020
artifact was not found.
2121
value: ${{ steps.download-artifact.outputs.filename }}
22-
artifact-id:
22+
artifact-ids:
2323
description: "The id of the artifact being downloaded."
24-
value: ${{ steps.artifact-url.outputs.id }}
24+
value: ${{ steps.artifact-url.outputs.ids }}
2525

2626

2727
runs:
@@ -36,46 +36,67 @@ runs:
3636
response = await github.rest.actions.listArtifactsForRepo({
3737
owner: context.repo.owner,
3838
repo: context.repo.repo,
39-
name: "${{ inputs.artifact-name }}"
4039
})
4140
} else {
4241
response = await github.rest.actions.listWorkflowRunArtifacts({
4342
owner: context.repo.owner,
4443
repo: context.repo.repo,
4544
run_id: "${{ inputs.run-id }}",
46-
name: "${{ inputs.artifact-name }}"
4745
})
4846
}
4947
5048
console.log(response)
5149
50+
artifacts_to_download = []
5251
for (artifact of response.data.artifacts) {
52+
if (artifact.name.startsWith("${{ inputs.artifact-name }}")) {
53+
artifacts_to_download.push(artifact)
54+
}
55+
}
56+
57+
for (artifact of artifacts_to_download) {
5358
console.log(artifact);
5459
}
5560
56-
if (response.data.artifacts.length == 0) {
57-
console.log("Could not find artifact ${{ inputs.artifact-name }} for workflow run ${{ inputs.run-id }}")
61+
if (artifacts_to_download.length == 0) {
62+
console.log("Could not find artifacts starting with name ${{ inputs.artifact-name }} for workflow run ${{ inputs.run-id }}")
5863
return;
5964
}
6065
61-
const url_response = await github.rest.actions.downloadArtifact({
62-
owner: context.repo.owner,
63-
repo: context.repo.repo,
64-
artifact_id: response.data.artifacts[0].id,
65-
archive_format: "zip"
66-
})
66+
artifact_ids = []
67+
artifact_urls = []
68+
artifact_names = []
69+
for (artifact_to_download of artifacts_to_download) {
70+
const url_response = await github.rest.actions.downloadArtifact({
71+
owner: context.repo.owner,
72+
repo: context.repo.repo,
73+
artifact_id: artifact_to_download.id,
74+
archive_format: "zip"
75+
})
76+
77+
artifact_ids.push(artifact_to_download.id)
78+
artifact_urls.push('"' + url_response.url + '"')
79+
artifact_names.push('"' + artifact_to_download.name + '"')
80+
}
6781
68-
core.setOutput("url", url_response.url);
69-
core.setOutput("id", response.data.artifacts[0].id);
82+
core.setOutput("urls", artifact_urls.join(" "));
83+
core.setOutput("ids", artifact_ids.join(" "));
84+
core.setOutput("names", artifact_names.join(" "));
7085
7186
- shell: bash
72-
if: steps.artifact-url.outputs.url != ''
87+
if: steps.artifact-url.outputs.urls != ''
7388
id: download-artifact
7489
run: |
75-
curl -L -o ${{ inputs.artifact-name }}.zip "${{ steps.artifact-url.outputs.url }}"
76-
echo "filename=${{ inputs.artifact-name }}.zip" >> $GITHUB_OUTPUT
90+
artifact_urls=(${{ steps.artifact-url.outputs.urls }})
91+
artifact_names=(${{ steps.artifact-url.outputs.names }})
92+
for i in "${!artifact_urls[@]}"; do
93+
curl -L -o "${artifact_names[$i]}.zip" "${artifact_urls[$i]}"
94+
done
7795
7896
- shell: bash
79-
if: steps.download-artifact.outputs.filename != ''
97+
if: steps.artifact-url.outputs.names != ''
8098
run: |
81-
unzip ${{ steps.download-artifact.outputs.filename }}
99+
artifact_names=(${{ steps.artifact-url.outputs.names }})
100+
for name in "${artifact_names[@]}"; do
101+
unzip "${name}.zip"
102+
done

clang-tools-extra/clangd/ScanningProjectModules.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "ProjectModules.h"
1010
#include "support/Logger.h"
11-
#include "clang/Tooling/DependencyScanning/DependencyScanningService.h"
12-
#include "clang/Tooling/DependencyScanning/DependencyScanningTool.h"
11+
#include "clang/DependencyScanning/DependencyScanningService.h"
12+
#include "clang/Tooling/DependencyScanningTool.h"
1313

1414
namespace clang::clangd {
1515
namespace {
@@ -36,8 +36,8 @@ class ModuleDependencyScanner {
3636
std::shared_ptr<const clang::tooling::CompilationDatabase> CDB,
3737
const ThreadsafeFS &TFS)
3838
: CDB(CDB), TFS(TFS),
39-
Service(tooling::dependencies::ScanningMode::CanonicalPreprocessing,
40-
tooling::dependencies::ScanningOutputFormat::P1689) {}
39+
Service(dependencies::ScanningMode::CanonicalPreprocessing,
40+
dependencies::ScanningOutputFormat::P1689) {}
4141

4242
/// The scanned modules dependency information for a specific source file.
4343
struct ModuleDependencyInfo {
@@ -81,7 +81,7 @@ class ModuleDependencyScanner {
8181
// Whether the scanner has scanned the project globally.
8282
bool GlobalScanned = false;
8383

84-
clang::tooling::dependencies::DependencyScanningService Service;
84+
clang::dependencies::DependencyScanningService Service;
8585

8686
// TODO: Add a scanning cache.
8787

clang-tools-extra/clangd/test/lit.cfg.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
1-
import os
2-
import shutil
3-
41
import lit.llvm
52
import lit.util
63

74
lit.llvm.initialize(lit_config, config)
85
lit.llvm.llvm_config.clang_setup()
96
lit.llvm.llvm_config.use_default_substitutions()
107

11-
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
12-
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
13-
#
14-
# We prefer the lit internal shell which provides a better user experience on failures
15-
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
16-
# env var.
17-
use_lit_shell = True
18-
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
19-
if lit_shell_env:
20-
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
21-
228
config.name = "Clangd"
239
config.suffixes = [".test"]
2410
config.excludes = ["Inputs"]
25-
config.test_format = lit.formats.ShTest(not use_lit_shell)
11+
config.test_format = lit.formats.ShTest(not lit.llvm.llvm_config.use_lit_shell)
2612
config.test_source_root = config.clangd_source_dir + "/test"
2713
config.test_exec_root = config.clangd_binary_dir + "/test"
2814

@@ -55,13 +41,6 @@ def calculate_arch_features(arch_string):
5541
if lit.util.pythonize_bool(config.have_benchmarks):
5642
config.available_features.add("have-benchmarks")
5743

58-
# This is needed to avoid running a single test (system-include-extractor.test)
59-
# on a single buildbot (clangd-ubuntu-tsan) and likely should not be needed. We
60-
# are able to unconditionally assume a chmod binary exists for check-llvm.
61-
# TODO(boomanaiden154): Fix this after investigating the bot setup.
62-
if shutil.which("chmod"):
63-
config.available_features.add("chmod")
64-
6544
# It is not realistically possible to account for all options that could
6645
# possibly be present in system and user configuration files, so disable
6746
# default configs for the test runs.

clang-tools-extra/clangd/test/system-include-extractor.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RUN: rm -rf %t.dir && mkdir -p %t.dir
22

33
# The mock driver below is a shell script:
4-
# REQUIRES: shell, chmod
4+
# REQUIRES: shell
55

66
# Create a bin directory to store the mock-driver and add it to the path
77
# RUN: mkdir -p %t.dir/bin

clang/include/clang/Basic/BuiltinsPPC.def

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,10 @@ TARGET_BUILTIN(__builtin_darn_32, "i", "", "isa-v30-instructions")
10011001
TARGET_BUILTIN(__builtin_unpack_vector_int128, "ULLiV1LLLii", "", "vsx")
10021002
TARGET_BUILTIN(__builtin_pack_vector_int128, "V1LLLiULLiULLi", "", "vsx")
10031003

1004+
// AMO builtins
1005+
TARGET_BUILTIN(__builtin_amo_lwat, "UiUi*UiIi", "", "isa-v30-instructions")
1006+
TARGET_BUILTIN(__builtin_amo_ldat, "ULiULi*ULiIi", "", "isa-v30-instructions")
1007+
10041008
// Set the floating point rounding mode
10051009
BUILTIN(__builtin_setrnd, "di", "")
10061010

0 commit comments

Comments
 (0)