Skip to content

Commit 015ad15

Browse files
committed
Merge branch 'main' into amd-trunk-dev
2 parents f4e77e6 + 9ea34be commit 015ad15

File tree

497 files changed

+10094
-5299
lines changed

Some content is hidden

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

497 files changed

+10094
-5299
lines changed

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

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: Build CI Container
32

43
permissions:
@@ -19,9 +18,41 @@ on:
1918
- '.github/workflows/containers/github-action-ci/**'
2019

2120
jobs:
22-
build-ci-container:
21+
# TODO(boomanaiden154): Switch this back to a single stage build when we can
22+
# run this on the self-hosted runners and don't have to do it this way to
23+
# avoid timeouts.
24+
build-ci-container-stage1:
2325
if: github.repository_owner == 'llvm'
2426
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout LLVM
29+
uses: actions/checkout@v4
30+
with:
31+
sparse-checkout: .github/workflows/containers/github-action-ci/
32+
- name: Change podman Root Direcotry
33+
run: |
34+
mkdir -p ~/.config/containers
35+
sudo mkdir -p /mnt/podman
36+
sudo chown `whoami`:`whoami` /mnt/podman
37+
cp ./.github/workflows/containers/github-action-ci/storage.conf ~/.config/containers/storage.conf
38+
podman info
39+
- name: Build container stage1
40+
working-directory: ./.github/workflows/containers/github-action-ci/
41+
run: |
42+
podman build -t stage1-toolchain --target stage1-toolchain -f stage1.Dockerfile .
43+
- name: Save container image
44+
run: |
45+
podman save stage1-toolchain > stage1-toolchain.tar
46+
- name: Upload container image
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: stage1-toolchain
50+
path: stage1-toolchain.tar
51+
retention-days: 1
52+
build-ci-container-stage2:
53+
if: github.repository_owner == 'llvm'
54+
runs-on: ubuntu-latest
55+
needs: build-ci-container-stage1
2556
permissions:
2657
packages: write
2758
steps:
@@ -38,10 +69,27 @@ jobs:
3869
with:
3970
sparse-checkout: .github/workflows/containers/github-action-ci/
4071

