Skip to content

Commit 195149f

Browse files
authored
Merge branch 'llvm:main' into clang-tools-headers
2 parents 810e5f8 + 53fea6f commit 195149f

File tree

2,121 files changed

+77001
-31340
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,121 files changed

+77001
-31340
lines changed

.ci/generate-buildkite-pipeline-premerge

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#
1111
# This file generates a Buildkite pipeline that triggers the various CI jobs for
12-
# the LLVM project during pre-commit CI (each time a Phabricator diff is uploaded).
12+
# the LLVM project during pre-commit CI.
1313
#
1414
# See https://buildkite.com/docs/agent/v3/cli-pipeline#pipeline-format.
1515
#
@@ -22,19 +22,18 @@ set -o pipefail
2222

2323
# Environment variables script works with:
2424

25-
# Fetch origin/main to have an up to date merge base for main...HEAD diff.
26-
git fetch origin main:main
25+
# Set by buildkite
26+
: ${BUILDKITE_PULL_REQUEST_BASE_BRANCH:=}
27+
: ${BUILDKITE_COMMIT:=}
28+
: ${BUILDKITE_BRANCH:=}
29+
# Fetch origin to have an up to date merge base for the diff.
30+
git fetch origin
2731
# List of files affected by this commit
28-
: ${MODIFIED_FILES:=$(git diff --name-only main...HEAD)}
32+
: ${MODIFIED_FILES:=$(git diff --name-only origin/${BUILDKITE_PULL_REQUEST_BASE_BRANCH}...HEAD)}
2933
# Filter rules for generic windows tests
3034
: ${WINDOWS_AGENTS:='{"queue": "windows"}'}
3135
# Filter rules for generic linux tests
3236
: ${LINUX_AGENTS:='{"queue": "linux"}'}
33-
# Service agents, for interacting with Phabricator.
34-
: ${SERVICE_AGENTS:='{"queue": "service"}'}
35-
# Set by buildkite
36-
: ${BUILDKITE_COMMIT:=}
37-
: ${BUILDKITE_BRANCH:=}
3837

3938
reviewID="$(git log --format=%B -n 1 | sed -nE 's/^Review-ID:[[:space:]]*(.+)$/\1/p')"
4039
if [[ "${reviewID}" != "" ]]; then
@@ -284,28 +283,3 @@ if [[ "${windows_projects}" != "" ]]; then
284283
- 'bash .ci/monolithic-windows.sh "$(echo ${windows_projects} | tr ' ' ';')" "$(echo ${windows_check_targets})"'
285284
EOF
286285
fi
287-
288-
# If build was triggered from a Phabricator review - send an update back.
289-
if [[ -n "${ph_target_phid:-}" ]]; then
290-
cat << EOF
291-
- continue_on_failure: true
292-
wait: '~'
293-
- label: ':phabricator: update build status on Phabricator'
294-
agents: ${SERVICE_AGENTS}
295-
artifact_paths:
296-
- 'artifacts/**/*'
297-
commands:
298-
- export SRC=\$\${BUILDKITE_BUILD_PATH}/llvm-premerge-checks
299-
- rm -rf \$\${SRC}
300-
- git clone --depth 1 https://github.com/google/llvm-premerge-checks.git "\$\${SRC}"
301-
- cd \$\${SRC}
302-
- git fetch origin "main":x
303-
- git checkout x
304-
- echo "llvm-premerge-checks commit"
305-
- git rev-parse HEAD
306-
- pip install -q -r \$\${SRC}/scripts/requirements.txt
307-
- cd "\$\$BUILDKITE_BUILD_CHECKOUT_PATH"
308-
- \$\${SRC}/scripts/summary.py
309-
timeout_in_minutes: 10
310-
EOF
311-
fi

.ci/generate-buildkite-pipeline-scheduled

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

