Skip to content

Commit 1f565db

Browse files
authored
Merge branch 'main' into fix/163224
2 parents f0f5dfd + f2b5d04 commit 1f565db

File tree

603 files changed

+24823
-7961
lines changed

Some content is hidden

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

603 files changed

+24823
-7961
lines changed

.ci/metrics/metrics.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,13 @@ def github_get_metrics(
370370
started_at = job.started_at
371371
completed_at = job.completed_at
372372

373+
if completed_at is None:
374+
logging.info(
375+
f"Workflow {task.id} is marked completed but has a job without a "
376+
"completion timestamp."
377+
)
378+
continue
379+
373380
# GitHub API can return results where the started_at is slightly
374381
# later then the created_at (or completed earlier than started).
375382
# This would cause a -23h59mn delta, which will show up as +24h

.ci/premerge_advisor_explain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def get_comment(
3939
) -> dict[str, str]:
4040
repo = github.Github(github_token).get_repo("llvm/llvm-project")
4141
pr = repo.get_issue(pr_number).as_pull_request()
42+
body = COMMENT_TAG.format(platform=platform.system()) + "\n" + body
4243
comment = {"body": body}
4344
comment_id = get_comment_id(platform.system(), pr)
4445
if comment_id:
@@ -128,7 +129,7 @@ def main(
128129
),
129130
)
130131
]
131-
with open("comment", "w") as comment_file_handle:
132+
with open("comments", "w") as comment_file_handle:
132133
json.dump(comments, comment_file_handle)
133134
else:
134135
print(advisor_response.reason)

.github/workflows/libc-fullbuild-tests.yml

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,42 @@ jobs:
4848
cpp_compiler: clang++-22
4949
target: x86_64-unknown-uefi-llvm
5050
include_scudo: OFF
51+
- os: ubuntu-24.04
52+
build_type: MinSizeRel
53+
c_compiler: clang-22
54+
cpp_compiler: clang++-22
55+
target: armv6m-none-eabi
56+
include_scudo: OFF
57+
- os: ubuntu-24.04
58+
build_type: MinSizeRel
59+
c_compiler: clang-22
60+
cpp_compiler: clang++-22
61+
target: armv7m-none-eabi
62+
include_scudo: OFF
63+
- os: ubuntu-24.04
64+
build_type: MinSizeRel
65+
c_compiler: clang-22
66+
cpp_compiler: clang++-22
67+
target: armv7em-none-eabi
68+
include_scudo: OFF
69+
- os: ubuntu-24.04
70+
build_type: MinSizeRel
71+
c_compiler: clang-22
72+
cpp_compiler: clang++-22
73+
target: armv8m.main-none-eabi
74+
include_scudo: OFF
75+
- os: ubuntu-24.04
76+
build_type: MinSizeRel
77+
c_compiler: clang-22
78+
cpp_compiler: clang++-22
79+
target: armv8.1m.main-none-eabi
80+
include_scudo: OFF
81+
- os: ubuntu-24.04
82+
build_type: MinSizeRel
83+
c_compiler: clang-22
84+
cpp_compiler: clang++-22
85+
target: riscv32-unknown-elf
86+
include_scudo: OFF
5187
# TODO: add back gcc build when it is fixed
5288
# - c_compiler: gcc
5389
# cpp_compiler: g++
@@ -93,28 +129,39 @@ jobs:
93129
run: |
94130
export RUNTIMES="libc"
95131
132+
export CMAKE_FLAGS="
133+
-G Ninja
134+
-S ${{ github.workspace }}/runtimes
135+
-B ${{ steps.strings.outputs.build-output-dir }}
136+
-DCMAKE_ASM_COMPILER=${{ matrix.c_compiler }}
137+
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
138+
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
139+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
140+
-DCMAKE_C_COMPILER_LAUNCHER=sccache
141+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
142+
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}"
143+
96144
if [[ ${{ matrix.include_scudo}} == "ON" ]]; then
97145
export RUNTIMES="$RUNTIMES;compiler-rt"
98-
export CMAKE_FLAGS="
146+
export CMAKE_FLAGS="$CMAKE_FLAGS
99147
-DLLVM_LIBC_INCLUDE_SCUDO=ON
100148
-DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON
101149
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF
102150
-DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF"
103151
fi
104152
105-
cmake -B ${{ steps.strings.outputs.build-output-dir }} \
106-
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
107-
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
108-
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
109-
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
110-
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
111-
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
112-
-DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
113-
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
114-
-DLLVM_LIBC_FULL_BUILD=ON \
115-
-G Ninja \
116-
-S ${{ github.workspace }}/runtimes \
117-
$CMAKE_FLAGS
153+
case "${{ matrix.target }}" in
154+
*-none-eabi|riscv32-unknown-elf)
155+
cmake $CMAKE_FLAGS \
156+
-C ${{ github.workspace }}/libc/cmake/caches/${{ matrix.target }}.cmake
157+
;;
158+
*)
159+
cmake -DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
160+
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
161+
-DLLVM_LIBC_FULL_BUILD=ON \
162+
$CMAKE_FLAGS
163+
;;
164+
esac
118165
119166
- name: Build
120167
run: >
@@ -124,8 +171,12 @@ jobs:
124171
--target install
125172
126173
- name: Test
127-
# Skip UEFI tests until we have testing set up.
128-
if: ${{ ! endsWith(matrix.target, '-uefi-llvm') }}
174+
# Skip UEFI and baremetal tests until we have testing set up.
175+
if: ${{
176+
!endsWith(matrix.target, '-uefi-llvm') &&
177+
!endsWith(matrix.target, '-none-eabi') &&
178+
matrix.target != 'riscv32-unknown-elf'
179+
}}
129180
run: >
130181
cmake
131182
--build ${{ steps.strings.outputs.build-output-dir }}

