Skip to content

Commit 6fbd7f0

Browse files
committed
LLVM and SPIRV-LLVM-Translator pulldown (WW42 2025)
LLVM: llvm/llvm-project@2d67cb1 SPIRV-LLVM-Translator: KhronosGroup/SPIRV-LLVM-Translator@54525b6
2 parents 12a0dd4 + 8b0d54a commit 6fbd7f0

File tree

8,245 files changed

+497504
-273853
lines changed

Some content is hidden

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

8,245 files changed

+497504
-273853
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
BasedOnStyle: LLVM
2+
LineEnding: LF

.github/renovate.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended"
5+
],
6+
"includePaths": [".github/**"],
7+
"schedule": "* 0 * * 1",
8+
"minimumReleaseAge": "3 days",
9+
"assignees": ["boomanaiden154"],
10+
"ignorePaths": [".github/workflows/containers/**"],
11+
"groupName": "[Github] Update GHA Dependencies"
12+
}

.github/workflows/gha-codeql.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Github Actions CodeQL
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '30 0 * * *'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
codeql:
19+
name: 'Github Actions CodeQL'
20+
runs-on: ubuntu-24.04
21+
permissions:
22+
security-events: write
23+
steps:
24+
- name: Checkout LLVM
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
with:
27+
sparse-checkout: |
28+
.github/
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
31+
with:
32+
languages: actions
33+
queries: security-extended
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# This file defines a workflow that runs the libc++ benchmarks when a comment is added to the PR.
2+
#
3+
# The comment is of the form:
4+
#
5+
# /libcxx-bot benchmark <path-to-benchmarks-to-run>
6+
#
7+
# That will cause the specified benchmarks to be run on the PR and on the pull-request target, and
8+
# their results to be compared.
9+
10+
name: Benchmark libc++
11+
12+
permissions:
13+
contents: read
14+
15+
on:
16+
issue_comment:
17+
types:
18+
- created
19+
- edited
20+
21+
env:
22+
CC: clang-22
23+
CXX: clang++-22
24+
25+
jobs:
26+
run-benchmarks:
27+
permissions:
28+
pull-requests: write
29+
30+
if: >-
31+
github.event.issue.pull_request &&
32+
contains(github.event.comment.body, '/libcxx-bot benchmark')
33+
34+
runs-on: llvm-premerge-libcxx-next-runners # TODO: This should run on a dedicated set of machines
35+
steps:
36+
- uses: actions/setup-python@v6
37+
with:
38+
python-version: '3.10'
39+
40+
- name: Extract information from the PR
41+
id: vars
42+
run: |
43+
python3 -m venv .venv
44+
source .venv/bin/activate
45+
python -m pip install pygithub
46+
47+
cat <<EOF | python >> ${GITHUB_OUTPUT}
48+
import github
49+
repo = github.Github("${{ github.token }}").get_repo("${{ github.repository }}")
50+
pr = repo.get_pull(${{ github.event.issue.number }})
51+
print(f"pr_base={pr.base.sha}")
52+
print(f"pr_head={pr.head.sha}")
53+
EOF
54+
BENCHMARKS=$(echo "${{ github.event.comment.body }}" | sed -nE 's/\/libcxx-bot benchmark (.+)/\1/p')
55+
echo "benchmarks=${BENCHMARKS}" >> ${GITHUB_OUTPUT}
56+
57+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
58+
with:
59+
ref: ${{ steps.vars.outputs.pr_head }}
60+
fetch-depth: 0
61+
fetch-tags: true # This job requires access to all the Git branches so it can diff against (usually) main
62+
path: repo # Avoid nuking the workspace, where we have the Python virtualenv
63+
64+
- name: Run baseline
65+
run: |
66+
source .venv/bin/activate && cd repo
67+
python -m pip install -r libcxx/utils/requirements.txt
68+
baseline_commit=$(git merge-base ${{ steps.vars.outputs.pr_base }} ${{ steps.vars.outputs.pr_head }})
69+
./libcxx/utils/test-at-commit --commit ${baseline_commit} -B build/baseline -- -sv -j1 --param optimization=speed ${{ steps.vars.outputs.benchmarks }}
70+
./libcxx/utils/consolidate-benchmarks build/baseline | tee baseline.lnt
71+
72+
- name: Run candidate
73+
run: |
74+
source .venv/bin/activate && cd repo
75+
./libcxx/utils/test-at-commit --commit ${{ steps.vars.outputs.pr_head }} -B build/candidate -- -sv -j1 --param optimization=speed ${{ steps.vars.outputs.benchmarks }}
76+
./libcxx/utils/consolidate-benchmarks build/candidate | tee candidate.lnt
77+
78+
- name: Compare baseline and candidate runs
79+
run: |
80+
source .venv/bin/activate && cd repo
81+
./libcxx/utils/compare-benchmarks baseline.lnt candidate.lnt | tee results.txt
82+
83+
- name: Update comment with results
84+
run: |
85+
source .venv/bin/activate && cd repo
86+
cat <<EOF | python
87+
import github
88+
repo = github.Github("${{ github.token }}").get_repo("${{ github.repository }}")
89+
pr = repo.get_pull(${{ github.event.issue.number }})
90+
comment = pr.get_issue_comment(${{ github.event.comment.id }})
91+
with open('results.txt', 'r') as f:
92+
benchmark_results = f.read()
93+
94+
new_comment_text = f"""
95+
{comment.body}
96+
97+
<details>
98+
<summary>
99+
Benchmark results:
100+
</summary>
101+
102+
\`\`\`
103+
{benchmark_results}
104+
\`\`\`
105+
106+
</details>
107+
"""
108+
109+
comment.edit(new_comment_text)
110+
EOF

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

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: "Code lint"
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
- 'users/**'
11+
paths:
12+
- 'clang-tools-extra/clang-tidy/**'
13+
- '.github/workflows/pr-code-lint.yml'
14+
15+
jobs:
16+
code_linter:
17+
if: github.repository_owner == 'llvm'
18+
runs-on: ubuntu-24.04
19+
defaults:
20+
run:
21+
shell: bash
22+
container:
23+
image: 'ghcr.io/llvm/ci-ubuntu-24.04:latest'
24+
timeout-minutes: 60
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
28+
steps:
29+
- name: Fetch LLVM sources
30+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
with:
32+
fetch-depth: 2
33+
34+
- name: Get changed files
35+
id: changed-files
36+
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
37+
with:
38+
separator: ","
39+
skip_initial_fetch: true
40+
base_sha: 'HEAD~1'
41+
sha: 'HEAD'
42+
43+
- name: Listed files
44+
env:
45+
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
46+
run: |
47+
echo "Changed files:"
48+
echo "$CHANGED_FILES"
49+
50+
- name: Install clang-tidy
51+
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
52+
with:
53+
clang-tidy: 20.1.8
54+
55+
- name: Setup Python env
56+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
57+
with:
58+
python-version: '3.12'
59+
60+
- name: Install Python dependencies
61+
run: python3 -m pip install -r llvm/utils/git/requirements_linting.txt
62+
63+
# TODO: create special mapping for 'codegen' targets, for now build predefined set
64+
# TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies
65+
- name: Configure and CodeGen
66+
run: |
67+
git config --global --add safe.directory '*'
68+
69+
. <(git diff --name-only HEAD~1...HEAD | python3 .ci/compute_projects.py)
70+
71+
if [[ "${projects_to_build}" == "" ]]; then
72+
echo "No projects to analyze"
73+
exit 0
74+
fi
75+
76+
cmake -G Ninja \
77+
-B build \
78+
-S llvm \
79+
-DLLVM_ENABLE_ASSERTIONS=OFF \
80+
-DLLVM_ENABLE_PROJECTS="${projects_to_build}" \
81+
-DCMAKE_CXX_COMPILER=clang++ \
82+
-DCMAKE_C_COMPILER=clang \
83+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
84+
-DLLVM_INCLUDE_TESTS=OFF \
85+
-DCLANG_INCLUDE_TESTS=OFF \
86+
-DCMAKE_BUILD_TYPE=Release
87+
88+
ninja -C build \
89+
clang-tablegen-targets \
90+
genconfusable # for "ConfusableIdentifierCheck.h"
91+
92+
- name: Run code linter
93+
env:
94+
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
95+
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
96+
run: |
97+
echo "[]" > comments &&
98+
python3 llvm/utils/git/code-lint-helper.py \
99+
--token ${{ secrets.GITHUB_TOKEN }} \
100+
--issue-number $GITHUB_PR_NUMBER \
101+
--start-rev HEAD~1 \
102+
--end-rev HEAD \
103+
--verbose \
104+
--changed-files "$CHANGED_FILES"
105+
106+
- name: Upload results
107+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
108+
if: always()
109+
with:
110+
name: workflow-args
111+
path: |
112+
comments