.github/workflows/issue-release-workflow.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
backport-commits:
3434
name: Backport Commits
3535
runs-on: ubuntu-latest
36+
permissions:
37+
issues: write
38+
pull-requests: write
3639
if: >-
3740
(github.repository == 'llvm/llvm-project') &&
3841
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
@@ -58,37 +61,8 @@ jobs:
5861
printf "%s" "$COMMENT_BODY" |
5962
./llvm/utils/git/github-automation.py \
6063
--repo "$GITHUB_REPOSITORY" \
61-
--token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
64+
--token "${{ secrets.RELEASE_WORKFLOW_PR_CREATE }}" \
6265
release-workflow \
66+
--branch-repo-token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
6367
--issue-number ${{ github.event.issue.number }} \
64-
--phab-token ${{ secrets.RELEASE_WORKFLOW_PHAB_TOKEN }} \
65-
auto
66-
67-
create-pull-request:
68-
name: Create Pull Request
69-
runs-on: ubuntu-latest
70-
if: >-
71-
(github.repository == 'llvm/llvm-project') &&
72-
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
73-
contains(github.event.comment.body, '/branch ')
74-
75-
steps:
76-
- name: Fetch LLVM sources
77-
uses: actions/checkout@v4
78-
with:
79-
persist-credentials: false
80-
81-
- name: Setup Environment
82-
run: |
83-
pip install -r ./llvm/utils/git/requirements.txt
84-
85-
- name: Create Pull Request
86-
run: |
87-
printf "%s" "$COMMENT_BODY" |
88-
./llvm/utils/git/github-automation.py \
89-
--repo "$GITHUB_REPOSITORY" \
90-
--token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
91-
release-workflow \
92-
--issue-number ${{ github.event.issue.number }} \
93-
--phab-token ${{ secrets.RELEASE_WORKFLOW_PHAB_TOKEN }} \
9468
auto

.github/workflows/libclang-python-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ permissions:
66
on:
77
workflow_dispatch:
88
push:
9+
branches:
10+
- 'main'
911
paths:
1012
- 'clang/bindings/python/**'
1113
- 'clang/tools/libclang/**'
@@ -30,6 +32,7 @@ jobs:
3032
check-clang-python:
3133
# Build libclang and then run the libclang Python binding's unit tests.
3234
name: Build and run Python unit tests
35+
if: github.repository == 'llvm/llvm-project'
3336
strategy:
3437
fail-fast: false
3538
matrix:

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

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ on:
2323
- 'cmake/**'
2424
- '.github/workflows/libcxx-build-and-test.yaml'
2525
schedule:
26-
# Run nightly at 8 AM UTC (or roughly 3 AM eastern)
27-
- cron: '0 3 * * *'
26+
# Run nightly at 08:00 UTC (aka 00:00 Pacific, aka 03:00 Eastern)
27+
- cron: '0 8 * * *'
2828

