Skip to content

Commit 23455e5

Browse files
committed
merge main into amd-staging
2 parents ef67f0c + 87ce117 commit 23455e5

File tree

1,125 files changed

+346556
-335281
lines changed

Some content is hidden

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

1,125 files changed

+346556
-335281
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
container-filename: ${{ steps.vars.outputs.container-filename }}
2828
steps:
2929
- name: Checkout LLVM
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3131
with:
3232
sparse-checkout: .github/workflows/containers/github-action-ci-windows
3333
- name: Write Variables
@@ -46,7 +46,7 @@ jobs:
4646
run: |
4747
docker save ${{ steps.vars.outputs.container-name-tag }} > ${{ steps.vars.outputs.container-filename }}
4848
- name: Upload container image
49-
uses: actions/upload-artifact@v4
49+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
5050
with:
5151
name: container
5252
path: ${{ steps.vars.outputs.container-filename }}
@@ -63,7 +63,7 @@ jobs:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6464
steps:
6565
- name: Download container
66-
uses: actions/download-artifact@v4
66+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
6767
with:
6868
name: container
6969
- name: Push Container

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: depot-ubuntu-22.04-arm-16
3333
steps:
3434
- name: Checkout LLVM
35-
uses: actions/checkout@v4
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3636
with:
3737
sparse-checkout: .github/workflows/containers/github-action-ci/
3838
# podman is not installed by default on the ARM64 images.
@@ -66,7 +66,7 @@ jobs:
6666
podman save ${{ steps.vars.outputs.container-name-agent-tag }} > ${{ steps.vars.outputs.container-agent-filename }}
6767
6868
- name: Upload container image
69-
uses: actions/upload-artifact@v4
69+
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
7070
with:
7171
name: container-${{ matrix.arch }}
7272
path: "*.tar"
@@ -90,7 +90,7 @@ jobs:
9090
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9191
steps:
9292
- name: Download container
93-
uses: actions/download-artifact@v4
93+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
9494

9595
- name: Push Container
9696
run: |

.github/workflows/premerge.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ jobs:
3333
runs-on: llvm-premerge-linux-runners
3434
steps:
3535
- name: Checkout LLVM
36-
uses: actions/checkout@v4
36+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3737
with:
3838
fetch-depth: 2
3939
- name: Setup ccache
40-
uses: hendrikmuhs/ccache-action@v1.2.14
40+
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
4141
with:
4242
max-size: "2000M"
4343
- name: Build and Test
@@ -94,11 +94,11 @@ jobs:
9494
shell: bash
9595
steps:
9696
- name: Checkout LLVM
97-
uses: actions/checkout@v4
97+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
9898
with:
9999
fetch-depth: 2
100100
- name: Setup ccache
101-
uses: hendrikmuhs/ccache-action@v1.2.14
101+
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
102102
with:
103103
variant: "sccache"
104104
max-size: "2000M"
@@ -153,11 +153,11 @@ jobs:
153153
(github.event_name != 'pull_request' || github.event.action != 'closed')
154154
steps:
155155
- name: Checkout LLVM
156-
uses: actions/checkout@v4
156+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
157157
with:
158158
fetch-depth: 2
159159
- name: Setup ccache
160-
uses: hendrikmuhs/ccache-action@v1.2.14
160+
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
161161
with:
162162
max-size: "2000M"
163163
- name: Install Ninja

.github/workflows/release-asset-audit.py

Lines changed: 63 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import github
2+
import re
23
import sys
34