bolt/include/bolt/Core/BinaryContext.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ class BinaryContext {
190190
/// Unique build ID if available for the binary.
191191
std::optional<std::string> FileBuildID;
192192

193+
/// GNU property note indicating AArch64 BTI.
194+
bool UsesBTI{false};
195+
193196
/// Set of all sections.
194197
struct CompareSections {
195198
bool operator()(const BinarySection *A, const BinarySection *B) const {
@@ -288,6 +291,12 @@ class BinaryContext {
288291
/// overwritten, but it is okay to re-generate debug info for them.
289292
std::set<const DWARFUnit *> ProcessedCUs;
290293

294+
/// DWARF-related container to manage lifecycle of groups of rows from line
295+
/// tables associated with instructions. Since binary functions can span
296+
/// multiple compilation units, instructions may reference debug line
297+
/// information from multiple CUs.
298+
ClusteredRowsContainer ClusteredRows;
299+
291300
// Setup MCPlus target builder
292301
void initializeTarget(std::unique_ptr<MCPlusBuilder> TargetBuilder) {
293302
MIB = std::move(TargetBuilder);
@@ -320,6 +329,9 @@ class BinaryContext {
320329
/// Returns true if DWARF4 or lower is used.
321330
bool isDWARFLegacyUsed() const { return ContainsDwarfLegacy; }
322331

332+
/// Returns true if DWARFUnit is valid.
333+
bool isValidDwarfUnit(DWARFUnit &DU) const;
334+
323335
std::map<unsigned, DwarfLineTable> &getDwarfLineTables() {
324336
return DwarfLineTablesCUMap;
325337
}
@@ -375,6 +387,9 @@ class BinaryContext {
375387
}
376388
void setFileBuildID(StringRef ID) { FileBuildID = std::string(ID); }
377389

390+
bool usesBTI() const { return UsesBTI; }
391+
void setUsesBTI(bool Value) { UsesBTI = Value; }
392+
378393
bool hasSymbolsWithFileName() const { return HasSymbolsWithFileName; }
379394
void setHasSymbolsWithFileName(bool Value) { HasSymbolsWithFileName = Value; }
380395

0 commit comments

Comments
 (0)