Skip to content

Commit 42df2c5

Browse files
committed
Merge branch 'upstream/main' into ptrauth-constant
2 parents aea9884 + 34ae226 commit 42df2c5

File tree

14,111 files changed

+956923
-402797
lines changed

Some content is hidden

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

14,111 files changed

+956923
-402797
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function add-dependencies() {
9191
echo "${project}"
9292
case ${project} in
9393
bolt)
94-
for p in lld llvm; do
94+
for p in clang lld llvm; do
9595
echo $p
9696
done
9797
;;
@@ -108,7 +108,7 @@ function add-dependencies() {
108108
compiler-rt|libc|openmp)
109109
echo clang lld
110110
;;
111-
flang|lldb)
111+
flang|lldb|libclc)
112112
for p in llvm clang; do
113113
echo $p
114114
done

.ci/monolithic-linux.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ set -o pipefail
1818

1919
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
2020
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
21-
rm -rf ${BUILD_DIR}
21+
rm -rf "${BUILD_DIR}"
2222

2323
ccache --zero-stats
2424

@@ -37,8 +37,8 @@ projects="${1}"
3737
targets="${2}"
3838

3939
echo "--- cmake"
40-
pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
41-
cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
40+
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
41+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4242
-D LLVM_ENABLE_PROJECTS="${projects}" \
4343
-G Ninja \
4444
-D CMAKE_BUILD_TYPE=Release \
@@ -48,7 +48,6 @@ cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
4848
-D LLVM_LIT_ARGS="-v --xunit-xml-output ${BUILD_DIR}/test-results.xml --timeout=1200 --time-tests" \
4949
-D LLVM_ENABLE_LLD=ON \
5050
-D CMAKE_CXX_FLAGS=-gmlt \
51-
-D BOLT_CLANG_EXE=/usr/bin/clang \
5251
-D LLVM_CCACHE_BUILD=ON \
5352
-D MLIR_ENABLE_BINDINGS_PYTHON=ON
5453

.ci/monolithic-windows.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set -o pipefail
1919
MONOREPO_ROOT="${MONOREPO_ROOT:="$(git rev-parse --show-toplevel)"}"
2020
BUILD_DIR="${BUILD_DIR:=${MONOREPO_ROOT}/build}"
2121

22-
rm -rf ${BUILD_DIR}
22+
rm -rf "${BUILD_DIR}"
2323

2424
if [[ -n "${CLEAR_CACHE:-}" ]]; then
2525
echo "clearing sccache"
@@ -37,14 +37,14 @@ projects="${1}"
3737
targets="${2}"
3838

3939
echo "--- cmake"
40-
pip install -q -r ${MONOREPO_ROOT}/mlir/python/requirements.txt
40+
pip install -q -r "${MONOREPO_ROOT}"/mlir/python/requirements.txt
4141

4242
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
4343
# on fixing a build reliability issue on the build server, please
4444
# see https://github.com/llvm/llvm-project/pull/82393 and
4545
# https://discourse.llvm.org/t/rfc-future-of-windows-pre-commit-ci/76840/40
4646
# for further information.
47-
cmake -S ${MONOREPO_ROOT}/llvm -B ${BUILD_DIR} \
47+
cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4848
-D LLVM_ENABLE_PROJECTS="${projects}" \
4949
-G Ninja \
5050
-D CMAKE_BUILD_TYPE=Release \

.github/CODEOWNERS

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
clang/lib/AST/Interp/ @tbaederr
3636
clang/test/AST/Interp/ @tbaederr
3737

38+
/clang/include/clang/CIR @lanza @bcardosolopes
39+
/clang/lib/CIR @lanza @bcardosolopes
40+
/clang/tools/cir-* @lanza @bcardosolopes
41+
3842
/lldb/ @JDevlieghere
3943

