Skip to content

Commit e5da104

Browse files
authored
Merge branch 'main' into thunk_size
2 parents 1436606 + 303fba0 commit e5da104

File tree

3,145 files changed

+330952
-26348
lines changed

Some content is hidden

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

3,145 files changed

+330952
-26348
lines changed

.ci/monolithic-windows.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ runtimes_targets="${4}"
2323
start-group "CMake"
2424
pip install -q -r "${MONOREPO_ROOT}"/.ci/all_requirements.txt
2525

26-
export CC=cl
27-
export CXX=cl
26+
export CC=C:/clang/clang-msvc/bin/clang-cl.exe
27+
export CXX=C:/clang/clang-msvc/bin/clang-cl.exe
2828
export LD=link
2929

3030
# The CMAKE_*_LINKER_FLAGS to disable the manifest come from research
@@ -49,6 +49,7 @@ cmake -S "${MONOREPO_ROOT}"/llvm -B "${BUILD_DIR}" \
4949
-D CMAKE_EXE_LINKER_FLAGS="/MANIFEST:NO" \
5050
-D CMAKE_MODULE_LINKER_FLAGS="/MANIFEST:NO" \
5151
-D CMAKE_SHARED_LINKER_FLAGS="/MANIFEST:NO" \
52+
-D CMAKE_CXX_FLAGS="-Wno-c++98-compat -Wno-c++14-compat -Wno-unsafe-buffer-usage -Wno-old-style-cast" \
5253
-D LLVM_ENABLE_RUNTIMES="${runtimes}"
5354

5455
start-group "ninja"

.ci/premerge_advisor_upload.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@
1212

1313
import generate_test_report_lib
1414

15-
PREMERGE_ADVISOR_URL = (
16-
"http://premerge-advisor.premerge-advisor.svc.cluster.local:5000/upload"
17-
)
15+
# These are IP addresses of the two premerge advisor instances. They should
16+
# eventually be updated to domain names.
17+
PREMERGE_ADVISOR_URLS = [
18+
"http://34.82.126.63:5000/upload",
19+
"http://136.114.125.23:5000/upload",
20+
]
1821

1922

2023
def main(commit_sha, workflow_run_number, build_log_files):
@@ -41,7 +44,8 @@ def main(commit_sha, workflow_run_number, build_log_files):
4144
ninja_failures = generate_test_report_lib.find_failure_in_ninja_logs(ninja_logs)
4245
for name, failure_message in ninja_failures:
4346
failure_info["failures"].append({"name": name, "message": failure_message})
44-
requests.post(PREMERGE_ADVISOR_URL, json=failure_info)
47+
for premerge_advisor_url in PREMERGE_ADVISOR_URLS:
48+
requests.post(premerge_advisor_url, json=failure_info)
4549

4650

4751
if __name__ == "__main__":

.ci/utils.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ function at-exit {
4040
fi
4141

4242
if [[ "$retcode" != "0" ]]; then
43-
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
44-
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
45-
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
4643
if [[ "$GITHUB_ACTIONS" != "" ]]; then
4744
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_explain.py \
4845
$(git rev-parse HEAD~1) "${BUILD_DIR}"/test-results.*.xml \
4946
"${MONOREPO_ROOT}"/ninja*.log
47+
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
48+
$(git rev-parse HEAD~1) $GITHUB_RUN_NUMBER \
49+
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
50+
else
51+
python "${MONOREPO_ROOT}"/.ci/premerge_advisor_upload.py \
52+
$(git rev-parse HEAD) $BUILDBOT_BUILDNUMBER \
53+
"${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log
5054
fi
5155
fi
5256
}