2929
permissions:
3030
contents: read # Default everything to read-only
@@ -199,3 +199,45 @@ jobs:
199199
**/CMakeError.log
200200
**/CMakeOutput.log
201201
**/crash_diagnostics/*
202+
windows:
203+
runs-on: windows-2022
204+
needs: [ stage1 ]
205+
strategy:
206+
fail-fast: false
207+
matrix:
208+
include:
209+
- { config: clang-cl-dll, mingw: false }
210+
- { config: clang-cl-static, mingw: false }
211+
- { config: clang-cl-no-vcruntime, mingw: false }
212+
- { config: clang-cl-debug, mingw: false }
213+
- { config: clang-cl-static-crt, mingw: false }
214+
- { config: mingw-dll, mingw: true }
215+
- { config: mingw-static, mingw: true }
216+
- { config: mingw-dll-i686, mingw: true }
217+
steps:
218+
- uses: actions/checkout@v4
219+
- name: Install dependencies
220+
run: |
221+
choco install -y ninja wget
222+
pip install psutil
223+
- name: Install a current LLVM
224+
if: ${{ matrix.mingw != true }}
225+
run: |
226+
choco install -y llvm --version=17.0.6
227+
- name: Install llvm-mingw
228+
if: ${{ matrix.mingw == true }}
229+
run: |
230+
curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-x86_64.zip
231+
powershell Expand-Archive llvm-mingw*.zip -DestinationPath .
232+
del llvm-mingw*.zip
233+
mv llvm-mingw* c:\llvm-mingw
234+
echo "c:\llvm-mingw\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
235+
- name: Add Git Bash to the path
236+
run: |
237+
echo "c:\Program Files\Git\usr\bin" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
238+
- name: Set up the MSVC dev environment
239+
if: ${{ matrix.mingw != true }}
240+
uses: ilammy/msvc-dev-cmd@v1
241+
- name: Build and test
242+
run: |
243+
bash libcxx/utils/ci/run-buildbot ${{ matrix.config }}

.github/workflows/llvm-project-tests.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
required: false
1515
os_list:
1616
required: false
17-
default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
17+
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
1818
python_version:
1919
required: false
2020
type: string
@@ -38,9 +38,7 @@ on:
3838
type: string
3939
# Use windows-2019 due to:
4040
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
41-
# We're using a specific version of macOS due to:
42-
# https://github.com/actions/virtual-environments/issues/5900
43-
default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
41+
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
4442

4543
python_version:
4644
required: false
@@ -95,7 +93,8 @@ jobs:
9593
# run creates a new cache entry so we want to ensure that we have
9694
# enough cache space for all the tests to run at once and still
9795
# fit under the 10 GB limit.
98-
max-size: 500M
96+
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
97+
max-size: 2G
9998
key: ${{ matrix.os }}
10099
variant: sccache
101100
- name: Build and Test

.github/workflows/llvm-tests.yml

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,13 @@ concurrency:
2727
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
2828

2929
jobs:
30-
check_all:
30+
check-all:
3131
if: github.repository_owner == 'llvm'
32-
name: Test llvm,clang,libclc
32+
name: Build and Test
3333
uses: ./.github/workflows/llvm-project-tests.yml
3434
with:
3535
build_target: check-all
36-
projects: clang;libclc
37-
38-
# These need to be separate from the check_all job, becuase there is not enough disk
39-
# space to build all these projects on Windows.
40-
build_lldb:
41-
if: github.repository_owner == 'llvm'
42-
name: Build lldb
43-
uses: ./.github/workflows/llvm-project-tests.yml
44-
with:
45-
build_target: ''
46-
projects: clang;lldb
47-
48-
check_lld:
49-
if: github.repository_owner == 'llvm'
50-
name: Test lld
51-
uses: ./.github/workflows/llvm-project-tests.yml
52-
with:
53-
build_target: check-lld
54-
projects: lld
36+
projects: clang;lld;libclc;lldb
5537

5638
abi-dump-setup:
5739
if: github.repository_owner == 'llvm'

.github/workflows/version-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_version_from_tag(tag):
1616

1717
m = re.match("llvmorg-([0-9]+)-init", tag)
1818
if m:
19-
return (m.group(1), "0", "0")
19+
return (m.group(1), "1", "0")
2020

2121
raise Exception(f"error: Tag is not valid: {tag}")
2222

bolt/docs/BAT.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Cold functions table header
6161
```
6262

6363
### Functions table
64-
Hot and cold functions tables share the encoding except difference marked below.
64+
Hot and cold functions tables share the encoding except differences marked below.
6565
Header:
6666
| Entry | Encoding | Description |
6767
| ------ | ----- | ----------- |
@@ -80,18 +80,23 @@ Hot indices are delta encoded, implicitly starting at zero.
8080
| `Address` | Continuous, Delta, ULEB128 | Function address in the output binary |
8181
| `HotIndex` | Delta, ULEB128 | Cold functions only: index of corresponding hot function in hot functions table |
8282
| `NumEntries` | ULEB128 | Number of address translation entries for a function |
83+
| `EqualElems` | ULEB128 | Hot functions only: number of equal offsets in the beginning of a function |
84+
| `BranchEntries` | Bitmask, `alignTo(EqualElems, 8)` bits | Hot functions only: if `EqualElems` is non-zero, bitmask denoting entries with `BRANCHENTRY` bit |
8385

84-
Function header is followed by `NumEntries` pairs of offsets for current
85-
function.
86+
Function header is followed by `EqualElems` offsets (hot functions only) and
87+
`NumEntries-EqualElems` (`NumEntries` for cold functions) pairs of offsets for
88+
current function.
8689

8790
### Address translation table
8891
Delta encoding means that only the difference with the previous corresponding
8992
entry is encoded. Input offsets implicitly start at zero.
9093
| Entry | Encoding | Description |
9194
| ------ | ------| ----------- |
9295
| `OutputOffset` | Continuous, Delta, ULEB128 | Function offset in output binary |
93-
| `InputOffset` | Delta, SLEB128 | Function offset in input binary with `BRANCHENTRY` LSB bit |
96+
| `InputOffset` | Optional, Delta, SLEB128 | Function offset in input binary with `BRANCHENTRY` LSB bit |
9497

9598
`BRANCHENTRY` bit denotes whether a given offset pair is a control flow source
9699
(branch or call instruction). If not set, it signifies a control flow target
97100
(basic block offset).
101+
`InputAddr` is omitted for equal offsets in input and output function. In this
102+
case, `BRANCHENTRY` bits are encoded separately in a `BranchEntries` bitvector.

0 commit comments

Comments
 (0)