72+
- name: Change podman Root Direcotry
73+
run: |
74+
mkdir -p ~/.config/containers
75+
sudo mkdir -p /mnt/podman
76+
sudo chown `whoami`:`whoami` /mnt/podman
77+
cp ./.github/workflows/containers/github-action-ci/storage.conf ~/.config/containers/storage.conf
78+
podman info
79+
80+
- name: Download stage1-toolchain
81+
uses: actions/download-artifact@v4
82+
with:
83+
name: stage1-toolchain
84+
85+
- name: Load stage1-toolchain
86+
run: |
87+
podman load -i stage1-toolchain.tar
88+
4189
- name: Build Container
4290
working-directory: ./.github/workflows/containers/github-action-ci/
4391
run: |
44-
podman build -t ${{ steps.vars.outputs.container-name-tag }} .
92+
podman build -t ${{ steps.vars.outputs.container-name-tag }} -f stage2.Dockerfile .
4593
podman tag ${{ steps.vars.outputs.container-name-tag }} ${{ steps.vars.outputs.container-name }}:latest
4694
4795
- name: Test Container

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

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/clang/cmake/caches/BOLT-PGO.cmake b/clang/cmake/caches/BOLT-PGO.cmake
2+
index 1a04ca9a74e5..d092820e4115 100644
3+
--- a/clang/cmake/caches/BOLT-PGO.cmake
4+
+++ b/clang/cmake/caches/BOLT-PGO.cmake
5+
@@ -4,6 +4,8 @@ set(CLANG_BOOTSTRAP_TARGETS
6+
stage2-clang-bolt
7+
stage2-distribution
8+
stage2-install-distribution
9+
+ clang
10+
+ lld
11+
CACHE STRING "")
12+
set(BOOTSTRAP_CLANG_BOOTSTRAP_TARGETS
13+
clang-bolt
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM docker.io/library/ubuntu:22.04 as base
2+
ENV LLVM_SYSROOT=/opt/llvm
3+
4+
FROM base as stage1-toolchain
5+
ENV LLVM_VERSION=17.0.6
6+
7+
RUN apt-get update && \
8+
apt-get install -y \
9+
wget \
10+
gcc \
11+
g++ \
12+
cmake \
13+
ninja-build \
14+
python3 \
15+
git \
16+
curl
17+
18+
RUN curl -O -L https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-$LLVM_VERSION.tar.gz && tar -xf llvmorg-$LLVM_VERSION.tar.gz
19+
20+
WORKDIR /llvm-project-llvmorg-$LLVM_VERSION
21+
22+
COPY bootstrap.patch /
23+
24+
# TODO(boomanaiden154): Remove the patch pulled from a LLVM PR once we bump
25+
# the toolchain to version 18 and the patch is in-tree.
26+
# TODO(boomanaiden154): Remove the bootstrap patch once we unsplit the build
27+
# and no longer need to explicitly build the stage2 dependencies.
28+
RUN curl https://github.com/llvm/llvm-project/commit/dd0356d741aefa25ece973d6cc4b55dcb73b84b4.patch | patch -p1 && cat /bootstrap.patch | patch -p1
29+
30+
RUN mkdir build
31+
32+
RUN cmake -B ./build -G Ninja ./llvm \
33+
-C ./clang/cmake/caches/BOLT-PGO.cmake \
34+
-DBOOTSTRAP_LLVM_ENABLE_LLD=ON \
35+
-DBOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_LLD=ON \
36+
-DPGO_INSTRUMENT_LTO=Thin \
37+
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
38+
-DCMAKE_INSTALL_PREFIX="$LLVM_SYSROOT" \
39+
-DLLVM_ENABLE_PROJECTS="bolt;clang;lld;clang-tools-extra" \
40+
-DLLVM_DISTRIBUTION_COMPONENTS="lld;compiler-rt;clang-format" \
41+
-DCLANG_DEFAULT_LINKER="lld" \
42+
-DBOOTSTRAP_CLANG_PGO_TRAINING_DATA_SOURCE_DIR=/llvm-project-llvmorg-$LLVM_VERSION/llvm
43+
44+
RUN ninja -C ./build stage2-instrumented-clang stage2-instrumented-lld
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM docker.io/library/ubuntu:22.04 as base
2+
ENV LLVM_SYSROOT=/opt/llvm
3+
4+
FROM stage1-toolchain AS stage2-toolchain
5+
6+
RUN ninja -C ./build stage2-clang-bolt stage2-install-distribution && ninja -C ./build install-distribution && rm -rf ./build
7+
8+
FROM base
9+
10+
COPY --from=stage2-toolchain $LLVM_SYSROOT $LLVM_SYSROOT
11+
12+
# Need to install curl for hendrikmuhs/ccache-action
13+
# Need nodejs for some of the GitHub actions.
14+
# Need perl-modules for clang analyzer tests.
15+
RUN apt-get update && \
16+
apt-get install -y \
17+
binutils \
18+
cmake \
19+
curl \
20+
libstdc++-11-dev \
21+
ninja-build \
22+
nodejs \
23+
perl-modules \
24+
python3-psutil
25+
26+
ENV LLVM_SYSROOT=$LLVM_SYSROOT
27+
ENV PATH=${LLVM_SYSROOT}/bin:${PATH}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[storage]
2+
driver = "overlay"
3+
runroot = "/mnt/podman/container"
4+
graphroot = "/mnt/podman/image"

.github/workflows/libclc-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ jobs:
3636
name: Test libclc
3737
uses: ./.github/workflows/llvm-project-tests.yml
3838
with:
39-
build_target: ''
4039
projects: clang;libclc

.github/workflows/lldb-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,4 @@ jobs:
3636
name: Build lldb
3737
uses: ./.github/workflows/llvm-project-tests.yml
3838
with:
39-
build_target: ''
4039
projects: clang;lldb

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ on:
2222
workflow_call:
2323
inputs:
2424
build_target:
25-
required: true
25+
required: false
2626
type: string
27+
default: "all"
2728

2829
projects:
2930
required: true

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4142,6 +4142,25 @@ the configuration (without a prefix: ``Auto``).
41424142
A(z); -> z;
41434143
A(a, b); // will not be expanded.
41444144

4145+
.. _MainIncludeChar:
4146+
4147+
**MainIncludeChar** (``MainIncludeCharDiscriminator``) :versionbadge:`clang-format 18` :ref:`<MainIncludeChar>`
4148+
When guessing whether a #include is the "main" include, only the include
4149+
directives that use the specified character are considered.
4150+
4151+
Possible values:
4152+
4153+
* ``MICD_Quote`` (in configuration: ``Quote``)
4154+
Main include uses quotes: ``#include "foo.hpp"`` (the default).
4155+
4156+
* ``MICD_AngleBracket`` (in configuration: ``AngleBracket``)
4157+
Main include uses angle brackets: ``#include <foo.hpp>``.
4158+
4159+
* ``MICD_Any`` (in configuration: ``Any``)
4160+
Main include uses either quotes or angle brackets.
4161+
4162+
4163+
41454164
.. _MaxEmptyLinesToKeep:
41464165

41474166
**MaxEmptyLinesToKeep** (``Unsigned``) :versionbadge:`clang-format 3.7` :ref:`<MaxEmptyLinesToKeep>`

clang/docs/ReleaseNotes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ Bug Fixes in This Version
164164
- Clang now accepts qualified partial/explicit specializations of variable templates that
165165
are not nominable in the lookup context of the specialization.
166166

167+
- Clang now doesn't produce false-positive warning `-Wconstant-logical-operand`
168+
for logical operators in C23.
169+
Fixes (`#64356 <https://github.com/llvm/llvm-project/issues/64356>`_).
170+
167171
Bug Fixes to Compiler Builtins
168172
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169173

@@ -197,6 +201,9 @@ Bug Fixes to C++ Support
197201
Fixes (`#67976 <https://github.com/llvm/llvm-project/issues/67976>`_)
198202
- Fix crash and diagnostic with const qualified member operator new.
199203
Fixes (`#79748 <https://github.com/llvm/llvm-project/issues/79748>`_)
204+
- Fixed a crash where substituting into a requires-expression that involves parameter packs
205+
during the equivalence determination of two constraint expressions.
206+
(`#72557 <https://github.com/llvm/llvm-project/issues/72557>`_)
200207
- Fix a crash when specializing an out-of-line member function with a default
201208
parameter where we did an incorrect specialization of the initialization of
202209
the default parameter.

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ BUILTIN(__builtin_amdgcn_s_dcache_inv, "v", "n")
6969
BUILTIN(__builtin_amdgcn_buffer_wbinvl1, "v", "n")
7070
BUILTIN(__builtin_amdgcn_fence, "vUicC*", "n")
7171
BUILTIN(__builtin_amdgcn_groupstaticsize, "Ui", "n")
72+
BUILTIN(__builtin_amdgcn_wavefrontsize, "Ui", "nc")
7273

7374
BUILTIN(__builtin_amdgcn_atomic_inc32, "UZiUZiD*UZiUicC*", "n")
7475
BUILTIN(__builtin_amdgcn_atomic_inc64, "UWiUWiD*UWiUicC*", "n")

clang/include/clang/Basic/DiagnosticCommonKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def warn_pragma_debug_unexpected_argument : Warning<
7373
def warn_fp_nan_inf_when_disabled : Warning<
7474
"use of %select{infinity|NaN}0%select{| via a macro}1 is undefined behavior "
7575
"due to the currently enabled floating-point options">,
76-
InGroup<DiagGroup<"nan-infinity-disabled">>;
76+
InGroup<DiagGroup<"nan-infinity-disabled", [], NanInfDisabledDocs>>;
7777
}
7878