.github/workflows/premerge.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ jobs:
119119
path: artifacts/
120120
retention-days: 5
121121
include-hidden-files: 'true'
122+
- name: Upload Comment
123+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
124+
if: ${{ always() && !startsWith(matrix.runs-on, 'depot-ubuntu-24.04-arm') }}
125+
continue-on-error: true
126+
with:
127+
name: workflow-args
128+
path: |
129+
comments
122130
123131
premerge-checks-windows:
124132
name: Build and Test Windows

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ autoconf/autom4te.cache
5454
/cmake-build*
5555
# Coding assistants' stuff
5656
/CLAUDE.md
57-
/.claude/
57+
.claude/
5858
/GEMINI.md
59-
/.gemini/
59+
.gemini/
6060

6161
#==============================================================================#
6262
# Directories to ignore (do not add trailing '/'s, they skip symlinks).

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ Bug Fixes to Attribute Support
502502
- Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905)
503503
- Fix handling of parameter indexes when an attribute is applied to a C++23 explicit object member function.
504504
- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110)
505+
- Fix ``cleanup`` attribute by delaying type checks until after the type is deduced. (#GH129631)
505506

506507
Bug Fixes to C++ Support
507508
^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/Attr.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,17 @@ class Attr {
741741
// our existing general parsing we need to have a separate flag that
742742
// opts an attribute into strict parsing of attribute parameters
743743
bit StrictEnumParameters = 0;
744+
// Set to true for attributes which have Sema checks which requires the type
745+
// to be deduced.
746+
// When `IsTypeDependent` is set to true, you should add an `ActOn*Attr`
747+
// function to `Sema.h`. The signature of the function must be:
748+
// `void ActOn*Attr(Decl *, const Attr *);` where the `Decl *` is the
749+
// declaration the attribute will be attached to; its type will have already
750+
// been deduced, and the `Attr *` is the attribute being applied to that
751+
// declaration. This function should handle all type-sensitive semantics for
752+
// the attribute. This function will be automatically called by
753+
// `Sema::CheckAttributesOnDeducedType()`.
754+
bit IsTypeDependent = 0;
744755
// Lists language options, one of which is required to be true for the
745756
// attribute to be applicable. If empty, no language options are required.
746757
list<LangOpt> LangOpts = [];
@@ -1400,6 +1411,7 @@ def Cleanup : InheritableAttr {
14001411
let Args = [DeclArgument<Function, "FunctionDecl">];
14011412
let Subjects = SubjectList<[LocalVar]>;
14021413
let Documentation = [CleanupDocs];
1414+
let IsTypeDependent = 1;
14031415
// FIXME: DeclArgument should be reworked to also store the
14041416
// Expr instead of adding attr specific hacks like the following.
14051417
// See the discussion in https://github.com/llvm/llvm-project/pull/14023.

clang/include/clang/Basic/BuiltinsNVPTX.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def __nvvm_f2bf16_rz : NVPTXBuiltinSMAndPTX<"__bf16(float)", SM_80, PTX70>;
615615
def __nvvm_f2bf16_rz_relu : NVPTXBuiltinSMAndPTX<"__bf16(float)", SM_80, PTX70>;
616616

617617
def __nvvm_f2tf32_rna : NVPTXBuiltinSMAndPTX<"int32_t(float)", SM_80, PTX70>;
618-
def __nvvm_f2tf32_rna_satfinite : NVPTXBuiltinSMAndPTX<"int32_t(float)", SM_89, PTX81>;
618+
def __nvvm_f2tf32_rna_satfinite : NVPTXBuiltinSMAndPTX<"int32_t(float)", SM_80, PTX81>;
619619
def __nvvm_f2tf32_rn : NVPTXBuiltinSMAndPTX<"int32_t(float)", SM_90, PTX78>;
620620
def __nvvm_f2tf32_rn_relu : NVPTXBuiltinSMAndPTX<"int32_t(float)", SM_90, PTX78>;
621621
def __nvvm_f2tf32_rn_satfinite : NVPTXBuiltinSMAndPTX<"int32_t(float)", SM_100, PTX86>;

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<128>] in {
9292
def cmpsd : X86Builtin<"_Vector<2, double>(_Vector<2, double>, _Vector<2, double>, _Constant char)">;
9393
}
9494

95-
96-
let Features = "sse3" in {
95+
let Features = "sse3",
96+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
9797
foreach Op = ["addsub"] in {
9898
def Op#ps : X86Builtin<"_Vector<4, float>(_Vector<4, float>, _Vector<4, float>)">;
9999
def Op#pd : X86Builtin<"_Vector<2, double>(_Vector<2, double>, _Vector<2, double>)">;
@@ -121,8 +121,9 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<128>] in {
121121
}
122122

123123
// AVX
124-
let Attributes = [Const, NoThrow, RequiredVectorWidth<256>], Features = "avx" in {
125-
foreach Op = ["addsub", "max", "min"] in {
124+
let Attributes = [Const, NoThrow, RequiredVectorWidth<256>],
125+
Features = "avx" in {
126+
foreach Op = ["max", "min"] in {
126127
def Op#pd256 : X86Builtin<"_Vector<4, double>(_Vector<4, double>, _Vector<4, double>)">;
127128
def Op#ps256 : X86Builtin<"_Vector<8, float>(_Vector<8, float>, _Vector<8, float>)">;
128129
}
@@ -571,6 +572,15 @@ let Features = "avx",
571572
def movmskps256 : X86Builtin<"int(_Vector<8, float>)">;
572573
}
573574

575+
let Features = "avx",
576+
Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<256>] in {
577+
def addsubpd256
578+
: X86Builtin<
579+
"_Vector<4, double>(_Vector<4, double>, _Vector<4, double>)">;
580+
def addsubps256
581+
: X86Builtin<"_Vector<8, float>(_Vector<8, float>, _Vector<8, float>)">;
582+
}
583+
574584
let Features = "avx", Attributes = [NoThrow] in {
575585
def vzeroall : X86Builtin<"void()">;
576586
def vzeroupper : X86Builtin<"void()">;
@@ -4107,15 +4117,15 @@ let Features = "avx512f", Attributes = [NoThrow, Const, Constexpr, RequiredVecto
41074117
def selectpd_512 : X86Builtin<"_Vector<8, double>(unsigned char, _Vector<8, double>, _Vector<8, double>)">;
41084118
}
41094119

4110-
let Features = "avx512fp16", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
4120+
let Features = "avx512fp16", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
41114121
def selectsh_128 : X86Builtin<"_Vector<8, _Float16>(unsigned char, _Vector<8, _Float16>, _Vector<8, _Float16>)">;
41124122
}
41134123

4114-
let Features = "avx512bf16", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
4124+
let Features = "avx512bf16", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
41154125
def selectsbf_128 : X86Builtin<"_Vector<8, __bf16>(unsigned char, _Vector<8, __bf16>, _Vector<8, __bf16>)">;
41164126
}
41174127

4118-
let Features = "avx512f", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {
4128+
let Features = "avx512f", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
41194129
def selectss_128 : X86Builtin<"_Vector<4, float>(unsigned char, _Vector<4, float>, _Vector<4, float>)">;
41204130
def selectsd_128 : X86Builtin<"_Vector<2, double>(unsigned char, _Vector<2, double>, _Vector<2, double>)">;
41214131
}

clang/include/clang/Basic/DiagnosticDriverKinds.td

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,23 @@ def err_drv_bad_offload_arch_combo : Error<
126126
"invalid offload arch combinations: '%0' and '%1' (for a specific processor, "
127127
"a feature should either exist in all offload archs, or not exist in any "
128128
"offload archs)">;
129+
def err_drv_unsupported_option_for_offload_arch_req_feature : Error<
130+
"'%0' option for offload arch '%1' is not currently supported "
131+
"there. Use it with an offload arch containing '%2' instead">;
129132
def warn_drv_unsupported_option_for_offload_arch_req_feature : Warning<
130133
"ignoring '%0' option for offload arch '%1' as it is not currently supported "
131134
"there. Use it with an offload arch containing '%2' instead">,
132135
InGroup<OptionIgnored>;
133136
def warn_drv_unsupported_option_for_target : Warning<
134137
"ignoring '%0' option as it is not currently supported for target '%1'">,
135138
InGroup<OptionIgnored>;
139+
def err_drv_unsupported_option_for_target : Error<
140+
"'%0' option is not currently supported for target '%1'">;
141+
def warn_drv_unsupported_option_part_for_target : Warning<
142+
"ignoring '%0' in '%1' option as it is not currently supported for target '%2'">,
143+
InGroup<OptionIgnored>;
144+
def err_drv_unsupported_option_part_for_target : Error<
145+
"'%0' in '%1' option is not currently supported for target '%2'">;
136146
def warn_drv_invalid_argument_for_flang : Warning<
137147
"'%0' is not valid for Fortran">,
138148
InGroup<OptionIgnored>;

0 commit comments

Comments
 (0)