.github/workflows/containers/github-action-ci-tooling/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ RUN apt-get update && \
3737
apt-get clean && \
3838
rm -rf /var/lib/apt/lists/*
3939

40+
# Create a new user with id 1001 as that is the user id that
41+
# Github Actions uses to perform the checkout action.
42+
RUN useradd gha -u 1001 -m -s /bin/bash
43+
RUN adduser gha sudo
44+
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
45+
# Don't set USER gha right away because we still need to install packages
46+
# as root in 'ci-container-code-format' and 'ci-container-code-lint' containers
47+
4048

4149
FROM base AS ci-container-code-format
4250
ARG LLVM_VERSION
@@ -51,6 +59,8 @@ ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
5159
COPY llvm/utils/git/requirements_formatting.txt requirements_formatting.txt
5260
RUN pip install -r requirements_formatting.txt --break-system-packages && \
5361
rm requirements_formatting.txt
62+
USER gha
63+
WORKDIR /home/gha
5464

5565

5666
FROM base AS ci-container-code-lint
@@ -80,3 +90,5 @@ RUN apt-get update && \
8090
COPY llvm/utils/git/requirements_linting.txt requirements_linting.txt
8191
RUN pip install -r requirements_linting.txt --break-system-packages && \
8292
rm requirements_linting.txt
93+
USER gha
94+
WORKDIR /home/gha

.github/workflows/containers/github-action-ci-windows/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,45 @@ RUN powershell -Command \
9898
Add-Type -AssemblyName System.IO.Compression.FileSystem ; \
9999
[System.IO.Compression.ZipFile]::ExtractToDirectory('actions-runner-win.zip', $PWD) ;\
100100
rm actions-runner-win.zip
101+
102+
# Set the LLVM_VERSION environment variable
103+
ENV LLVM_VERSION=21.1.2
104+
105+
# Download and extract Clang compiler.
106+
# Create directories, download, extract, and clean up all in one layer
107+
RUN powershell -Command \
108+
# --- Setup directories --- \
109+
Write-Host "Creating directories..."; \
110+
New-Item -Path "C:\temp-download" -ItemType "Directory" -Force ; \
111+
New-Item -Path "C:\xz-utils" -ItemType "Directory" -Force ; \
112+
New-Item -Path "C:\clang" -ItemType "Directory" -Force ; \
113+
# --- 1. Download and extract xz --- \
114+
Set-Location C:\temp-download ; \
115+
Invoke-WebRequest -Uri "http://github.com/tukaani-project/xz/releases/download/v5.8.1/xz-5.8.1-windows.zip" -OutFile "xz.zip"; \
116+
(Get-FileHash -Path "C:\temp-download\xz.zip" -Algorithm MD5).Hash -eq 'c3c69fdce3e825cc0b76123b36b0bcc2' ; \
117+
Add-Type -AssemblyName "System.IO.Compression.FileSystem"; \
118+
[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\temp-download\xz.zip', 'C:\xz-utils'); \
119+
# --- 2. Download and decompress Clang --- \
120+
Invoke-WebRequest -Uri "http://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.2/clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" -OutFile "clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" ; \
121+
(Get-FileHash -Path "C:\temp-download\clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz" -Algorithm MD5).Hash -eq '0ae1d3effd9ab9d323f7fa595777f0a2' ; \
122+
C:\xz-utils\bin_x86-64\xz.exe -d -qq clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar.xz ; \
123+
# --- 3. Extract clang --- \
124+
C:\Windows\System32\tar.exe -xf clang+llvm-21.1.2-x86_64-pc-windows-msvc.tar -C C:\clang ; \
125+
# --- 4. Clean up --- \
126+
Set-Location C:\ ; \
127+
Remove-Item C:\temp-download -Recurse -Force; \
128+
Remove-Item C:\xz-utils -Recurse -Force; \
129+
# -- 5. Shorten path to clang files & remove unnecessary files -- \
130+
Set-Location C:\clang ; \
131+
Rename-Item -Path "C:\clang\clang+llvm-21.1.2-x86_64-pc-windows-msvc" -NewName "C:\clang\clang-msvc" ; \
132+
Set-Location C:\clang\clang-msvc ; \
133+
Remove-Item -Path C:\clang\clang-msvc\libexec -Recurse -Force ; \
134+
Remove-Item -Path C:\clang\clang-msvc\share -Recurse -Force ; \
135+
Rename-Item -Path "C:\clang\clang-msvc\bin" -NewName "C:\clang\clang-msvc\bin-full" ; \
136+
New-Item -Path "C:\clang\clang-msvc\bin" -ItemType Directory -Force ; \
137+
Set-Location C:\clang\clang-msvc\bin ; \
138+
Copy-Item -Path C:\clang\clang-msvc\bin-full\*.dll -Destination C:\clang\clang-msvc\bin\. ; \
139+
Copy-Item -Path C:\clang\clang-msvc\bin-full\clang-cl.exe -Destination C:\clang\clang-msvc\bin\. ; \
140+
Copy-Item -Path C:\clang\clang-msvc\bin-full\lld-link.exe -Destination C:\clang\clang-msvc\bin\. ; \
141+
Set-Location C:\clang\clang-msvc ; \
142+
Remove-Item -Path C:\clang\clang-msvc\bin-full -Recurse -Force ;

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@ jobs:
2525
with:
2626
fetch-depth: 2
2727

28-
# We need to set the repo checkout as safe, otherwise tj-actions/changed-files
29-
# will fail due to the changed ownership inside the container.
30-
# TODO(boomanaiden154): We should probably fix this by having the default user
31-
# in the container have the same ID as the GHA user on the host.
32-
- name: Set Safe Directory
33-
run: |
34-
chown -R root $(pwd)
35-
3628
- name: Get changed files
3729
id: changed-files
3830
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ jobs:
3131
with:
3232
fetch-depth: 2
3333

34-
# FIXME: same as in ".github/workflows/pr-code-format.yml"
35-
- name: Set Safe Directory
36-
run: |
37-
chown -R root $(pwd)
38-
3934
- name: Get changed files
4035
id: changed-files
4136
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5

.github/workflows/release-binaries.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,24 +132,16 @@ jobs:
132132
arches=arm64
133133
else
134134
arches=x86_64
135-
# Disable Flang builds on macOS x86_64. The FortranLower library takes
136-
# 2-3 hours to build on macOS, much slower than on Linux.
137-
# The long build time causes the release build to time out on x86_64,
138-
# so we need to disable flang there.
139-
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_PROJECTS='clang;lld;lldb;clang-tools-extra;polly;mlir'"
140135
fi
141136
target_cmake_flags="$target_cmake_flags -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_ARCHS=$arches -DBOOTSTRAP_BOOTSTRAP_DARWIN_osx_BUILTIN_ARCHS=$arches"
142137
fi
143138
144-
build_flang="true"
145-
146139
if [ "$RUNNER_OS" = "Windows" ]; then
147140
# The build times out on Windows, so we need to disable LTO.
148141
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
149142
fi
150143
151144
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
152-
echo "build-flang=$build_flang" >> $GITHUB_OUTPUT
153145
case "${{ inputs.runs-on }}" in
154146
ubuntu-22.04*)
155147
build_runs_on="depot-${{ inputs.runs-on }}-16"

bolt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ $ perf2bolt -p perf.data -o perf.fdata <executable>
164164
This command will aggregate branch data from `perf.data` and store it in a
165165
format that is both more compact and more resilient to binary modifications.
166166

167-
If the profile was collected without brstacks, you will need to add `-nl` flag to
167+
If the profile was collected without brstacks, you will need to add `-ba` flag to
168168
the command line above.
169169

170170
### Step 3: Optimize with BOLT

bolt/docs/Heatmaps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ perf record -e cycles:u -j any,u [-p PID|-a] -- sleep <interval>
2121
```
2222

2323
Running with brstack (`-j any,u` or `-b`) is recommended. Heatmaps can be generated
24-
from basic events by using the llvm-bolt-heatmap option `-nl` (no brstack) but
24+
from basic events by using the llvm-bolt-heatmap option `-ba` (basic events) but
2525
such heatmaps do not have the coverage provided by brstack and may only be useful
2626
for finding event hotspots at larger code block granularities.
2727

0 commit comments

Comments
 (0)