Skip to content

Commit 10b3505

Browse files
Merge attempt by ./merge_from_main.sh into branch amd-trunk-dev
2 parents bb7c927 + 046c57e commit 10b3505

File tree

2,712 files changed

+112566
-52485
lines changed

Some content is hidden

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

2,712 files changed

+112566
-52485
lines changed

.github/workflows/docs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- 'lld/docs/**'
2424
- 'openmp/docs/**'
2525
- 'polly/docs/**'
26+
- 'flang/docs/**'
2627
pull_request:
2728
paths:
2829
- 'llvm/docs/**'
@@ -35,11 +36,13 @@ on:
3536
- 'lld/docs/**'
3637
- 'openmp/docs/**'
3738
- 'polly/docs/**'
39+
- 'flang/docs/**'
3840

3941
jobs:
4042
check-docs-build:
4143
name: "Test documentation build"
4244
runs-on: ubuntu-latest
45+
if: github.repository == 'llvm/llvm-project'
4346
steps:
4447
# Don't fetch before checking for file changes to force the file changes
4548
# action to use the Github API in pull requests. If it's a push to a
@@ -75,6 +78,8 @@ jobs:
7578
- 'openmp/docs/**'
7679
polly:
7780
- 'polly/docs/**'
81+
flang:
82+
- 'flang/docs/**'
7883
- name: Fetch LLVM sources (PR)
7984
if: ${{ github.event_name == 'pull_request' }}
8085
uses: actions/checkout@v4
@@ -143,4 +148,11 @@ jobs:
143148
run: |
144149
cmake -B polly-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="polly" -DLLVM_ENABLE_SPHINX=ON ./llvm
145150
TZ=UTC ninja -C polly-build docs-polly-html docs-polly-man
151+
- name: Build Flang docs
152+
if: steps.docs-changed-subprojects.outputs.flang_any_changed == 'true'
153+
# TODO(boomanaiden154): Remove the SPHINX_WARNINGS_AS_ERRORS from the
154+
# CMake invocation once the warnings in the flang docs build are fixed.
155+
run: |
156+
cmake -B flang-build -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;mlir;flang" -DLLVM_ENABLE_SPHINX=ON -DSPHINX_WARNINGS_AS_ERRORS=OFF ./llvm
157+
TZ=UTC ninja -C flang-build docs-flang-html docs-flang-man
146158

.github/workflows/new-prs.yml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,36 @@
11
name: "Labelling new pull requests"
2+
3+
permissions:
4+
contents: read
5+
26
on:
3-
workflow_run:
4-
workflows: ["PR Receive"]
7+
# It's safe to use pull_request_target here, because we aren't checking out
8+
# code from the pull request branch.
9+
# See https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
10+
pull_request_target:
11+
types:
12+
- opened
13+
- reopened
14+
- ready_for_review
15+
- synchronize
516

617
jobs:
718
automate-prs-labels:
819
permissions:
9-
contents: read
1020
pull-requests: write
1121
runs-on: ubuntu-latest
22+
# Ignore PRs with more than 10 commits. Pull requests with a lot of
23+
# commits tend to be accidents usually when someone made a mistake while trying
24+
# to rebase. We want to ignore these pull requests to avoid excessive
25+
# notifications.
1226
if: >
1327
github.repository == 'llvm/llvm-project' &&
14-
github.event.workflow_run.event == 'pull_request_target' &&
15-
github.event.workflow_run.conclusion == 'success'
28+
github.event.pull_request.draft == false &&
29+
github.event.pull_request.commits < 10
1630
steps:
17-
# From: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
18-
# Updated version here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
19-
- name: Debug
20-
run: |
21-
echo "Event: ${{ github.event.workflow_run.event }} Conclusion: ${{ github.event.workflow_run.conclusion }}"
22-
- name: 'Download artifact'
23-
uses: actions/github-script@v6
24-
with:
25-
script: |
26-
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
27-
owner: context.repo.owner,
28-
repo: context.repo.repo,
29-
run_id: context.payload.workflow_run.id
30-
});
31-
const matchArtifact = artifacts.data.artifacts.find((artifact) =>
32-
artifact.name === 'pr'
33-
);
34-
const download = await github.rest.actions.downloadArtifact({
35-
owner: context.repo.owner,
36-
repo: context.repo.repo,
37-
artifact_id: matchArtifact.id,
38-
archive_format: 'zip'
39-
});
40-
const { writeFileSync } = require('node:fs');
41-
writeFileSync('${{ github.workspace }}/pr.zip', Buffer.from(download.data));
42-
43-
- run: unzip pr.zip
44-
45-
- name: "Get PR Number"
46-
id: vars
47-
run:
48-
echo "pr-number=$(cat NR)" >> "$GITHUB_OUTPUT"
49-
5031
- uses: actions/labeler@v4
5132
with:
5233
configuration-path: .github/new-prs-labeler.yml
5334
# workaround for https://github.com/actions/labeler/issues/112
5435
sync-labels: ''
5536
repo-token: ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}
56-
pr-number: ${{ steps.vars.outputs.pr-number }}

.github/workflows/pr-code-format.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,19 @@ permissions:
66
jobs:
77
code_formatter:
88
runs-on: ubuntu-latest
9+
if: github.repository == 'llvm/llvm-project'
910
steps:
1011
- name: Fetch LLVM sources
1112
uses: actions/checkout@v4
1213
with:
13-
fetch-depth: 2
14+
fetch-depth: 2 # Fetches only the last 2 commits
1415