7979
// Parse && Sema

clang/include/clang/Basic/DiagnosticDocs.td

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,12 @@ program by treating all string literals as having type ``const char *``
8787
instead of ``char *``. This can cause unexpected behaviors with type-sensitive
8888
constructs like ``_Generic``.
8989
}];
90+
91+
defvar NanInfDisabledDocs = [{
92+
This warning is enabled when source code using the macros ``INFINITY`` or ``NAN``
93+
is compiled with floating-point options preventing these two values. This can
94+
lead to undefined behavior. Check the order of command line arguments that modify
95+
this behavior, such as ``-ffast-math``, ``-fhonor-infinities``, and
96+
``-fhonor-nans`` (etc), as well as ``#pragma`` directives if this diagnostic is
97+
generated unexpectedly.
98+
}];

clang/include/clang/Basic/arm_neon.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,9 +1354,9 @@ let isScalarNarrowShift = 1 in {
13541354
// Signed/Unsigned Saturating Rounded Shift Right Narrow (Immediate)
13551355
def SCALAR_SQRSHRN_N: SInst<"vqrshrn_n", "(1<)1I", "SsSiSlSUsSUiSUl">;
13561356
// Signed Saturating Shift Right Unsigned Narrow (Immediate)
1357-
def SCALAR_SQSHRUN_N: SInst<"vqshrun_n", "(1<)1I", "SsSiSl">;
1357+
def SCALAR_SQSHRUN_N: SInst<"vqshrun_n", "(1<U)1I", "SsSiSl">;
13581358
// Signed Saturating Rounded Shift Right Unsigned Narrow (Immediate)
1359-
def SCALAR_SQRSHRUN_N: SInst<"vqrshrun_n", "(1<)1I", "SsSiSl">;
1359+
def SCALAR_SQRSHRUN_N: SInst<"vqrshrun_n", "(1<U)1I", "SsSiSl">;
13601360
}
13611361

13621362
////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)