4044
# MLIR Interfaces.
@@ -59,8 +63,8 @@ clang/test/AST/Interp/ @tbaederr
5963
/mlir/Dialect/*/Transforms/Bufferize.cpp @matthias-springer
6064

6165
# Linalg Dialect in MLIR.
62-
/mlir/include/mlir/Dialect/Linalg @dcaballe @nicolasvasilache
63-
/mlir/lib/Dialect/Linalg @dcaballe @nicolasvasilache
66+
/mlir/include/mlir/Dialect/Linalg/* @dcaballe @nicolasvasilache
67+
/mlir/lib/Dialect/Linalg/* @dcaballe @nicolasvasilache
6468
/mlir/lib/Dialect/Linalg/Transforms/DecomposeLinalgOps.cpp @MaheshRavishankar @nicolasvasilache
6569
/mlir/lib/Dialect/Linalg/Transforms/DropUnitDims.cpp @MaheshRavishankar @nicolasvasilache
6670
/mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp @MaheshRavishankar @nicolasvasilache
@@ -77,14 +81,14 @@ clang/test/AST/Interp/ @tbaederr
7781
/mlir/**/*SME* @banach-space @dcaballe @nicolasvasilache
7882
/mlir/**/*SVE* @banach-space @dcaballe @nicolasvasilache
7983
/mlir/**/*VectorInterfaces* @dcaballe @nicolasvasilache
80-
/mlir/**/*VectorToSCF* @banach-space @dcaballe @nicolasvasilache @matthias-springer
84+
/mlir/**/*VectorToSCF* @banach-space @dcaballe @matthias-springer @nicolasvasilache
8185
/mlir/**/*VectorToLLVM* @banach-space @dcaballe @nicolasvasilache
8286
/mlir/**/*X86Vector* @aartbik @dcaballe @nicolasvasilache
83-
/mlir/include/mlir/Dialect/Vector @dcaballe @nicolasvasilache
84-
/mlir/lib/Dialect/Vector @dcaballe @nicolasvasilache
85-
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @MaheshRavishankar @nicolasvasilache
86-
/mlir/**/*EmulateNarrowType* @hanhanW
87+
/mlir/include/mlir/Dialect/Vector/* @dcaballe @nicolasvasilache
88+
/mlir/lib/Dialect/Vector/* @dcaballe @nicolasvasilache
8789
/mlir/lib/Dialect/Vector/Transforms/* @hanhanW @nicolasvasilache
90+
/mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp @MaheshRavishankar @nicolasvasilache
91+
/mlir/**/*EmulateNarrowType* @dcaballe @hanhanW
8892

8993
# Presburger library in MLIR
9094
/mlir/**/*Presburger* @Groverkss @Superty
@@ -96,6 +100,7 @@ clang/test/AST/Interp/ @tbaederr
96100
# Transform Dialect in MLIR.
97101
/mlir/include/mlir/Dialect/Transform/* @ftynse @nicolasvasilache
98102
/mlir/lib/Dialect/Transform/* @ftynse @nicolasvasilache
103+
/mlir/**/*TransformOps* @ftynse @nicolasvasilache
99104

100105
# SPIR-V Dialect in MLIR.
101106
/mlir/**/SPIRV/ @antiagainst @kuhar
@@ -106,8 +111,32 @@ clang/test/AST/Interp/ @tbaederr
106111
# MLIR Sparsifier.
107112
/mlir/**/*SparseTensor*/ @aartbik @PeimingLiu @yinying-lisa-li @matthias-springer
108113

114+
# MLIR NVGPU Dialect
115+
/mlir/**/NVGPU*/ @grypp
116+
/mlir/test/**/CUDA/ @grypp
117+
118+
# MLIR NVVM Dialect in MLIR
119+
/mlir/**/LLVMIR/**/BasicPtxBuilderInterface* @grypp
120+
/mlir/**/NVVM* @grypp
121+
122+
# MLIR Python Bindings
123+
/mlir/test/python/ @ftynse @makslevental @stellaraccident
124+
/mlir/python/ @ftynse @makslevental @stellaraccident
125+
126+
# MLIR Mem2Reg/SROA
127+
/mlir/**/Transforms/Mem2Reg.* @moxinilian
128+
/mlir/**/Transforms/SROA.* @moxinilian
129+
109130
# BOLT
110131
/bolt/ @aaupov @maksfb @rafaelauler @ayermolo @dcci
111132

