Skip to content

Commit 7f6cd80

Browse files
committed
Merge branch 'main' into flang_builtin-mods
2 parents 19c6970 + 5327c6b commit 7f6cd80

File tree

586 files changed

+13665
-7210
lines changed

Some content is hidden

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

586 files changed

+13665
-7210
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/Maintainers.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ Clang static analyzer
147147
148148
| Balázs Benics
149149
| benicsbalazs\@gmail.com (email), steakhal (Phabricator), steakhal (GitHub)
150-
| balazs.benics\@sonarsource.com (email), balazs-benics-sonarsource (GitHub)
151150
152151
Compiler options
153152
~~~~~~~~~~~~~~~~

clang/docs/analyzer/checkers.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ as error. Specifically on x86/x86-64 target if the pointer address space is
198198
dereference is not defined as error. See `X86/X86-64 Language Extensions
199199
<https://clang.llvm.org/docs/LanguageExtensions.html#memory-references-to-specified-segments>`__
200200
for reference.
201-
201+
202202
If the analyzer option ``suppress-dereferences-from-any-address-space`` is set
203203
to true (the default value), then this checker never reports dereference of
204204
pointers with a specified address space. If the option is set to false, then
@@ -1664,6 +1664,23 @@ Warn on uses of the 'bzero' function.
16641664
bzero(ptr, n); // warn
16651665
}
16661666
1667+
.. _security-insecureAPI-decodeValueOfObjCType:
1668+
1669+
security.insecureAPI.decodeValueOfObjCType (C)
1670+
""""""""""""""""""""""""""""""""""""""""""""""
1671+
Warn on uses of the Objective-C method ``-decodeValueOfObjCType:at:``.
1672+
1673+
.. code-block:: objc
1674+
1675+
void test(NSCoder *decoder) {
1676+
unsigned int x;
1677+
[decoder decodeValueOfObjCType:"I" at:&x]; // warn
1678+
}
1679+
1680+
This diagnostic is emitted only on Apple platforms where the safer
1681+
``-decodeValueOfObjCType:at:size:`` alternative is available
1682+
(iOS 11+, macOS 10.13+, tvOS 11+, watchOS 4.0+).
1683+
16671684
.. _security-insecureAPI-getpw:
16681685
16691686
security.insecureAPI.getpw (C)

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: 14 additions & 4 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()">;

clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
131131
return cir::IntType::get(getContext(), n, false);
132132
}
133133

134+
static unsigned getCIRIntOrFloatBitWidth(mlir::Type eltTy) {
135+
if (auto intType = mlir::dyn_cast<cir::IntTypeInterface>(eltTy))
136+
return intType.getWidth();
137+
if (auto floatType = mlir::dyn_cast<cir::FPTypeInterface>(eltTy))
138+
return floatType.getWidth();
139+
140+
llvm_unreachable("Unsupported type in getCIRIntOrFloatBitWidth");
141+
}
134142
cir::IntType getSIntNTy(int n) {
135143
return cir::IntType::get(getContext(), n, true);
136144
}
@@ -565,6 +573,16 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
565573
return cir::CmpOp::create(*this, loc, getBoolTy(), kind, lhs, rhs);
566574
}
567575

576+
cir::VecCmpOp createVecCompare(mlir::Location loc, cir::CmpOpKind kind,
577+
mlir::Value lhs, mlir::Value rhs) {
578+
VectorType vecCast = mlir::cast<VectorType>(lhs.getType());
579+
IntType integralTy =
580+
getSIntNTy(getCIRIntOrFloatBitWidth(vecCast.getElementType()));
581+
VectorType integralVecTy =
582+
VectorType::get(context, integralTy, vecCast.getSize());
583+
return cir::VecCmpOp::create(*this, loc, integralVecTy, kind, lhs, rhs);
584+
}
585+
568586
mlir::Value createIsNaN(mlir::Location loc, mlir::Value operand) {
569587
return createCompare(loc, cir::CmpOpKind::ne, operand, operand);
570588
}

0 commit comments

Comments
 (0)