45
_SPECIAL_CASE_BINARIES = {
@@ -16,38 +17,73 @@ def _is_valid(uploader_name, valid_uploaders, asset_name):
1617
return False
1718

1819

20+
def _get_uploaders(release_version):
21+
# Until llvm 18, assets were uploaded by community members, the release managers
22+
# and the GitHub Actions bot.
23+
if release_version <= 18:
24+
return set(
25+
[
26+
"DimitryAndric",
27+
"stefanp-ibm",
28+
"lei137",
29+
"omjavaid",
30+
"nicolerabjohn",
31+
"amy-kwan",
32+
"mandlebug",
33+
"zmodem",
34+
"androm3da",
35+
"tru",
36+
"rovka",
37+
"rorth",
38+
"quinnlp",
39+
"kamaub",
40+
"abrisco",
41+
"jakeegan",
42+
"maryammo",
43+
"tstellar",
44+
"github-actions[bot]",
45+
]
46+
)
47+
# llvm 19 and beyond, only the release managers, bot and a much smaller
48+
# number of community members.
49+
elif release_version >= 19:
50+
return set(
51+
[
52+
"zmodem",
53+
"omjavaid",
54+
"tru",
55+
"tstellar",
56+
"github-actions[bot]",
57+
]
58+
)
59+
60+
61+
def _get_major_release_version(release_title):
62+
# All release titles are of the form "LLVM X.Y.Z(-rcN)".
63+
match = re.match("LLVM ([0-9]+)\.", release_title)
64+
if match is None:
65+
_write_comment_and_exit_with_error(
66+
f'Could not parse release version from release title "{release_title}".'
67+
)
68+
else:
69+
return int(match.groups()[0])
70+
71+
72+
def _write_comment_and_exit_with_error(comment):
73+
with open("comment", "w") as file:
74+
file.write(comment)
75+
sys.exit(1)
76+
77+
1978
def main():
2079
token = sys.argv[1]
2180

2281
gh = github.Github(login_or_token=token)
2382
repo = gh.get_repo("llvm/llvm-project")
2483

25-
uploaders = set(
26-
[
27-
"DimitryAndric",
28-
"stefanp-ibm",
29-
"lei137",
30-
"omjavaid",
31-
"nicolerabjohn",
32-
"amy-kwan",
33-
"mandlebug",
34-
"zmodem",
35-
"androm3da",
36-
"tru",
37-
"rovka",
38-
"rorth",
39-
"quinnlp",
40-
"kamaub",
41-
"abrisco",
42-
"jakeegan",
43-
"maryammo",
44-
"tstellar",
45-
"github-actions[bot]",
46-
]
47-
)
48-
4984
for release in repo.get_releases():
5085
print("Release:", release.title)
86+
uploaders = _get_uploaders(_get_major_release_version(release.title))
5187
for asset in release.get_assets():
5288
created_at = asset.created_at
5389
updated_at = (
@@ -57,9 +93,9 @@ def main():
5793
f"{asset.name} : {asset.uploader.login} [{created_at} {updated_at}] ( {asset.download_count} )"
5894
)
5995
if not _is_valid(asset.uploader.login, uploaders, asset.name):
60-
with open('comment', 'w') as file:
61-
file.write(f'@{asset.uploader.login} is not a valid uploader.')
62-
sys.exit(1)
96+
_write_comment_and_exit_with_error(
97+
f"@{asset.uploader.login} is not a valid uploader."
98+
)
6399

64100

65101
if __name__ == "__main__":

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ Jianjian GUAN <jacquesguan@me.com> <Jianjian.Guan@streamcomputing.com>
3838
Jon Roelofs <jonathan_roelofs@apple.com> <jonathan@codesourcery.com>
3939
Jon Roelofs <jonathan_roelofs@apple.com> <jroelofs@jroelofs.com>
4040
Jonathan Thackray <jonathan.thackray@arm.com> <jthackray@users.noreply.github.com>
41+
klensy <nightouser@gmail.com>
42+
klensy <nightouser@gmail.com> <klensy@users.noreply.github.com>
4143
LLVM GN Syncbot <llvmgnsyncbot@gmail.com>
4244
Martin Storsjö <martin@martin.st>
4345
Med Ismail Bennani <ismail@bennani.ma> <m.i.b@apple.com>

bolt/include/bolt/Profile/DataAggregator.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class DataAggregator : public DataReader {
9494

9595
/// Used for parsing specific pre-aggregated input files.
9696
struct AggregatedLBREntry {
97-
enum Type : char { BRANCH = 0, FT, FT_EXTERNAL_ORIGIN };
97+
enum Type : char { BRANCH = 0, FT, FT_EXTERNAL_ORIGIN, TRACE };
9898
Location From;
9999
Location To;
100100
uint64_t Count;
@@ -197,6 +197,10 @@ class DataAggregator : public DataReader {
197197

198198
BoltAddressTranslation *BAT{nullptr};
199199

200+
/// Whether pre-aggregated profile needs to convert branch profile into call
201+
/// to continuation fallthrough profile.
202+
bool NeedsConvertRetProfileToCallCont{false};
203+
200204
/// Update function execution profile with a recorded trace.
201205
/// A trace is region of code executed between two LBR entries supplied in
202206
/// execution order.
@@ -268,8 +272,7 @@ class DataAggregator : public DataReader {
268272
uint64_t Mispreds);
269273

270274
/// Register a \p Branch.
271-
bool doBranch(uint64_t From, uint64_t To, uint64_t Count, uint64_t Mispreds,
272-
bool IsPreagg);
275+
bool doBranch(uint64_t From, uint64_t To, uint64_t Count, uint64_t Mispreds);
273276

274277
/// Register a trace between two LBR entries supplied in execution order.
275278
bool doTrace(const LBREntry &First, const LBREntry &Second,
@@ -298,7 +301,7 @@ class DataAggregator : public DataReader {
298301
ErrorOr<PerfMemSample> parseMemSample();
299302

300303
/// Parse pre-aggregated LBR samples created by an external tool
301-
ErrorOr<AggregatedLBREntry> parseAggregatedLBREntry();
304+
std::error_code parseAggregatedLBREntry();
302305

303306
/// Parse either buildid:offset or just offset, representing a location in the
304307
/// binary. Used exclusively for pre-aggregated LBR samples.
@@ -384,14 +387,15 @@ class DataAggregator : public DataReader {
384387
/// memory.
385388
///
386389
/// File format syntax:
387-
/// {B|F|f} [<start_id>:]<start_offset> [<end_id>:]<end_offset> <count>
388-
/// [<mispred_count>]
390+
/// {B|F|f|T} [<start_id>:]<start_offset> [<end_id>:]<end_offset> [<ft_end>]
391+
/// <count> [<mispred_count>]
389392
///
390393
/// B - indicates an aggregated branch
391394
/// F - an aggregated fall-through
392395
/// f - an aggregated fall-through with external origin - used to disambiguate
393396
/// between a return hitting a basic block head and a regular internal
394397
/// jump to the block
398+
/// T - an aggregated trace: branch with a fall-through (from, to, ft_end)
395399
///
396400
/// <start_id> - build id of the object containing the start address. We can
397401
/// skip it for the main binary and use "X" for an unknown object. This will
@@ -402,6 +406,8 @@ class DataAggregator : public DataReader {
402406
///
403407
/// <end_id>, <end_offset> - same for the end address.
404408
///
409+
/// <ft_end> - same for the fallthrough_end address.
410+
///
405411
/// <count> - total aggregated count of the branch or a fall-through.
406412
///
407413
/// <mispred_count> - the number of times the branch was mispredicted.

0 commit comments

Comments
 (0)