1516
- name: Get changed files
1617
id: changed-files
1718
uses: tj-actions/changed-files@v39
1819
with:
1920
separator: ","
20-
fetch_depth: 100 # Fetches only the last 10 commits
21+
fetch_depth: 2000 # Fetches only the last 2000 commits
2122

2223
- name: "Listed files"
2324
run: |

.github/workflows/pr-receive-label.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/pr-receive.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/pr-subscriber-wait.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/pr-subscriber.yml

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
name: PR Subscriber
22

33
on:
4-
workflow_run:
5-
workflows: ["PR Receive Label"]
4+
pull_request_target:
65
types:
7-
- completed
6+
- labeled
87

98
permissions:
10-
actions: read
119
contents: read
1210

1311
jobs:
1412
auto-subscribe:
1513
runs-on: ubuntu-latest
16-
if: >
17-
github.repository == 'llvm/llvm-project' &&
18-
github.event.workflow_run.event == 'pull_request' &&
19-
github.event.workflow_run.conclusion == 'success'
14+
if: github.repository == 'llvm/llvm-project'
2015
steps:
2116
- name: Setup Automation Script
2217
run: |
@@ -26,47 +21,10 @@ jobs:
2621
chmod a+x github-automation.py
2722
pip install -r requirements.txt
2823
29-
- name: 'Wait for other actions'
30-
# We can't use the concurrency tag for these jobs, because it will
31-
# cancel pending jobs if another job is running.
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
run: |
35-
python3 pr-subscriber-wait.py
36-
37-
38-
# From: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
39-
# Updated version here: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow
40-
- name: 'Download artifact'
41-
uses: actions/github-script@v6
42-
with:
43-
script: |
44-
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
45-
owner: context.repo.owner,
46-
repo: context.repo.repo,
47-
run_id: context.payload.workflow_run.id
48-
});
49-
const matchArtifact = artifacts.data.artifacts.find((artifact) =>
50-
artifact.name === 'pr'
51-
);
52-
const download = await github.rest.actions.downloadArtifact({
53-
owner: context.repo.owner,
54-
repo: context.repo.repo,
55-
artifact_id: matchArtifact.id,
56-
archive_format: 'zip'
57-
});
58-
const { writeFileSync } = require('node:fs');
59-
writeFileSync('${{ github.workspace }}/pr.zip', Buffer.from(download.data));
60-
61-
- run: unzip pr.zip
62-
6324
- name: Update watchers
64-
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
6525
run: |
66-
PR_NUMBER=$(cat NR)
67-
LABEL_NAME=$(cat LABEL)
6826
./github-automation.py \
6927
--token '${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}' \
7028
pr-subscriber \
71-
--issue-number "$PR_NUMBER" \
72-
--label-name "$LABEL_NAME"
29+
--issue-number "${{ github.event.number }}" \
30+
--label-name "${{ github.event.label.name }}"

.github/workflows/scorecard.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
# Check current LLVM-Project results here: https://securityscorecards.dev/viewer/?uri=github.com/llvm/llvm-project
6+
7+
name: Scorecard supply-chain security
8+
on:
9+
# For Branch-Protection check. Only the default branch is supported. See
10+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
11+
branch_protection_rule:
12+
# To guarantee Maintained check is occasionally updated. See
13+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
14+
schedule:
15+
- cron: '38 20 * * *'
16+
17+
# Declare default permissions as read only.
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
analysis:
23+
name: Scorecard analysis
24+
runs-on: ubuntu-latest
25+
permissions:
26+
# Needed to upload the results to code-scanning dashboard.
27+
security-events: write
28+
# Needed to publish results and get a badge (see publish_results below).
29+
id-token: write
30+
31+
steps:
32+
- name: "Checkout code"
33+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
34+
with:
35+
persist-credentials: false
36+
37+
- name: "Run analysis"
38+
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
39+
with:
40+
results_file: results.sarif
41+
results_format: sarif
42+
43+
# - Publish results to OpenSSF REST API for easy access by consumers
44+
# - Allows the repository to include the Scorecard badge.
45+
# - See https://github.com/ossf/scorecard-action#publishing-results.
46+
publish_results: true
47+
48+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
49+
# format to the repository Actions tab.
50+
- name: "Upload artifact"
51+
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
52+
with:
53+
name: SARIF file
54+
path: results.sarif
55+
retention-days: 5
56+
57+
# Upload the results to GitHub's code scanning dashboard.
58+
- name: "Upload to code-scanning"
59+
uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
60+
with:
61+
sarif_file: results.sarif

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# The LLVM Compiler Infrastructure
22

3+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/llvm/llvm-project/badge)](https://securityscorecards.dev/viewer/?uri=github.com/llvm/llvm-project)
4+
35
Welcome to the LLVM project!
46

57
This repository contains the source code for LLVM, a toolkit for the

bolt/include/bolt/Passes/ReorderFunctions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ReorderFunctions : public BinaryFunctionPass {
3232
RT_EXEC_COUNT,
3333
RT_HFSORT,
3434
RT_HFSORT_PLUS,
35-
RT_CDS,
35+
RT_CDSORT,
3636
RT_PETTIS_HANSEN,
3737
RT_RANDOM,
3838
RT_USER

0 commit comments

Comments
 (0)