112133
# Bazel build system.
113134
/utils/bazel/ @rupprecht
135+
136+
# InstallAPI and TextAPI
137+
/llvm/**/TextAPI/ @cyndyishida
138+
/clang/**/InstallAPI/ @cyndyishida
139+
/clang/tools/clang-installapi/ @cyndyishida
140+
141+
# ExtractAPI
142+
/clang/**/ExtractAPI @daniel-grumberg

.github/new-prs-labeler.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
BOLT:
2+
- bolt/**/*
3+
4+
ClangIR:
5+
- clang/include/clang/CIR/**/*
6+
- clang/lib/CIR/**/*
7+
- clang/tools/cir-*/**/*
8+
- clang/test/CIR/**/*
9+
110
clang:dataflow:
211
- clang/include/clang/Analysis/FlowSensitive/**/*
312
- clang/lib/Analysis/FlowSensitive/**/*
@@ -461,6 +470,7 @@ backend:m68k:
461470

462471
libc++:
463472
- libcxx/**
473+
- .github/workflows/libcxx-*
464474

465475
libc++abi:
466476
- libcxxabi/**
@@ -938,3 +948,6 @@ openmp:libomptarget:
938948

939949
bazel:
940950
- utils/bazel/**
951+
952+
offload:
953+
- offload/**

.github/workflows/email-check.yaml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "Check for private emails used in PRs"
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types:
66
- opened
77

@@ -10,8 +10,6 @@ permissions:
1010

1111
jobs:
1212
validate_email:
13-
permissions:
14-
pull-requests: write
1513
runs-on: ubuntu-latest
1614
if: github.repository == 'llvm/llvm-project'
1715
steps:
@@ -25,20 +23,24 @@ jobs:
2523
run: |
2624
git log -1
2725
echo "EMAIL=$(git show -s --format='%ae' HEAD~0)" >> $GITHUB_OUTPUT
26+
# Create empty comment file
27+
echo "[]" > comments
2828
2929
- name: Validate author email
3030
if: ${{ endsWith(steps.author.outputs.EMAIL, 'noreply.github.com') }}
31-
uses: actions/github-script@v6
3231
env:
33-
EMAIL: ${{ steps.author.outputs.EMAIL }}
32+
COMMENT: >-
33+
⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.<br/>
34+
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.<br/>
35+
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
36+
run: |
37+
cat << EOF > comments
38+
[{"body" : "$COMMENT"}]
39+
EOF
40+
41+
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
42+
if: always()
3443
with:
35-
script: |
36-
const { EMAIL } = process.env
37-
await github.rest.issues.createComment({
38-
issue_number: context.issue.number,
39-
owner: context.repo.owner,
40-
repo: context.repo.repo,
41-
body: `⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
42-
Please turn off [Keep my email addresses private](https://github.com/settings/emails) setting in your account.
43-
See [LLVM Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it) for more information.
44-
`})
44+
name: workflow-args
45+
path: |
46+
comments

.github/workflows/issue-write.yml

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Comment on an issue
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- "Check code formatting"
7+
- "Check for private emails used in PRs"
8+
types:
9+
- completed
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
pr-comment:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
pull-requests: write
19+
if: >
20+
github.event.workflow_run.event == 'pull_request'
21+
steps:
22+
- name: 'Download artifact'
23+
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
24+
with:
25+
github-token: ${{ secrets.ISSUE_WRITE_DOWNLOAD_ARTIFACT }}
26+
run-id: ${{ github.event.workflow_run.id }}
27+
name: workflow-args
28+
29+
- name: 'Comment on PR'
30+
uses: actions/github-script@v3
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
script: |
34+
var fs = require('fs');
35+
const comments = JSON.parse(fs.readFileSync('./comments'));
36+
if (!comments || comments.length == 0) {
37+
return;
38+
}
39+
40+
let runInfo = await github.actions.getWorkflowRun({
41+
owner: context.repo.owner,
42+
repo: context.repo.repo,
43+
run_id: context.payload.workflow_run.id
44+
});
45+
46+
console.log(runInfo);
47+
48+
49+
// Query to find the number of the pull request that triggered this job.
50+
// The associated pull requests are based off of the branch name, so if
51+
// you create a pull request for a branch, close it, and then create
52+
// another pull request with the same branch, then this query will return
53+
// two associated pull requests. This is why we have to fetch all the
54+
// associated pull requests and then iterate through them to find the
55+
// one that is open.
56+
const gql_query = `
57+
query($repo_owner : String!, $repo_name : String!, $branch: String!) {
58+
repository(owner: $repo_owner, name: $repo_name) {
59+
ref (qualifiedName: $branch) {
60+
associatedPullRequests(first: 100) {
61+
nodes {
62+
baseRepository {
63+
owner {
64+
login
65+
}
66+
}
67+
number
68+
state
69+
}
70+
}
71+
}
72+
}
73+
}
74+
`
75+
const gql_variables = {
76+
repo_owner: runInfo.data.head_repository.owner.login,
77+
repo_name: runInfo.data.head_repository.name,
78+
branch: runInfo.data.head_branch
79+
}
80+
const gql_result = await github.graphql(gql_query, gql_variables);
81+
console.log(gql_result);
82+
// If the branch for the PR was deleted before this job has a chance
83+
// to run, then the ref will be null. This can happen if someone:
84+
// 1. Rebase the PR, which triggers some workflow.
85+
// 2. Immediately merges the PR and deletes the branch.
86+
// 3. The workflow finishes and triggers this job.
87+
if (!gql_result.repository.ref) {
88+
console.log("Ref has been deleted");
89+
return;
90+
}
91+
console.log(gql_result.repository.ref.associatedPullRequests.nodes);
92+
93+
var pr_number = 0;
94+
gql_result.repository.ref.associatedPullRequests.nodes.forEach((pr) => {
95+
if (pr.baseRepository.owner.login = context.repo.owner && pr.state == 'OPEN') {
96+
pr_number = pr.number;
97+
}
98+
});
99+
if (pr_number == 0) {
100+
console.log("Error retrieving pull request number");
101+
return;
102+
}
103+
104+
await comments.forEach(function (comment) {
105+
if (comment.id) {
106+
// Security check: Ensure that this comment was created by
107+
// the github-actions bot, so a malicious input won't overwrite
108+
// a user's comment.
109+
github.issues.getComment({
110+
owner: context.repo.owner,
111+
repo: context.repo.repo,
112+
comment_id: comment.id
113+
}).then((old_comment) => {
114+
console.log(old_comment);
115+
if (old_comment.data.user.login != "github-actions[bot]") {
116+
console.log("Invalid comment id: " + comment.id);
117+
return;
118+
}
119+
github.issues.updateComment({
120+
owner: context.repo.owner,
121+
repo: context.repo.repo,
122+
issue_number: pr_number,
123+
comment_id: comment.id,
124+
body: comment.body
125+
});
126+
});
127+
} else {
128+
github.issues.createComment({
129+
owner: context.repo.owner,
130+
repo: context.repo.repo,
131+
issue_number: pr_number,
132+
body: comment.body
133+
});
134+
}
135+
});
136+
137+
- name: Dump comments file
138+
if: always()
139+
run: cat comments

0 commit comments

Comments
 (0)