[llvm-branch-commits] [flang] [flang][OpenMP] Make OpenMPCriticalConstruct follow block structure (PR #152007)
https://github.com/Stylie777 approved this pull request. LGTM other than one nit comment. https://github.com/llvm/llvm-project/pull/152007 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [DTLTO][Clang][Docs] Update for COFF support (#149988) (PR #151670)
https://github.com/tru approved this pull request. https://github.com/llvm/llvm-project/pull/151670 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [CMake][Release] Build with -ffat-lto-objects (#140381) (PR #151245)
tru wrote: How do we want to handle this? Some of the errors looks just like it could be fixed with a rebuild? https://github.com/llvm/llvm-project/pull/151245 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [LifetimeSafety] Add language option for experimental lifetime safety… (PR #152027)
https://github.com/tru approved this pull request. https://github.com/llvm/llvm-project/pull/152027 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/21.x: [AArch64] Keep floating-point conversion in SIMD (#147707) (PR #151317)
tru wrote: Will not backport. https://github.com/llvm/llvm-project/pull/151317 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/21.x: [Hexagon] Add nounwind to hexagon-strcpy.ll (#151293) (PR #151458)
tru wrote: ping @androm3da https://github.com/llvm/llvm-project/pull/151458 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/21.x: [libc++] Add checks for misused hardening macros (#150669) (PR #151582)
tru wrote: Who can review? btw what's up with the buildkite ci never ending? https://github.com/llvm/llvm-project/pull/151582 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] [llvm] Backport Wasm Debugging changes to the LLVM 21.x Release (PR #151559)
tru wrote: Let's not take these now. It doesn't seem like it's that high priority. Re-open if you think it's wrong. https://github.com/llvm/llvm-project/pull/151559 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lldb] [llvm] Backport Wasm Debugging changes to the LLVM 21.x Release (PR #151559)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151559 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/21.x: [AIX] Handle arbitrary sized integers when lowering formal arguments passed on the stack (#149351) (PR #151734)
tru wrote: Still needs a review. https://github.com/llvm/llvm-project/pull/151734 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] release/21.x: [Flang] Fix crash with parametrized derived types usage (#150289) (PR #151937)
tru wrote: Needs to be reviewed. https://github.com/llvm/llvm-project/pull/151937 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (#151077) (PR #151092)
tru wrote: > Does it sound ok for you? Yes. I have merged this now, so you are good to go to create the release note. https://github.com/llvm/llvm-project/pull/151092 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/21.x: [TailDup] Delay aggressive computed-goto taildup to after RegAlloc. (#150911) (PR #151680)
fhahn wrote: > I expect a double-check for #106846 before the merge. Sorry I'm too busy to > do this. Sounds good! My understanding from @mikulas-patocka response in https://github.com/llvm/llvm-project/issues/106846 is that there is that the current patch didn't regress their use case. For the reproducer shared there I am also not seeing any regression on X86 skylake (the only X86 system I have access to) https://github.com/llvm/llvm-project/pull/151680 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/21.x: [AArch64] Keep floating-point conversion in SIMD (#147707) (PR #151317)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151317 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] b38f357 - [Flang][OpenMP][Docs] Update target-related support in Flang docs, NFC (#150443)
Author: Sergio Afonso Date: 2025-08-05T10:47:24+02:00 New Revision: b38f35757b70b98fe62b54c04c9c606b9893875d URL: https://github.com/llvm/llvm-project/commit/b38f35757b70b98fe62b54c04c9c606b9893875d DIFF: https://github.com/llvm/llvm-project/commit/b38f35757b70b98fe62b54c04c9c606b9893875d.diff LOG: [Flang][OpenMP][Docs] Update target-related support in Flang docs, NFC (#150443) Update docs to state that reduction is supported on OpenMP `loop` and `teams` standalone and compound constructs. (cherry picked from commit 15980624ac516ae2dbbf1f2cd24d63de0f9fd2be) Added: Modified: flang/docs/OpenMPSupport.md Removed: diff --git a/flang/docs/OpenMPSupport.md b/flang/docs/OpenMPSupport.md index c9f19c37fd7fa..81f5f9f6dee5b 100644 --- a/flang/docs/OpenMPSupport.md +++ b/flang/docs/OpenMPSupport.md @@ -41,7 +41,7 @@ Note : No distinction is made between the support in Parser/Semantics, MLIR, Low | target construct | P | device clause not supported | | target update construct| P | device clause not supported | | declare target directive | P | | -| teams construct| P | reduction clause not supported | +| teams construct| Y | | | distribute construct | P | dist_schedule clause not supported | | distribute simd construct | P | dist_schedule and linear clauses are not supported | | distribute parallel loop construct | P | dist_schedule clause not supported | @@ -51,15 +51,15 @@ Note : No distinction is made between the support in Parser/Semantics, MLIR, Low | atomic construct extensions| Y | | | cancel construct | Y | | | cancellation point construct | Y | | -| parallel do simd construct | P | linear clause is not supported | -| target teams construct | P | device and reduction clauses are not supported | -| teams distribute construct | P | reduction and dist_schedule clauses not supported | -| teams distribute simd construct| P | reduction, dist_schedule and linear clauses are not supported | -| target teams distribute construct | P | device, reduction and dist_schedule clauses are not supported | -| teams distribute parallel loop construct | P | reduction and dist_schedule clauses are not supported | -| target teams distribute parallel loop construct| P | device, reduction and dist_schedule clauses are not supported | -| teams distribute parallel loop simd construct | P | reduction, dist_schedule, and linear clauses are not supported | -| target teams distribute parallel loop simd construct | P | device, reduction, dist_schedule and linear clauses are not supported | +| parallel do simd construct | P | linear clause not supported | +| target teams construct | P | device clause not supported | +| teams distribute construct | P | dist_schedule clause not supported | +| teams distribute simd construct| P | dist_schedule and linear clauses are not supported | +| target teams distribute construct | P | device and dist_schedule clauses are not supported | +| teams distribute parallel loop construct | P | dist_schedule clause not supported | +| target teams distribute parallel loop construct| P | device and dist_schedule clauses are not supported | +| teams distribute parallel loop simd construct | P | dist_schedule and linear clauses are not supported | +| target teams distribute parallel loop simd construct | P | device, dist_schedule and linear clauses are not supported | ## Extensions ### ATOMIC construct ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] release/21.x: [Flang][OpenMP][Docs] Update target-related support in Flang docs, NFC (#150443) (PR #151493)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151493 >From b38f35757b70b98fe62b54c04c9c606b9893875d Mon Sep 17 00:00:00 2001 From: Sergio Afonso Date: Tue, 29 Jul 2025 16:50:39 +0100 Subject: [PATCH] [Flang][OpenMP][Docs] Update target-related support in Flang docs, NFC (#150443) Update docs to state that reduction is supported on OpenMP `loop` and `teams` standalone and compound constructs. (cherry picked from commit 15980624ac516ae2dbbf1f2cd24d63de0f9fd2be) --- flang/docs/OpenMPSupport.md | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/flang/docs/OpenMPSupport.md b/flang/docs/OpenMPSupport.md index c9f19c37fd7fa..81f5f9f6dee5b 100644 --- a/flang/docs/OpenMPSupport.md +++ b/flang/docs/OpenMPSupport.md @@ -41,7 +41,7 @@ Note : No distinction is made between the support in Parser/Semantics, MLIR, Low | target construct | P | device clause not supported | | target update construct| P | device clause not supported | | declare target directive | P | | -| teams construct| P | reduction clause not supported | +| teams construct| Y | | | distribute construct | P | dist_schedule clause not supported | | distribute simd construct | P | dist_schedule and linear clauses are not supported | | distribute parallel loop construct | P | dist_schedule clause not supported | @@ -51,15 +51,15 @@ Note : No distinction is made between the support in Parser/Semantics, MLIR, Low | atomic construct extensions| Y | | | cancel construct | Y | | | cancellation point construct | Y | | -| parallel do simd construct | P | linear clause is not supported | -| target teams construct | P | device and reduction clauses are not supported | -| teams distribute construct | P | reduction and dist_schedule clauses not supported | -| teams distribute simd construct| P | reduction, dist_schedule and linear clauses are not supported | -| target teams distribute construct | P | device, reduction and dist_schedule clauses are not supported | -| teams distribute parallel loop construct | P | reduction and dist_schedule clauses are not supported | -| target teams distribute parallel loop construct| P | device, reduction and dist_schedule clauses are not supported | -| teams distribute parallel loop simd construct | P | reduction, dist_schedule, and linear clauses are not supported | -| target teams distribute parallel loop simd construct | P | device, reduction, dist_schedule and linear clauses are not supported | +| parallel do simd construct | P | linear clause not supported | +| target teams construct | P | device clause not supported | +| teams distribute construct | P | dist_schedule clause not supported | +| teams distribute simd construct| P | dist_schedule and linear clauses are not supported | +| target teams distribute construct | P | device and dist_schedule clauses are not supported | +| teams distribute parallel loop construct | P | dist_schedule clause not supported | +| target teams distribute parallel loop construct| P | device and dist_schedule clauses are not supported | +| teams distribute parallel loop simd construct | P | dist_schedule and linear clauses are not supported | +| target teams distribute parallel loop simd construct | P | device, dist_schedule and linear clauses are not supported | ## Extensions ### ATOMIC construct ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] release/21.x: [Flang][OpenMP][Docs] Update target-related support in Flang docs, NFC (#150443) (PR #151493)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151493 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (#151077) (PR #151092)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151092
>From 78ce57ca69db9f20ae631a6b1e1227aef3c45a59 Mon Sep 17 00:00:00 2001
From: Phoebe Wang
Date: Tue, 29 Jul 2025 14:52:14 +0800
Subject: [PATCH] [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order
(#151077)
For maskz intrinsics, the first argument is always the mask.
(cherry picked from commit 3ea3e334cc19cdd34416b546ac4b4a24b2018a28)
---
clang/lib/Headers/avx10_2_512niintrin.h | 12 ++---
clang/lib/Headers/avx10_2niintrin.h | 24 +-
.../test/CodeGen/X86/avx10_2_512ni-builtins.c | 24 +-
clang/test/CodeGen/X86/avx10_2ni-builtins.c | 48 +--
4 files changed, 54 insertions(+), 54 deletions(-)
diff --git a/clang/lib/Headers/avx10_2_512niintrin.h
b/clang/lib/Headers/avx10_2_512niintrin.h
index 7e614f7740bff..9d96e36c74ca4 100644
--- a/clang/lib/Headers/avx10_2_512niintrin.h
+++ b/clang/lib/Headers/avx10_2_512niintrin.h
@@ -197,7 +197,7 @@ _mm512_mask_dpwsud_epi32(__m512i __A, __mmask16 __U,
__m512i __B, __m512i __C) {
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsud_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwsud_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -218,7 +218,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_dpwsuds_epi32(
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsuds_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwsuds_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -239,7 +239,7 @@ _mm512_mask_dpwusd_epi32(__m512i __A, __mmask16 __U,
__m512i __B, __m512i __C) {
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusd_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwusd_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -260,7 +260,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_dpwusds_epi32(
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusds_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwusds_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -281,7 +281,7 @@ _mm512_mask_dpwuud_epi32(__m512i __A, __mmask16 __U,
__m512i __B, __m512i __C) {
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuud_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwuud_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -302,7 +302,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_dpwuuds_epi32(
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuuds_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwuuds_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
diff --git a/clang/lib/Headers/avx10_2niintrin.h
b/clang/lib/Headers/avx10_2niintrin.h
index 992be18f7720a..d5a66cfef536c 100644
--- a/clang/lib/Headers/avx10_2niintrin.h
+++ b/clang/lib/Headers/avx10_2niintrin.h
@@ -253,7 +253,7 @@ _mm_mask_dpwsud_epi32(__m128i __A, __mmask8 __U, __m128i
__B, __m128i __C) {
}
static __inline__ __m128i __DEFAULT_FN_ATTRS128
-_mm_maskz_dpwsud_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {
+_mm_maskz_dpwsud_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) {
return (__m128i)__builtin_ia32_selectd_128(
(__mmask8)__U, (__v4si)_mm_dpwsud_epi32(__A, __B, __C),
(__v4si)_mm_setzero_si128());
@@ -266,7 +266,7 @@ _mm256_mask_dpwsud_epi32(__m256i __A, __mmask8 __U, __m256i
__B, __m256i __C) {
}
static __inline__ __m256i __DEFAULT_FN_ATTRS256
-_mm256_maskz_dpwsud_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
{
+_mm256_maskz_dpwsud_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
{
return (__m256i)__builtin_ia32_selectd_256(
(__mmask8)__U, (__v8si)_mm256_dpwsud_epi32(__A, __B, __C),
(__v8si)_mm256_setzero_si256());
@@ -279,7 +279,7 @@ _mm_mask_dpwsuds_epi32(__m128i __A, __mmask8 __U, __m128i
__B, __m128i __C) {
}
static __inline__ __m128i __DEFAULT_FN_ATTRS12
[llvm-branch-commits] [compiler-rt] 8d38ccb - Remove reference to obsolete termio ioctls
Author: Andreas Schwab
Date: 2025-08-05T10:54:10+02:00
New Revision: 8d38ccbb5a43f8fef6763e930f979fa4d54889dd
URL:
https://github.com/llvm/llvm-project/commit/8d38ccbb5a43f8fef6763e930f979fa4d54889dd
DIFF:
https://github.com/llvm/llvm-project/commit/8d38ccbb5a43f8fef6763e930f979fa4d54889dd.diff
LOG: Remove reference to obsolete termio ioctls
The termio ioctls are no longer used after commit 59978b21ad9c
("[sanitizer_common] Remove interceptors for deprecated struct termio
(#137403)"), remove them. Fixes this build error:
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:765:27:
error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
765 | unsigned IOCTL_TCGETA = TCGETA;
| ^~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:769:27:
error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
769 | unsigned IOCTL_TCSETA = TCSETA;
| ^~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:770:28:
error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
770 | unsigned IOCTL_TCSETAF = TCSETAF;
|^~~
../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:771:28:
error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
771 | unsigned IOCTL_TCSETAW = TCSETAW;
|^~~
Part-of: https://github.com/llvm/llvm-project/pull/138822
Closes: https://github.com/llvm/llvm-project/pull/138822
(cherry picked from commit c99b1bcd505064f2e086e6b1034ce0b0c91ea5b9)
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
Removed:
diff --git
a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index ef4b8a85d6634..ea8cc306268cb 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -779,15 +779,11 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER;
#endif // SOUND_VERSION
unsigned IOCTL_TCFLSH = TCFLSH;
- unsigned IOCTL_TCGETA = TCGETA;
#if SANITIZER_TERMIOS_IOCTL_CONSTANTS
unsigned IOCTL_TCGETS = TCGETS;
#endif
unsigned IOCTL_TCSBRK = TCSBRK;
unsigned IOCTL_TCSBRKP = TCSBRKP;
- unsigned IOCTL_TCSETA = TCSETA;
- unsigned IOCTL_TCSETAF = TCSETAF;
- unsigned IOCTL_TCSETAW = TCSETAW;
#if SANITIZER_TERMIOS_IOCTL_CONSTANTS
unsigned IOCTL_TCSETS = TCSETS;
unsigned IOCTL_TCSETSF = TCSETSF;
diff --git
a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index d3aec40b525e6..f118d53f0df80 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -1314,12 +1314,8 @@ extern unsigned IOCTL_SNDCTL_COPR_SENDMSG;
extern unsigned IOCTL_SNDCTL_COPR_WCODE;
extern unsigned IOCTL_SNDCTL_COPR_WDATA;
extern unsigned IOCTL_TCFLSH;
-extern unsigned IOCTL_TCGETA;
extern unsigned IOCTL_TCSBRK;
extern unsigned IOCTL_TCSBRKP;
-extern unsigned IOCTL_TCSETA;
-extern unsigned IOCTL_TCSETAF;
-extern unsigned IOCTL_TCSETAW;
#if SANITIZER_TERMIOS_IOCTL_CONSTANTS
extern unsigned IOCTL_TCGETS;
extern unsigned IOCTL_TCSETS;
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] 9869d43 - [sanitizer] Remove usage of termios ioctl constants on Linux glibc since 2.41 (#149140)
Author: cqwrteur
Date: 2025-08-05T10:54:10+02:00
New Revision: 9869d43fc275c44266e758cd45d0cfd3784cbd39
URL:
https://github.com/llvm/llvm-project/commit/9869d43fc275c44266e758cd45d0cfd3784cbd39
DIFF:
https://github.com/llvm/llvm-project/commit/9869d43fc275c44266e758cd45d0cfd3784cbd39.diff
LOG: [sanitizer] Remove usage of termios ioctl constants on Linux glibc since
2.41 (#149140)
glibc 2.42 made all usage of termios ioctl constants strictly internal
Therefore, we remove all usage for those removed constants.
This should only apply for Linux.
Fix #149103
Reference:
https://github.com/bminor/glibc/commit/3d3572f59059e2b19b8541ea648a6172136ec42e
@fweimer-rh @tstellar
(cherry picked from commit 0a17483c481d82eace3b36aee9cacb619eb027af)
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
compiler-rt/lib/sanitizer_common/sanitizer_platform.h
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
Removed:
diff --git
a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
index 08c2be47f5358..673f284b6a043 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
@@ -344,12 +344,16 @@ static void ioctl_table_fill() {
_(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int));
_(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int));
_(TCFLSH, NONE, 0);
+#if SANITIZER_TERMIOS_IOCTL_CONSTANTS
_(TCGETS, WRITE, struct_termios_sz);
+#endif
_(TCSBRK, NONE, 0);
_(TCSBRKP, NONE, 0);
+#if SANITIZER_TERMIOS_IOCTL_CONSTANTS
_(TCSETS, READ, struct_termios_sz);
_(TCSETSF, READ, struct_termios_sz);
_(TCSETSW, READ, struct_termios_sz);
+#endif
_(TCXONC, NONE, 0);
_(TIOCGLCKTRMIOS, WRITE, struct_termios_sz);
_(TIOCGSOFTCAR, WRITE, sizeof(int));
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
index 196c0a988478e..13099fe84b0aa 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
@@ -482,4 +482,19 @@
# define SANITIZER_START_BACKGROUND_THREAD_IN_ASAN_INTERNAL 0
#endif
+#if SANITIZER_LINUX
+# if SANITIZER_GLIBC
+// Workaround for
+// glibc/commit/3d3572f59059e2b19b8541ea648a6172136ec42e
+// Linux: Keep termios ioctl constants strictly internal
+#if __GLIBC_PREREQ(2, 41)
+# define SANITIZER_TERMIOS_IOCTL_CONSTANTS 0
+#else
+# define SANITIZER_TERMIOS_IOCTL_CONSTANTS 1
+#endif
+# else
+#define SANITIZER_TERMIOS_IOCTL_CONSTANTS 1
+# endif
+#endif
+
#endif // SANITIZER_PLATFORM_H
diff --git
a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
index 7a89bf1c74985..ef4b8a85d6634 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
@@ -780,15 +780,19 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
#endif // SOUND_VERSION
unsigned IOCTL_TCFLSH = TCFLSH;
unsigned IOCTL_TCGETA = TCGETA;
+#if SANITIZER_TERMIOS_IOCTL_CONSTANTS
unsigned IOCTL_TCGETS = TCGETS;
+#endif
unsigned IOCTL_TCSBRK = TCSBRK;
unsigned IOCTL_TCSBRKP = TCSBRKP;
unsigned IOCTL_TCSETA = TCSETA;
unsigned IOCTL_TCSETAF = TCSETAF;
unsigned IOCTL_TCSETAW = TCSETAW;
+#if SANITIZER_TERMIOS_IOCTL_CONSTANTS
unsigned IOCTL_TCSETS = TCSETS;
unsigned IOCTL_TCSETSF = TCSETSF;
unsigned IOCTL_TCSETSW = TCSETSW;
+#endif
unsigned IOCTL_TCXONC = TCXONC;
unsigned IOCTL_TIOCGLCKTRMIOS = TIOCGLCKTRMIOS;
unsigned IOCTL_TIOCGSOFTCAR = TIOCGSOFTCAR;
diff --git
a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
index 0d1273821d655..d3aec40b525e6 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -1315,15 +1315,17 @@ extern unsigned IOCTL_SNDCTL_COPR_WCODE;
extern unsigned IOCTL_SNDCTL_COPR_WDATA;
extern unsigned IOCTL_TCFLSH;
extern unsigned IOCTL_TCGETA;
-extern unsigned IOCTL_TCGETS;
extern unsigned IOCTL_TCSBRK;
extern unsigned IOCTL_TCSBRKP;
extern unsigned IOCTL_TCSETA;
extern unsigned IOCTL_TCSETAF;
extern unsigned IOCTL_TCSETAW;
+#if SANITIZER_TERMIOS_IOCTL_CONSTANTS
+extern unsigned IOCTL_TCGETS;
extern unsigned IOCTL_TCSETS;
extern unsigned IOCTL_TCSETSF;
extern unsigned IOCTL_TCSETSW;
+#endif
extern unsigned IOCTL_TCXONC;
extern unsigned IOCTL_TIOCGLCKTRMIOS;
exter
[llvm-branch-commits] [clang] release/21.x: [clang-format] Google Style: disable DerivePointerAlignment. (#149602) (PR #151797)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151797
>From c7ac782942f15cc38858965b435b9e10db38b757 Mon Sep 17 00:00:00 2001
From: James Y Knight
Date: Fri, 25 Jul 2025 11:55:50 -0400
Subject: [PATCH] [clang-format] Google Style: disable DerivePointerAlignment.
(#149602)
The [Google C++ Style
Guide](https://google.github.io/styleguide/cppguide.html#Pointer_and_Reference_Expressions)
is being changed to specify that spaces should go after the
asterisk/ampersand, rather than permitting either before or after on a
file-by-file basis.
The new requirement is:
> When referring to a pointer or reference (variable declarations or
> definitions, arguments, return types, template parameters, etc.),
> you must not place a space before the asterisk/ampersand. Use a
> space to separate the type from the declared name (if present).
The [Google ObjC
style](https://google.github.io/styleguide/objcguide.html) is silent on
this matter, but the de-facto style is not being modified at this time.
So, keep DerivePointerAlignment enabled for ObjC language mode.
(cherry picked from commit 9281797a577b7954521fb9192d41e457ca2ca42e)
---
clang/lib/Format/Format.cpp | 2 +-
clang/unittests/Format/FormatTest.cpp | 22 +-
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 0e92c93ea1dde..513fcfcd41258 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1749,7 +1749,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind
Language) {
GoogleStyle.AttributeMacros.push_back("absl_nullable");
GoogleStyle.AttributeMacros.push_back("absl_nullability_unknown");
GoogleStyle.BreakTemplateDeclarations = FormatStyle::BTDS_Yes;
- GoogleStyle.DerivePointerAlignment = true;
GoogleStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Regroup;
GoogleStyle.IncludeStyle.IncludeCategories = {{"^", 2, 0, false},
{"^<.*\\.h>", 1, 0, false},
@@ -1858,6 +1857,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind
Language) {
} else if (Language == FormatStyle::LK_ObjC) {
GoogleStyle.AlwaysBreakBeforeMultilineStrings = false;
GoogleStyle.ColumnLimit = 100;
+GoogleStyle.DerivePointerAlignment = true;
// "Regroup" doesn't work well for ObjC yet (main header heuristic,
// relationship between ObjC standard library headers and other heades,
// #imports, etc.)
diff --git a/clang/unittests/Format/FormatTest.cpp
b/clang/unittests/Format/FormatTest.cpp
index f9eedcb8f12af..e161f61e8864e 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -8571,10 +8571,10 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
"operator<<(const SomeLogType
&other);");
verifyGoogleFormat(
"SomeLoogType operator>>(\n"
- "const SomeLogType &a, const SomeLogType &b);");
+ "const SomeLogType& a, const SomeLogType& b);");
verifyGoogleFormat(
"SomeLoogType operator<<(\n"
- "const SomeLogType &a, const SomeLogType &b);");
+ "const SomeLogType& a, const SomeLogType& b);");
verifyFormat("void (\n"
"int aaa = 1);");
@@ -8583,7 +8583,7 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
verifyGoogleFormat(
"typename aa::aaa\n"
"aa::aaa(\n"
- "bool *aa, bool *aa) {}");
+ "bool* aa, bool* aa) {}");
verifyGoogleFormat("template \n"
"aa\n"
"aaa::a(\n"
@@ -12891,27 +12891,31 @@ TEST_F(FormatTest, UnderstandsEllipsis) {
}
TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
+ auto Style = getGoogleStyle();
+ EXPECT_FALSE(Style.DerivePointerAlignment);
+ Style.DerivePointerAlignment = true;
+
verifyFormat("int *a;\n"
"int *a;\n"
"int *a;",
"int *a;\n"
"int* a;\n"
"int *a;",
- getGoogleStyle());
+ Style);
verifyFormat("int* a;\n"
"int* a;\n"
"int* a;",
"int* a;\n"
"int* a;\n"
"int *a;",
- getGoogleStyle());
+ Style);
verifyFormat("int *a;\n"
"int *a;\n"
"int *a;",
"int *a;\n"
"int * a;\n"
"int * a;",
- getGoogleStyle());
+ Style);
verifyFormat("auto x = [] {\n"
" int *a;\n"
[llvm-branch-commits] [clang] release/21.x: [clang-format] Google Style: disable DerivePointerAlignment. (#149602) (PR #151797)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151797 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [lld][LoongArch] GOT indirection to PC relative optimization (#123743) (PR #151794)
github-actions[bot] wrote: @brad0 (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151794 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 863f996 - [RISCV] vsha2cl intrinsics should select vsha2cl instructions.
Author: Craig Topper
Date: 2025-08-05T10:55:42+02:00
New Revision: 863f9963c3789b3da0e10ca90a6cd1e0809b7cfe
URL:
https://github.com/llvm/llvm-project/commit/863f9963c3789b3da0e10ca90a6cd1e0809b7cfe
DIFF:
https://github.com/llvm/llvm-project/commit/863f9963c3789b3da0e10ca90a6cd1e0809b7cfe.diff
LOG: [RISCV] vsha2cl intrinsics should select vsha2cl instructions.
Fixes #151814.
(cherry picked from commit a585d5758847dd7e4cd7d8137bea6c1577c53009)
Added:
Modified:
llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
llvm/test/CodeGen/RISCV/rvv/vsha2cl.ll
Removed:
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
b/llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
index 4147c97a7a23a..92bc3ee8bdacc 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZvk.td
@@ -1130,13 +1130,13 @@ let Predicates = [HasStdExtZvkned] in {
let Predicates = [HasStdExtZvknha] in {
defm : VPatBinaryV_VV_NoMask<"int_riscv_vsha2ch", "PseudoVSHA2CH",
I32IntegerVectors>;
- defm : VPatBinaryV_VV_NoMask<"int_riscv_vsha2cl", "PseudoVSHA2CH",
I32IntegerVectors>;
+ defm : VPatBinaryV_VV_NoMask<"int_riscv_vsha2cl", "PseudoVSHA2CL",
I32IntegerVectors>;
defm : VPatBinaryV_VV_NoMask<"int_riscv_vsha2ms", "PseudoVSHA2MS",
I32IntegerVectors, isSEWAware=true>;
} // Predicates = [HasStdExtZvknha]
let Predicates = [HasStdExtZvknhb] in {
defm : VPatBinaryV_VV_NoMask<"int_riscv_vsha2ch", "PseudoVSHA2CH",
I32I64IntegerVectors>;
- defm : VPatBinaryV_VV_NoMask<"int_riscv_vsha2cl", "PseudoVSHA2CH",
I32I64IntegerVectors>;
+ defm : VPatBinaryV_VV_NoMask<"int_riscv_vsha2cl", "PseudoVSHA2CL",
I32I64IntegerVectors>;
defm : VPatBinaryV_VV_NoMask<"int_riscv_vsha2ms", "PseudoVSHA2MS",
I32I64IntegerVectors, isSEWAware=true>;
} // Predicates = [HasStdExtZvknhb]
diff --git a/llvm/test/CodeGen/RISCV/rvv/vsha2cl.ll
b/llvm/test/CodeGen/RISCV/rvv/vsha2cl.ll
index f29c74ae69bf6..697c582dcb38b 100644
--- a/llvm/test/CodeGen/RISCV/rvv/vsha2cl.ll
+++ b/llvm/test/CodeGen/RISCV/rvv/vsha2cl.ll
@@ -21,7 +21,7 @@ define
@intrinsic_vsha2cl_vv_nxv4i32_nxv4i32( @llvm.riscv.vsha2cl.nxv4i32.nxv4i32(
@@ -45,7 +45,7 @@ define
@intrinsic_vsha2cl_vv_nxv8i32_nxv8i32( @llvm.riscv.vsha2cl.nxv8i32.nxv8i32(
@@ -70,7 +70,7 @@ define
@intrinsic_vsha2cl_vv_nxv16i32_nxv16i32( @llvm.riscv.vsha2cl.nxv16i32.nxv16i32(
@@ -94,7 +94,7 @@ define
@intrinsic_vsha2cl_vv_nxv4i64_nxv4i64( @llvm.riscv.vsha2cl.nxv4i64.nxv4i64(
@@ -119,7 +119,7 @@ define
@intrinsic_vsha2cl_vv_nxv8i64_nxv8i64( @llvm.riscv.vsha2cl.nxv8i64.nxv8i64(
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [clang] Avoid inheriting [[noreturn]] in explicit function template specializations (#150003) (PR #151752)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151752 >From 087cb2e91c5b276531b617781974e76145b7da0f Mon Sep 17 00:00:00 2001 From: Samarth Narang <[email protected]> Date: Wed, 23 Jul 2025 21:04:05 -0400 Subject: [PATCH] [clang] Avoid inheriting [[noreturn]] in explicit function template specializations (#150003) This patch fixes incorrect behavior in Clang where [[noreturn]] (either spelled or inferred) was being inherited by explicit specializations of function templates or member function templates, even when those specializations returned normally. Follow up on https://github.com/llvm/llvm-project/pull/145166 (cherry picked from commit 22fef005225b129d73ade4ed995fc0ec0c7be044) --- clang/lib/Sema/SemaDecl.cpp | 8 clang/lib/Sema/SemaDeclAttr.cpp | 7 +++ clang/test/SemaCXX/wreturn-always-throws.cpp | 21 +++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 14403e65e8f42..bb412ef6788e7 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3267,6 +3267,14 @@ void Sema::mergeDeclAttributes(NamedDecl *New, Decl *Old, if (isa(I) || isa(I)) continue; +if (isa(I)) { + if (auto *FD = dyn_cast(New)) { +if (FD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization) + continue; // Don't propagate inferred noreturn attributes to explicit +// specializations. + } +} + if (mergeDeclAttribute(*this, New, I, LocalAMK)) foundAny = true; } diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index eff5f9568236a..a7897bdfe6e0f 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1970,6 +1970,13 @@ void clang::inferNoReturnAttr(Sema &S, const Decl *D) { if (!FD) return; + // Skip explicit specializations here as they may have + // a user-provided definition that may deliberately differ from the primary + // template. If an explicit specialization truly never returns, the user + // should explicitly mark it with [[noreturn]]. + if (FD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization) +return; + auto *NonConstFD = const_cast(FD); DiagnosticsEngine &Diags = S.getDiagnostics(); if (Diags.isIgnored(diag::warn_falloff_nonvoid, FD->getLocation()) && diff --git a/clang/test/SemaCXX/wreturn-always-throws.cpp b/clang/test/SemaCXX/wreturn-always-throws.cpp index addcadd1183dc..df7689f7063cc 100644 --- a/clang/test/SemaCXX/wreturn-always-throws.cpp +++ b/clang/test/SemaCXX/wreturn-always-throws.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type -verify %s +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type -Winvalid-noreturn -verify %s // expected-no-diagnostics namespace std { @@ -44,3 +44,22 @@ void testTemplates() { throwErrorTemplate("ERROR"); (void)ensureZeroTemplate(42); } + +// Ensure that explicit specialization of a member function does not inherit +// the warning from the primary template. + +template +struct S { + void f(); + void g(); +}; + +template +void S::f() { throw 0; } +template<> +void S::f() {} + +template +void S::g() {} +template<> +void S::g() { throw 0; } ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] 087cb2e - [clang] Avoid inheriting [[noreturn]] in explicit function template specializations (#150003)
Author: Samarth Narang
Date: 2025-08-05T10:54:39+02:00
New Revision: 087cb2e91c5b276531b617781974e76145b7da0f
URL:
https://github.com/llvm/llvm-project/commit/087cb2e91c5b276531b617781974e76145b7da0f
DIFF:
https://github.com/llvm/llvm-project/commit/087cb2e91c5b276531b617781974e76145b7da0f.diff
LOG: [clang] Avoid inheriting [[noreturn]] in explicit function template
specializations (#150003)
This patch fixes incorrect behavior in Clang where [[noreturn]] (either
spelled or inferred) was being inherited by explicit specializations of
function templates or member function templates, even when those
specializations returned normally.
Follow up on https://github.com/llvm/llvm-project/pull/145166
(cherry picked from commit 22fef005225b129d73ade4ed995fc0ec0c7be044)
Added:
Modified:
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/SemaCXX/wreturn-always-throws.cpp
Removed:
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 14403e65e8f42..bb412ef6788e7 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3267,6 +3267,14 @@ void Sema::mergeDeclAttributes(NamedDecl *New, Decl *Old,
if (isa(I) || isa(I))
continue;
+if (isa(I)) {
+ if (auto *FD = dyn_cast(New)) {
+if (FD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization)
+ continue; // Don't propagate inferred noreturn attributes to explicit
+// specializations.
+ }
+}
+
if (mergeDeclAttribute(*this, New, I, LocalAMK))
foundAny = true;
}
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index eff5f9568236a..a7897bdfe6e0f 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -1970,6 +1970,13 @@ void clang::inferNoReturnAttr(Sema &S, const Decl *D) {
if (!FD)
return;
+ // Skip explicit specializations here as they may have
+ // a user-provided definition that may deliberately
diff er from the primary
+ // template. If an explicit specialization truly never returns, the user
+ // should explicitly mark it with [[noreturn]].
+ if (FD->getTemplateSpecializationKind() == TSK_ExplicitSpecialization)
+return;
+
auto *NonConstFD = const_cast(FD);
DiagnosticsEngine &Diags = S.getDiagnostics();
if (Diags.isIgnored(diag::warn_falloff_nonvoid, FD->getLocation()) &&
diff --git a/clang/test/SemaCXX/wreturn-always-throws.cpp
b/clang/test/SemaCXX/wreturn-always-throws.cpp
index addcadd1183dc..df7689f7063cc 100644
--- a/clang/test/SemaCXX/wreturn-always-throws.cpp
+++ b/clang/test/SemaCXX/wreturn-always-throws.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type
-verify %s
+// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -fexceptions -Wreturn-type
-Winvalid-noreturn -verify %s
// expected-no-diagnostics
namespace std {
@@ -44,3 +44,22 @@ void testTemplates() {
throwErrorTemplate("ERROR");
(void)ensureZeroTemplate(42);
}
+
+// Ensure that explicit specialization of a member function does not inherit
+// the warning from the primary template.
+
+template
+struct S {
+ void f();
+ void g();
+};
+
+template
+void S::f() { throw 0; }
+template<>
+void S::f() {}
+
+template
+void S::g() {}
+template<>
+void S::g() { throw 0; }
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [ELF][Hexagon] Fix host endianness assumption (PR #151886)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151886
>From 489d36cedc71b13b04a579c52ba58924bc6bafb6 Mon Sep 17 00:00:00 2001
From: Jessica Clarke
Date: Sun, 3 Aug 2025 21:22:08 +0100
Subject: [PATCH 1/3] [NFC][ELF] Add missing blank line between functions
Fixes: b42f96bc057f ("[lld] Add thunks for hexagon (#111217)")
(cherry picked from commit b03d1e1e2e8e4b0b4b9e035b7ad9fb86dccefb93)
---
lld/ELF/Relocations.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 2ee308a2d1b3c..b6c676e294e44 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -2162,6 +2162,7 @@ static int getHexagonPacketOffset(const InputSection
&isec,
return i * 4;
}
}
+
static int64_t getPCBias(Ctx &ctx, const InputSection &isec,
const Relocation &rel) {
if (ctx.arg.emachine == EM_ARM) {
>From 74a0c1e962c04a500f79d2d02b8cdf6c170c2937 Mon Sep 17 00:00:00 2001
From: Jessica Clarke
Date: Sun, 3 Aug 2025 21:24:10 +0100
Subject: [PATCH 2/3] [NFC][ELF][Hexagon] Avoid pointless ArrayRef::drop_front
Fixes: b42f96bc057f ("[lld] Add thunks for hexagon (#111217)")
(cherry picked from commit de15d365743e16848a9d15fc32ae6ab98d399ec2)
---
lld/ELF/Relocations.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index b6c676e294e44..9549cc6f56326 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -2154,9 +2154,8 @@ static int getHexagonPacketOffset(const InputSection
&isec,
if (i == 3 || rel.offset < (i + 1) * 4)
return i * 4;
uint32_t instWord = 0;
-const ArrayRef instWordContents =
-data.drop_front(rel.offset - (i + 1) * 4);
-memcpy(&instWord, instWordContents.data(), sizeof(instWord));
+memcpy(&instWord, data.data() + (rel.offset - (i + 1) * 4),
+ sizeof(instWord));
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
return i * 4;
>From f5ad8dc6876ab667d07fe6c3bd2ac2bad434f6fb Mon Sep 17 00:00:00 2001
From: Jessica Clarke
Date: Sun, 3 Aug 2025 21:28:48 +0100
Subject: [PATCH 3/3] [ELF][Hexagon] Fix host endianness assumption
Fixes: b42f96bc057f ("[lld] Add thunks for hexagon (#111217)")
(cherry picked from commit 723b40a8d92f76fc913ef21061fc3d74e8c47441)
---
lld/ELF/Relocations.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 9549cc6f56326..608cdd0d26660 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -2153,9 +2153,8 @@ static int getHexagonPacketOffset(const InputSection
&isec,
for (unsigned i = 0;; i++) {
if (i == 3 || rel.offset < (i + 1) * 4)
return i * 4;
-uint32_t instWord = 0;
-memcpy(&instWord, data.data() + (rel.offset - (i + 1) * 4),
- sizeof(instWord));
+uint32_t instWord =
+read32(isec.getCtx(), data.data() + (rel.offset - (i + 1) * 4));
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
return i * 4;
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/21.x: [libc++][hardening] Add a greppable prefix to assertion messages. (#150560) (PR #151921)
github-actions[bot] wrote: @var-const (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151921 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [C] static_assert in a for loop is not an extension (#151955) (PR #151999)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151999
>From d502822e682a1147e64e63ae93af2e8f794f05b0 Mon Sep 17 00:00:00 2001
From: Aaron Ballman
Date: Mon, 4 Aug 2025 12:46:53 -0400
Subject: [PATCH] [C] static_assert in a for loop is not an extension (#151955)
The original wording can be squinted at to pretend this was always
allowed. GCC squints at it that way, so we're doing the same and no
longer issuing an extension diagnostic for use of static_assert in the
condition-1 of a for loop in C.
Fixes #149633
(cherry picked from commit cb50d78a0063244434d883d89ddda7f74abbffc9)
---
clang/lib/Sema/SemaStmt.cpp | 6 +-
clang/test/Sema/for.c | 3 +--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index f85826aecadf3..f46be75bda20f 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -2287,7 +2287,11 @@ StmtResult Sema::ActOnForStmt(SourceLocation ForLoc,
SourceLocation LParenLoc,
// we can diagnose if we don't see any variable declarations. This
// covers a case like declaring a typedef, function, or structure
// type rather than a variable.
- NonVarSeen = DI;
+ //
+ // Note, _Static_assert is acceptable because it does not declare an
+ // identifier at all, so "for object having" does not apply.
+ if (!isa(DI))
+NonVarSeen = DI;
}
}
// Diagnose if we saw a non-variable declaration but no variable
diff --git a/clang/test/Sema/for.c b/clang/test/Sema/for.c
index e16169aac0c4c..35c4720ef3305 100644
--- a/clang/test/Sema/for.c
+++ b/clang/test/Sema/for.c
@@ -26,6 +26,5 @@ void b11 (void) { for (static _Thread_local struct { int i; }
s;s.i;); } /* c11-
#endif
void b12(void) {
- for(_Static_assert(1, "");;) {} /* c11-warning {{non-variable declaration in
'for' loop is a C23 extension}}
- c23-warning {{non-variable declaration in
'for' loop is incompatible with C standards before C23}} */
+ for(_Static_assert(1, "");;) {} /* okay, _Static_assert declares *no*
identifiers */
}
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [Driver][MinGW] Always put libc argument last, even if non-standard (#149434) (PR #151933)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151933
>From 1d46440e9f8232950de632102c56e85397b92fcb Mon Sep 17 00:00:00 2001
From: Keno Fischer
Date: Wed, 30 Jul 2025 01:09:27 -0400
Subject: [PATCH] [Driver][MinGW] Always put libc argument last, even if
non-standard (#149434)
I was attempting to build openblas with clang in msys2's `ucrt64`
environment (I'm aware of the `clang64` environment, but I wanted
libstdc++). The openblas link failed with the following:
```
clang -march=native -mtune=native -m64 -O2 -fno-asynchronous-unwind-tables -O2
-DSMALL_MATRIX_OPT -DMS_ABI -DMAX_STACK_ALLOC=2048 -Wall -m64
-DF_INTERFACE_GFORT -DDYNAMIC_ARCH -DSMP_SERVER -DNO_WARMUP
-DMAX_CPU_NUMBER=512 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1
-DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.29\" -UASMNAME -UASMFNAME
-UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME= -DASMFNAME=_ -DNAME=_
-DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I..
libopenblas64_.def dllinit.obj \
-shared -o ../libopenblas64_.dll -Wl,--out-implib,../libopenblas64_.dll.a \
-Wl,--whole-archive ../libopenblas64_p-r0.3.29.a -Wl,--no-whole-archive
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0
-LC:/msys64/ucrt64/bin/../lib/gcc
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/lib/../lib
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/lib
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../..
-lgfortran -lmingwex -lmsvcrt -lquadmath -lm -lpthread -lmingwex -lmsvcrt
-defaultlib:advapi32 -lgfortran -defaultlib:advapi32 -lgfortran
C:/msys64/ucrt64/bin/ld:
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):
in function `__report_error':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:157:(.text+0x59):
undefined reference to `abort'
C:/msys64/ucrt64/bin/ld:
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-tlsthrd.o):
in function `___w64_mingwthr_add_key_dtor':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/tlsthrd.c:48:(.text+0xa5): undefined
reference to `calloc'
C:/msys64/ucrt64/bin/ld:
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pesect.o):
in function `_FindPESectionByName':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pesect.c:79:(.text+0xfd): undefined
reference to `strncmp'
```
These symbols come from the `-lmingw32` dep that the driver added and
are ordinarily found in `-lmsvcrt`, which got skipped here, because
openblas passed `-lmsvcrt` explicitly earlier in the link line. Since we
always add these libraries at the end here, I think that clang is "at
fault" (as opposed to a user or packaging mistake) and should have added
some crt here.
To preserve the intent of letting the user override which crt is chosen,
duplicate the (first) user chosen crt `-l` into this position, although
we should perhaps consider an explicit `-mcrtdll` like gcc has as well.
(cherry picked from commit 7f470586e10543aa12efc7e04d4d4ac814eaca35)
---
clang/lib/Driver/ToolChains/MinGW.cpp | 11 +--
clang/test/Driver/mingw-msvcrt.c | 8
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp
b/clang/lib/Driver/ToolChains/MinGW.cpp
index b2e36ae6f97c3..4894e6a52e93d 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -85,11 +85,18 @@ void tools::MinGW::Linker::AddLibGCC(const ArgList &Args,
CmdArgs.push_back("-lmoldname");
CmdArgs.push_back("-lmingwex");
- for (auto Lib : Args.getAllArgValues(options::OPT_l))
+ for (auto Lib : Args.getAllArgValues(options::OPT_l)) {
if (StringRef(Lib).starts_with("msvcr") ||
StringRef(Lib).starts_with("ucrt") ||
-StringRef(Lib).starts_with("crtdll"))
+StringRef(Lib).starts_with("crtdll")) {
+ std::string CRTLib = (llvm::Twine("-l") + Lib).str();
+ // Respect the user's chosen crt variant, but still provide it
+ // again as the last linker argument, because some of the libraries
+ // we added above may depend on it.
+ CmdArgs.push_back(Args.MakeArgStringRef(CRTLib));
return;
+}
+ }
CmdArgs.push_back("-lmsvcrt");
}
diff --git a/clang/test/Driver/mingw-msvcrt.c b/clang/test/Driver/mingw-msvcrt.c
index 340ce1f57b0f8..e1648630476a0 100644
--- a/clang/test/Driver/mingw-msvcrt.c
+++ b/clang/test/Driver/mingw-msvcrt.c
@@ -7,10 +7,10 @@
// CHECK_DEFAULT: "-lmingwex" "-lmsvcrt" "-ladvapi32"
// CHECK_DEFAULT-SAME: "-lmsvcrt" "-lkernel32" "{{.*}}crtend.o"
// CHECK_MSVCR120: "-lmsvcr120"
-// CHECK_MSVCR120-SAME: "-lmingwex" "-ladvapi32"
+// CHECK_MSVCR120-SAME: "-lmingwex" "-lmsvcr120" "-ladvapi32"
// CHECK
[llvm-branch-commits] [libcxx] release/21.x: [libc++][hardening] Add a greppable prefix to assertion messages. (#150560) (PR #151921)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151921 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] 1d46440 - [Driver][MinGW] Always put libc argument last, even if non-standard (#149434)
Author: Keno Fischer
Date: 2025-08-05T10:57:19+02:00
New Revision: 1d46440e9f8232950de632102c56e85397b92fcb
URL:
https://github.com/llvm/llvm-project/commit/1d46440e9f8232950de632102c56e85397b92fcb
DIFF:
https://github.com/llvm/llvm-project/commit/1d46440e9f8232950de632102c56e85397b92fcb.diff
LOG: [Driver][MinGW] Always put libc argument last, even if non-standard
(#149434)
I was attempting to build openblas with clang in msys2's `ucrt64`
environment (I'm aware of the `clang64` environment, but I wanted
libstdc++). The openblas link failed with the following:
```
clang -march=native -mtune=native -m64 -O2 -fno-asynchronous-unwind-tables -O2
-DSMALL_MATRIX_OPT -DMS_ABI -DMAX_STACK_ALLOC=2048 -Wall -m64
-DF_INTERFACE_GFORT -DDYNAMIC_ARCH -DSMP_SERVER -DNO_WARMUP
-DMAX_CPU_NUMBER=512 -DMAX_PARALLEL_NUMBER=1 -DBUILD_SINGLE=1 -DBUILD_DOUBLE=1
-DBUILD_COMPLEX=1 -DBUILD_COMPLEX16=1 -DVERSION=\"0.3.29\" -UASMNAME -UASMFNAME
-UNAME -UCNAME -UCHAR_NAME -UCHAR_CNAME -DASMNAME= -DASMFNAME=_ -DNAME=_
-DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I..
libopenblas64_.def dllinit.obj \
-shared -o ../libopenblas64_.dll -Wl,--out-implib,../libopenblas64_.dll.a \
-Wl,--whole-archive ../libopenblas64_p-r0.3.29.a -Wl,--no-whole-archive
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0
-LC:/msys64/ucrt64/bin/../lib/gcc
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/lib/../lib
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../x86_64-w64-mingw32/lib
-LC:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../..
-lgfortran -lmingwex -lmsvcrt -lquadmath -lm -lpthread -lmingwex -lmsvcrt
-defaultlib:advapi32 -lgfortran -defaultlib:advapi32 -lgfortran
C:/msys64/ucrt64/bin/ld:
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o):
in function `__report_error':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:157:(.text+0x59):
undefined reference to `abort'
C:/msys64/ucrt64/bin/ld:
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-tlsthrd.o):
in function `___w64_mingwthr_add_key_dtor':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/tlsthrd.c:48:(.text+0xa5): undefined
reference to `calloc'
C:/msys64/ucrt64/bin/ld:
C:/msys64/ucrt64/bin/../lib/gcc/x86_64-w64-mingw32/15.1.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pesect.o):
in function `_FindPESectionByName':
D:/W/B/src/mingw-w64/mingw-w64-crt/crt/pesect.c:79:(.text+0xfd): undefined
reference to `strncmp'
```
These symbols come from the `-lmingw32` dep that the driver added and
are ordinarily found in `-lmsvcrt`, which got skipped here, because
openblas passed `-lmsvcrt` explicitly earlier in the link line. Since we
always add these libraries at the end here, I think that clang is "at
fault" (as opposed to a user or packaging mistake) and should have added
some crt here.
To preserve the intent of letting the user override which crt is chosen,
duplicate the (first) user chosen crt `-l` into this position, although
we should perhaps consider an explicit `-mcrtdll` like gcc has as well.
(cherry picked from commit 7f470586e10543aa12efc7e04d4d4ac814eaca35)
Added:
Modified:
clang/lib/Driver/ToolChains/MinGW.cpp
clang/test/Driver/mingw-msvcrt.c
Removed:
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp
b/clang/lib/Driver/ToolChains/MinGW.cpp
index b2e36ae6f97c3..4894e6a52e93d 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -85,11 +85,18 @@ void tools::MinGW::Linker::AddLibGCC(const ArgList &Args,
CmdArgs.push_back("-lmoldname");
CmdArgs.push_back("-lmingwex");
- for (auto Lib : Args.getAllArgValues(options::OPT_l))
+ for (auto Lib : Args.getAllArgValues(options::OPT_l)) {
if (StringRef(Lib).starts_with("msvcr") ||
StringRef(Lib).starts_with("ucrt") ||
-StringRef(Lib).starts_with("crtdll"))
+StringRef(Lib).starts_with("crtdll")) {
+ std::string CRTLib = (llvm::Twine("-l") + Lib).str();
+ // Respect the user's chosen crt variant, but still provide it
+ // again as the last linker argument, because some of the libraries
+ // we added above may depend on it.
+ CmdArgs.push_back(Args.MakeArgStringRef(CRTLib));
return;
+}
+ }
CmdArgs.push_back("-lmsvcrt");
}
diff --git a/clang/test/Driver/mingw-msvcrt.c
b/clang/test/Driver/mingw-msvcrt.c
index 340ce1f57b0f8..e1648630476a0 100644
--- a/clang/test/Driver/mingw-msvcrt.c
+++ b/clang/test/Driver/mingw-msvcrt.c
@@ -7,10 +7,10 @@
// CHECK_DEFAULT: "-lmingwex" "-lmsvcrt" "-ladvapi32"
// CHECK_DEFAULT-SAME: "-lmsvcrt" "-lkernel32" "{{.*}}crtend.o"
// CHECK_MSVCR120: "-lmsvcr120"
-//
[llvm-branch-commits] [clang] release/21.x: Thread safety analysis: Don't warn on acquiring reentrant capability (#150857) (PR #151889)
github-actions[bot] wrote: @aaronpuchert (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151889 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] release/21.x: [Flang][OpenMP][Docs] Update target-related support in Flang docs, NFC (#150443) (PR #151493)
github-actions[bot] wrote: @tblah (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151493 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [DTLTO][Clang][Docs] Update for COFF support (#149988) (PR #151670)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151670
>From 8b85cf53a164d274329b1d6e89952e5a810726c3 Mon Sep 17 00:00:00 2001
From: bd1976bris
Date: Fri, 1 Aug 2025 09:16:22 +0100
Subject: [PATCH] [DTLTO][Clang][Docs] Update for COFF support (#149988)
As the COFF linker is usually invoked independently, update the Clang
DTLTO section to show an example. This follows what is done earlier in
the document.
Also some minor fixes and improvements:
- Use generic distributor names to avoid implying anything about what an
Incredibuild distributor may or should support.
- Use subheadings for readability.
- Correct a mis-cased hyperlink.
(cherry picked from commit c129d65995babf8bf56499c3f8b9b6df073190ef)
---
clang/docs/ThinLTO.rst | 25 -
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/clang/docs/ThinLTO.rst b/clang/docs/ThinLTO.rst
index 569405ff5b2b7..8cb3e0b2b0d11 100644
--- a/clang/docs/ThinLTO.rst
+++ b/clang/docs/ThinLTO.rst
@@ -249,6 +249,9 @@ during the traditional link step.
The implementation is documented here: https://llvm.org/docs/DTLTO.html.
+Command-Line Options
+
+
DTLTO requires the LLD linker (``-fuse-ld=lld``).
``-fthinlto-distributor=``
@@ -260,17 +263,29 @@ DTLTO requires the LLD linker (``-fuse-ld=lld``).
- Can be specified multiple times to pass multiple options.
- Multiple options can also be specified by separating them with commas.
-Examples:
- - ``clang -flto=thin -fthinlto-distributor=incredibuild.exe
-Xthinlto-distributor=--verbose,--j10 -fuse-ld=lld``
- - ``clang -flto=thin -fthinlto-distributor=$(which python)
-Xthinlto-distributor=incredibuild.py -fuse-ld=lld``
-
If ``-fthinlto-distributor=`` is specified, Clang supplies the path to a
compiler to be executed remotely to perform the ThinLTO backend
compilations. Currently, this is Clang itself.
+Usage
+^
+
+Compilation is unchanged from ThinLTO. DTLTO options need to supplied for the
link step:
+
+.. code-block:: console
+
+ % clang -flto=thin -fthinlto-distributor=distribute.sh
-Xthinlto-distributor=--verbose,--j10 -fuse-ld=lld file1.o file2.o
+ % clang -flto=thin -fthinlto-distributor=$(which python)
-Xthinlto-distributor=distribute.py -fuse-ld=lld file1.o file2.o
+
+When using lld-link:
+
+.. code-block:: console
+
+ % lld-link /out:a.exe file1.obj file2.obj
/thinlto-distributor:distribute.exe
/thinlto-remote-compiler:${LLVM}\bin\clang.exe
/thinlto-distributor-arg:--verbose
+
Note that currently, DTLTO is only supported in some LLD flavors. Support can
be added to other LLD flavours in the future.
-See `DTLTO `_ for more information.
+See `DTLTO `_ for more information.
More Information
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm][docs] Add release note for LLDB MTE changes (PR #151548)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151548 >From 1f174745928283df10386cd5e8345567da47bb83 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Thu, 31 Jul 2025 16:56:39 +0100 Subject: [PATCH] [llvm][docs] Add release note for LLDB MTE changes Goes with https://github.com/llvm/llvm-project/pull/15. --- llvm/docs/ReleaseNotes.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md index de6b1181158d2..a126d7ae1ab4a 100644 --- a/llvm/docs/ReleaseNotes.md +++ b/llvm/docs/ReleaseNotes.md @@ -326,6 +326,9 @@ Changes to LLDB RISC-V code with `disassemble`'s `--byte` option. * LLDB added native support for the Model Context Protocol (MCP). An MCP server can be started with the `protocol-server start MCP` command. +* On AArch64 Linux, LLDB will now show the state of the `STORE_ONLY` field of + `mte_ctrl`. This will only be shown on hardware that has the + `FEAT_MTE_STORE_ONLY` architecture feature. ### Changes to lldb-dap ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm][docs] Add release note for LLDB MTE changes (PR #151548)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151548 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm][docs] Add release note for LLDB MTE changes (PR #151548)
github-actions[bot] wrote: @DavidSpickett (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151548 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] [llvm] release/21.x: [DTLTO][LLD][ELF] Support bitcode members of thin archives (#149425) (PR #151674)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151674 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [DTLTO][Clang][Docs] Update for COFF support (#149988) (PR #151670)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151670 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] 78ce57c - [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (#151077)
Author: Phoebe Wang
Date: 2025-08-05T10:41:53+02:00
New Revision: 78ce57ca69db9f20ae631a6b1e1227aef3c45a59
URL:
https://github.com/llvm/llvm-project/commit/78ce57ca69db9f20ae631a6b1e1227aef3c45a59
DIFF:
https://github.com/llvm/llvm-project/commit/78ce57ca69db9f20ae631a6b1e1227aef3c45a59.diff
LOG: [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (#151077)
For maskz intrinsics, the first argument is always the mask.
(cherry picked from commit 3ea3e334cc19cdd34416b546ac4b4a24b2018a28)
Added:
Modified:
clang/lib/Headers/avx10_2_512niintrin.h
clang/lib/Headers/avx10_2niintrin.h
clang/test/CodeGen/X86/avx10_2_512ni-builtins.c
clang/test/CodeGen/X86/avx10_2ni-builtins.c
Removed:
diff --git a/clang/lib/Headers/avx10_2_512niintrin.h
b/clang/lib/Headers/avx10_2_512niintrin.h
index 7e614f7740bff..9d96e36c74ca4 100644
--- a/clang/lib/Headers/avx10_2_512niintrin.h
+++ b/clang/lib/Headers/avx10_2_512niintrin.h
@@ -197,7 +197,7 @@ _mm512_mask_dpwsud_epi32(__m512i __A, __mmask16 __U,
__m512i __B, __m512i __C) {
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsud_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwsud_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -218,7 +218,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_dpwsuds_epi32(
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwsuds_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwsuds_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -239,7 +239,7 @@ _mm512_mask_dpwusd_epi32(__m512i __A, __mmask16 __U,
__m512i __B, __m512i __C) {
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusd_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwusd_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -260,7 +260,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_dpwusds_epi32(
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwusds_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwusds_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -281,7 +281,7 @@ _mm512_mask_dpwuud_epi32(__m512i __A, __mmask16 __U,
__m512i __B, __m512i __C) {
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuud_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwuud_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
@@ -302,7 +302,7 @@ static __inline__ __m512i __DEFAULT_FN_ATTRS
_mm512_mask_dpwuuds_epi32(
}
static __inline__ __m512i __DEFAULT_FN_ATTRS _mm512_maskz_dpwuuds_epi32(
-__m512i __A, __mmask16 __U, __m512i __B, __m512i __C) {
+__mmask16 __U, __m512i __A, __m512i __B, __m512i __C) {
return (__m512i)__builtin_ia32_selectd_512(
(__mmask16)__U, (__v16si)_mm512_dpwuuds_epi32(__A, __B, __C),
(__v16si)_mm512_setzero_si512());
diff --git a/clang/lib/Headers/avx10_2niintrin.h
b/clang/lib/Headers/avx10_2niintrin.h
index 992be18f7720a..d5a66cfef536c 100644
--- a/clang/lib/Headers/avx10_2niintrin.h
+++ b/clang/lib/Headers/avx10_2niintrin.h
@@ -253,7 +253,7 @@ _mm_mask_dpwsud_epi32(__m128i __A, __mmask8 __U, __m128i
__B, __m128i __C) {
}
static __inline__ __m128i __DEFAULT_FN_ATTRS128
-_mm_maskz_dpwsud_epi32(__m128i __A, __mmask8 __U, __m128i __B, __m128i __C) {
+_mm_maskz_dpwsud_epi32(__mmask8 __U, __m128i __A, __m128i __B, __m128i __C) {
return (__m128i)__builtin_ia32_selectd_128(
(__mmask8)__U, (__v4si)_mm_dpwsud_epi32(__A, __B, __C),
(__v4si)_mm_setzero_si128());
@@ -266,7 +266,7 @@ _mm256_mask_dpwsud_epi32(__m256i __A, __mmask8 __U, __m256i
__B, __m256i __C) {
}
static __inline__ __m256i __DEFAULT_FN_ATTRS256
-_mm256_maskz_dpwsud_epi32(__m256i __A, __mmask8 __U, __m256i __B, __m256i __C)
{
+_mm256_maskz_dpwsud_epi32(__mmask8 __U, __m256i __A, __m256i __B, __m256i __C)
{
return (__m256i)__builtin_ia32_selectd_256(
(__mmask8)__U, (__v8si)_mm256_dpwsud_epi32(__A, __B, __C),
(__v8si)_mm256_setzero_si256());
@@ -279,7 +279,7 @@ _mm_mask_dpwsuds_epi32(__m128i __A, __mmask8 __U, __m128i
[llvm-branch-commits] [clang] release/21.x: [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (#151077) (PR #151092)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151092 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] [llvm] release/21.x: [DTLTO][LLD][ELF] Support bitcode members of thin archives (#149425) (PR #151674)
github-actions[bot] wrote: @bd1976bris (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151674 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [lld][LoongArch] GOT indirection to PC relative optimization (#123743) (PR #151794)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151794 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [lld][LoongArch] GOT indirection to PC relative optimization (#123743) (PR #151794)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151794
>From ca8b2f3777a52bf33ed835b9c40f1304b0ccaa47 Mon Sep 17 00:00:00 2001
From: Zhaoxin Yang
Date: Fri, 1 Aug 2025 14:45:46 +0800
Subject: [PATCH] [lld][LoongArch] GOT indirection to PC relative optimization
(#123743)
In LoongArch, we try GOT indirection to PC relative optimization in
normal or medium code model, whether or not with R_LARCH_RELAX
relocation.
From:
* pcalau12i $a0, %got_pc_hi20(sym_got)
* ld.w/d $a0, $a0, %got_pc_lo12(sym_got)
To:
* pcalau12i $a0, %pc_hi20(sym)
* addi.w/d $a0, $a0, %pc_lo12(sym)
If the original code sequence can be relaxed into a single instruction
`pcaddi`, this patch will not be taken (see
https://github.com/llvm/llvm-project/pull/123566).
The optimization related to GOT is split into two locations because the
`relax()` function is part of an iteration fixed-point algorithm. We
should minimize it to achieve better linker performance.
Note: Althouth the optimization has been performed, the GOT entries
still exists, similarly to AArch64. Eliminating the entries will
increase code complexity.
(cherry picked from commit 283c47b4c5231a1baf528355f7119a73ac168968)
---
lld/ELF/Arch/LoongArch.cpp | 117
lld/test/ELF/loongarch-pc-hi20-lo12-got.s | 145
lld/test/ELF/loongarch-relax-pc-hi20-lo12.s | 10 +-
3 files changed, 268 insertions(+), 4 deletions(-)
create mode 100644 lld/test/ELF/loongarch-pc-hi20-lo12-got.s
diff --git a/lld/ELF/Arch/LoongArch.cpp b/lld/ELF/Arch/LoongArch.cpp
index a14553018fc36..8802c8c2e7f01 100644
--- a/lld/ELF/Arch/LoongArch.cpp
+++ b/lld/ELF/Arch/LoongArch.cpp
@@ -46,6 +46,8 @@ class LoongArch final : public TargetInfo {
private:
void tlsdescToIe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
void tlsdescToLe(uint8_t *loc, const Relocation &rel, uint64_t val) const;
+ bool tryGotToPCRel(uint8_t *loc, const Relocation &rHi20,
+ const Relocation &rLo12, uint64_t secAddr) const;
};
} // end anonymous namespace
@@ -1155,6 +1157,78 @@ void LoongArch::tlsdescToLe(uint8_t *loc, const
Relocation &rel,
}
}
+// Try GOT indirection to PC relative optimization.
+// From:
+// * pcalau12i $a0, %got_pc_hi20(sym_got)
+// * ld.w/d$a0, $a0, %got_pc_lo12(sym_got)
+// To:
+// * pcalau12i $a0, %pc_hi20(sym)
+// * addi.w/d $a0, $a0, %pc_lo12(sym)
+//
+// Note: Althouth the optimization has been performed, the GOT entries still
+// exists, similarly to AArch64. Eliminating the entries will increase code
+// complexity.
+bool LoongArch::tryGotToPCRel(uint8_t *loc, const Relocation &rHi20,
+ const Relocation &rLo12, uint64_t secAddr) const
{
+ // Check if the relocations apply to consecutive instructions.
+ if (rHi20.offset + 4 != rLo12.offset)
+return false;
+
+ // Check if the relocations reference the same symbol and skip undefined,
+ // preemptible and STT_GNU_IFUNC symbols.
+ if (!rHi20.sym || rHi20.sym != rLo12.sym || !rHi20.sym->isDefined() ||
+ rHi20.sym->isPreemptible || rHi20.sym->isGnuIFunc())
+return false;
+
+ // GOT references to absolute symbols can't be relaxed to use PCALAU12I/ADDI
+ // in position-independent code because these instructions produce a relative
+ // address.
+ if ((ctx.arg.isPic && !cast(*rHi20.sym).section))
+return false;
+
+ // Check if the addends of the both relocations are zero.
+ if (rHi20.addend != 0 || rLo12.addend != 0)
+return false;
+
+ const uint32_t currInsn = read32le(loc);
+ const uint32_t nextInsn = read32le(loc + 4);
+ const uint32_t ldOpcode = ctx.arg.is64 ? LD_D : LD_W;
+ // Check if the first instruction is PCALAU12I and the second instruction is
+ // LD.
+ if ((currInsn & 0xfe00) != PCALAU12I ||
+ (nextInsn & 0xffc0) != ldOpcode)
+return false;
+
+ // Check if use the same register.
+ if (getD5(currInsn) != getJ5(nextInsn) || getJ5(nextInsn) != getD5(nextInsn))
+return false;
+
+ Symbol &sym = *rHi20.sym;
+ uint64_t symLocal = sym.getVA(ctx);
+ const int64_t displace = symLocal - getLoongArchPage(secAddr + rHi20.offset);
+ // Check if the symbol address is in
+ // [(PC & ~0xfff) - 2GiB - 0x800, (PC & ~0xfff) + 2GiB - 0x800).
+ const int64_t underflow = -0x8000LL - 0x800;
+ const int64_t overflow = 0x8000LL - 0x800;
+ if (!(displace >= underflow && displace < overflow))
+return false;
+
+ Relocation newRHi20 = {RE_LOONGARCH_PAGE_PC, R_LARCH_PCALA_HI20,
rHi20.offset,
+ rHi20.addend, &sym};
+ Relocation newRLo12 = {R_ABS, R_LARCH_PCALA_LO12, rLo12.offset, rLo12.addend,
+ &sym};
+ uint64_t pageDelta =
+ getLoongArchPageDelta(symLocal, secAddr + rHi20.offset, rHi20.type);
+ // pcalau12i $a0, %pc_hi20
+ write32le(loc, insn(PCALAU12I, getD5(currInsn), 0, 0));
+ relocate(loc, newRHi20, pageDelta);
+ // addi.w/d $a0, $a0, %pc_lo12
+ write32le(loc + 4, insn(ctx
[llvm-branch-commits] [clang] c7ac782 - [clang-format] Google Style: disable DerivePointerAlignment. (#149602)
Author: James Y Knight
Date: 2025-08-05T10:55:22+02:00
New Revision: c7ac782942f15cc38858965b435b9e10db38b757
URL:
https://github.com/llvm/llvm-project/commit/c7ac782942f15cc38858965b435b9e10db38b757
DIFF:
https://github.com/llvm/llvm-project/commit/c7ac782942f15cc38858965b435b9e10db38b757.diff
LOG: [clang-format] Google Style: disable DerivePointerAlignment. (#149602)
The [Google C++ Style
Guide](https://google.github.io/styleguide/cppguide.html#Pointer_and_Reference_Expressions)
is being changed to specify that spaces should go after the
asterisk/ampersand, rather than permitting either before or after on a
file-by-file basis.
The new requirement is:
> When referring to a pointer or reference (variable declarations or
> definitions, arguments, return types, template parameters, etc.),
> you must not place a space before the asterisk/ampersand. Use a
> space to separate the type from the declared name (if present).
The [Google ObjC
style](https://google.github.io/styleguide/objcguide.html) is silent on
this matter, but the de-facto style is not being modified at this time.
So, keep DerivePointerAlignment enabled for ObjC language mode.
(cherry picked from commit 9281797a577b7954521fb9192d41e457ca2ca42e)
Added:
Modified:
clang/lib/Format/Format.cpp
clang/unittests/Format/FormatTest.cpp
Removed:
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 0e92c93ea1dde..513fcfcd41258 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -1749,7 +1749,6 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind
Language) {
GoogleStyle.AttributeMacros.push_back("absl_nullable");
GoogleStyle.AttributeMacros.push_back("absl_nullability_unknown");
GoogleStyle.BreakTemplateDeclarations = FormatStyle::BTDS_Yes;
- GoogleStyle.DerivePointerAlignment = true;
GoogleStyle.IncludeStyle.IncludeBlocks = tooling::IncludeStyle::IBS_Regroup;
GoogleStyle.IncludeStyle.IncludeCategories = {{"^", 2, 0, false},
{"^<.*\\.h>", 1, 0, false},
@@ -1858,6 +1857,7 @@ FormatStyle getGoogleStyle(FormatStyle::LanguageKind
Language) {
} else if (Language == FormatStyle::LK_ObjC) {
GoogleStyle.AlwaysBreakBeforeMultilineStrings = false;
GoogleStyle.ColumnLimit = 100;
+GoogleStyle.DerivePointerAlignment = true;
// "Regroup" doesn't work well for ObjC yet (main header heuristic,
// relationship between ObjC standard library headers and other heades,
// #imports, etc.)
diff --git a/clang/unittests/Format/FormatTest.cpp
b/clang/unittests/Format/FormatTest.cpp
index f9eedcb8f12af..e161f61e8864e 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -8571,10 +8571,10 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
"operator<<(const SomeLogType
&other);");
verifyGoogleFormat(
"SomeLoogType operator>>(\n"
- "const SomeLogType &a, const SomeLogType &b);");
+ "const SomeLogType& a, const SomeLogType& b);");
verifyGoogleFormat(
"SomeLoogType operator<<(\n"
- "const SomeLogType &a, const SomeLogType &b);");
+ "const SomeLogType& a, const SomeLogType& b);");
verifyFormat("void (\n"
"int aaa = 1);");
@@ -8583,7 +8583,7 @@ TEST_F(FormatTest, BreaksFunctionDeclarations) {
verifyGoogleFormat(
"typename aa::aaa\n"
"aa::aaa(\n"
- "bool *aa, bool *aa) {}");
+ "bool* aa, bool* aa) {}");
verifyGoogleFormat("template \n"
"aa\n"
"aaa::a(\n"
@@ -12891,27 +12891,31 @@ TEST_F(FormatTest, UnderstandsEllipsis) {
}
TEST_F(FormatTest, AdaptivelyFormatsPointersAndReferences) {
+ auto Style = getGoogleStyle();
+ EXPECT_FALSE(Style.DerivePointerAlignment);
+ Style.DerivePointerAlignment = true;
+
verifyFormat("int *a;\n"
"int *a;\n"
"int *a;",
"int *a;\n"
"int* a;\n"
"int *a;",
- getGoogleStyle());
+ Style);
verifyFormat("int* a;\n"
"int* a;\n"
"int* a;",
"int* a;\n"
"int* a;\n"
"int *a;",
- getGoogleStyle());
+ Style);
verifyFormat("int *a;\n"
"int *a;\n"
"int *a;",
"int *a;\n"
"int * a;\n"
"int * a;",
- getGoogleStyle(
[llvm-branch-commits] [compiler-rt] release/21.x: Remove reference to obsolete termio ioctls (PR #151715)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151715 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: Thread safety analysis: Don't warn on acquiring reentrant capability (#150857) (PR #151889)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151889
>From d4046ae6df51ad41370dfe474bfb3c93fd8e166d Mon Sep 17 00:00:00 2001
From: Aaron Puchert
Date: Sun, 3 Aug 2025 19:50:17 +0200
Subject: [PATCH] Thread safety analysis: Don't warn on acquiring reentrant
capability (#150857)
The point of reentrant capabilities is that they can be acquired
multiple times, so they should probably be excluded from requiring a
negative capability on acquisition via -Wthread-safety-negative.
However, we still propagate explicit negative requirements.
(cherry picked from commit a048aeb06e5de571eadd646860c320b9a67d1efc)
---
clang/lib/Analysis/ThreadSafety.cpp | 2 +-
.../SemaCXX/warn-thread-safety-negative.cpp | 32 +++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/clang/lib/Analysis/ThreadSafety.cpp
b/clang/lib/Analysis/ThreadSafety.cpp
index 80e7c8eff671a..dadb0b757a2c8 100644
--- a/clang/lib/Analysis/ThreadSafety.cpp
+++ b/clang/lib/Analysis/ThreadSafety.cpp
@@ -1331,7 +1331,7 @@ void ThreadSafetyAnalyzer::addLock(FactSet &FSet,
FSet.removeLock(FactMan, NegC);
}
else {
- if (inCurrentScope(*Entry) && !Entry->asserted())
+ if (inCurrentScope(*Entry) && !Entry->asserted() && !Entry->reentrant())
Handler.handleNegativeNotHeld(Entry->getKind(), Entry->toString(),
NegC.toString(), Entry->loc());
}
diff --git a/clang/test/SemaCXX/warn-thread-safety-negative.cpp
b/clang/test/SemaCXX/warn-thread-safety-negative.cpp
index 9eabd67e4fc76..0caf6d6139e58 100644
--- a/clang/test/SemaCXX/warn-thread-safety-negative.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-negative.cpp
@@ -21,6 +21,15 @@ class LOCKABLE Mutex {
void AssertReaderHeld() ASSERT_SHARED_LOCK();
};
+class LOCKABLE REENTRANT_CAPABILITY ReentrantMutex {
+public:
+ void Lock() EXCLUSIVE_LOCK_FUNCTION();
+ void Unlock() UNLOCK_FUNCTION();
+
+ // for negative capabilities
+ const ReentrantMutex& operator!() const { return *this; }
+};
+
class SCOPED_LOCKABLE MutexLock {
public:
MutexLock(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu);
@@ -89,6 +98,29 @@ class Foo {
}
};
+class Reentrant {
+ ReentrantMutex mu;
+
+public:
+ void acquire() {
+mu.Lock(); // no warning -- reentrant mutex
+mu.Unlock();
+ }
+
+ void requireNegative() EXCLUSIVE_LOCKS_REQUIRED(!mu) { // warning?
+mu.Lock();
+mu.Unlock();
+ }
+
+ void callRequireNegative() {
+requireNegative(); // expected-warning{{calling function 'requireNegative'
requires negative capability '!mu'}}
+ }
+
+ void callHaveNegative() EXCLUSIVE_LOCKS_REQUIRED(!mu) {
+requireNegative();
+ }
+};
+
} // end namespace SimpleTest
Mutex globalMutex;
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: Thread safety analysis: Don't warn on acquiring reentrant capability (#150857) (PR #151889)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151889 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] 16bd92c - [libc++][hardening] Add a greppable prefix to assertion messages. (#150560)
Author: Konstantin Varlamov
Date: 2025-08-05T10:56:59+02:00
New Revision: 16bd92cdca5e0f29e109898e53bd71c31ce7593b
URL:
https://github.com/llvm/llvm-project/commit/16bd92cdca5e0f29e109898e53bd71c31ce7593b
DIFF:
https://github.com/llvm/llvm-project/commit/16bd92cdca5e0f29e109898e53bd71c31ce7593b.diff
LOG: [libc++][hardening] Add a greppable prefix to assertion messages. (#150560)
The current assertion failure messages produced by Hardening are not
very grep-friendly (the common part is rarther generic and requires
wildcards to match). While it's possible to use `__FILE__` for grepping,
it's easier and more straighforward to simply add a libc++-specific
prefix; this is especially important for the planned `observe` mode that
might produce many assertion failure messages over the course of the
program's execution that later need to be filtered and examined.
(cherry picked from commit 4ef92469ab341ac1bee39a9413ffaa845e307414)
Added:
Modified:
libcxx/include/__assert
libcxx/test/support/check_assertion.h
Removed:
diff --git a/libcxx/include/__assert b/libcxx/include/__assert
index 90eaa6023587b..a9451daf47f2f 100644
--- a/libcxx/include/__assert
+++ b/libcxx/include/__assert
@@ -20,8 +20,8 @@
#define _LIBCPP_ASSERT(expression, message)
\
(__builtin_expect(static_cast(expression), 1)
\
? (void)0
\
- : _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING(__LINE__) ":
assertion " _LIBCPP_TOSTRING(\
- expression) " failed: " message "\n"))
+ : _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING(
\
+ __LINE__) ": libc++ Hardening assertion "
_LIBCPP_TOSTRING(expression) " failed: " message "\n"))
// WARNING: __builtin_assume can currently inhibit optimizations. Only add
assumptions with a clear
// optimization intent. See
https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609 for a
diff --git a/libcxx/test/support/check_assertion.h
b/libcxx/test/support/check_assertion.h
index a091043195345..8416de76cfd61 100644
--- a/libcxx/test/support/check_assertion.h
+++ b/libcxx/test/support/check_assertion.h
@@ -52,8 +52,8 @@ MatchResult MatchAssertionMessage(const std::string& text,
std::string_view expe
// library.
std::string assertion_format_string = [&] {
if (use_marker)
- return (".*###\\n(.*):(\\d+): assertion (.*) failed: (.*)\\n###");
-return ("(.*):(\\d+): assertion (.*) failed: (.*)\\n");
+ return (".*###\\n(.*):(\\d+): libc\\+\\+ Hardening assertion (.*)
failed: (.*)\\n###");
+return ("(.*):(\\d+): libc\\+\\+ Hardening assertion (.*) failed:
(.*)\\n");
}();
std::regex assertion_format(assertion_format_string);
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/21.x: [libc++][hardening] Add a greppable prefix to assertion messages. (#150560) (PR #151921)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151921
>From 16bd92cdca5e0f29e109898e53bd71c31ce7593b Mon Sep 17 00:00:00 2001
From: Konstantin Varlamov
Date: Thu, 31 Jul 2025 02:52:17 -0700
Subject: [PATCH] [libc++][hardening] Add a greppable prefix to assertion
messages. (#150560)
The current assertion failure messages produced by Hardening are not
very grep-friendly (the common part is rarther generic and requires
wildcards to match). While it's possible to use `__FILE__` for grepping,
it's easier and more straighforward to simply add a libc++-specific
prefix; this is especially important for the planned `observe` mode that
might produce many assertion failure messages over the course of the
program's execution that later need to be filtered and examined.
(cherry picked from commit 4ef92469ab341ac1bee39a9413ffaa845e307414)
---
libcxx/include/__assert | 4 ++--
libcxx/test/support/check_assertion.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/libcxx/include/__assert b/libcxx/include/__assert
index 90eaa6023587b..a9451daf47f2f 100644
--- a/libcxx/include/__assert
+++ b/libcxx/include/__assert
@@ -20,8 +20,8 @@
#define _LIBCPP_ASSERT(expression, message)
\
(__builtin_expect(static_cast(expression), 1)
\
? (void)0
\
- : _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING(__LINE__) ":
assertion " _LIBCPP_TOSTRING(\
- expression) " failed: " message "\n"))
+ : _LIBCPP_ASSERTION_HANDLER(__FILE__ ":" _LIBCPP_TOSTRING(
\
+ __LINE__) ": libc++ Hardening assertion "
_LIBCPP_TOSTRING(expression) " failed: " message "\n"))
// WARNING: __builtin_assume can currently inhibit optimizations. Only add
assumptions with a clear
// optimization intent. See
https://discourse.llvm.org/t/llvm-assume-blocks-optimization/71609 for a
diff --git a/libcxx/test/support/check_assertion.h
b/libcxx/test/support/check_assertion.h
index a091043195345..8416de76cfd61 100644
--- a/libcxx/test/support/check_assertion.h
+++ b/libcxx/test/support/check_assertion.h
@@ -52,8 +52,8 @@ MatchResult MatchAssertionMessage(const std::string& text,
std::string_view expe
// library.
std::string assertion_format_string = [&] {
if (use_marker)
- return (".*###\\n(.*):(\\d+): assertion (.*) failed: (.*)\\n###");
-return ("(.*):(\\d+): assertion (.*) failed: (.*)\\n");
+ return (".*###\\n(.*):(\\d+): libc\\+\\+ Hardening assertion (.*)
failed: (.*)\\n###");
+return ("(.*):(\\d+): libc\\+\\+ Hardening assertion (.*) failed:
(.*)\\n");
}();
std::regex assertion_format(assertion_format_string);
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [ELF][Hexagon] Fix host endianness assumption (PR #151886)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151886 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [ELF][Hexagon] Fix host endianness assumption (PR #151886)
github-actions[bot] wrote: @jrtc27 (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151886 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] d4046ae - Thread safety analysis: Don't warn on acquiring reentrant capability (#150857)
Author: Aaron Puchert
Date: 2025-08-05T10:56:39+02:00
New Revision: d4046ae6df51ad41370dfe474bfb3c93fd8e166d
URL:
https://github.com/llvm/llvm-project/commit/d4046ae6df51ad41370dfe474bfb3c93fd8e166d
DIFF:
https://github.com/llvm/llvm-project/commit/d4046ae6df51ad41370dfe474bfb3c93fd8e166d.diff
LOG: Thread safety analysis: Don't warn on acquiring reentrant capability
(#150857)
The point of reentrant capabilities is that they can be acquired
multiple times, so they should probably be excluded from requiring a
negative capability on acquisition via -Wthread-safety-negative.
However, we still propagate explicit negative requirements.
(cherry picked from commit a048aeb06e5de571eadd646860c320b9a67d1efc)
Added:
Modified:
clang/lib/Analysis/ThreadSafety.cpp
clang/test/SemaCXX/warn-thread-safety-negative.cpp
Removed:
diff --git a/clang/lib/Analysis/ThreadSafety.cpp
b/clang/lib/Analysis/ThreadSafety.cpp
index 80e7c8eff671a..dadb0b757a2c8 100644
--- a/clang/lib/Analysis/ThreadSafety.cpp
+++ b/clang/lib/Analysis/ThreadSafety.cpp
@@ -1331,7 +1331,7 @@ void ThreadSafetyAnalyzer::addLock(FactSet &FSet,
FSet.removeLock(FactMan, NegC);
}
else {
- if (inCurrentScope(*Entry) && !Entry->asserted())
+ if (inCurrentScope(*Entry) && !Entry->asserted() && !Entry->reentrant())
Handler.handleNegativeNotHeld(Entry->getKind(), Entry->toString(),
NegC.toString(), Entry->loc());
}
diff --git a/clang/test/SemaCXX/warn-thread-safety-negative.cpp
b/clang/test/SemaCXX/warn-thread-safety-negative.cpp
index 9eabd67e4fc76..0caf6d6139e58 100644
--- a/clang/test/SemaCXX/warn-thread-safety-negative.cpp
+++ b/clang/test/SemaCXX/warn-thread-safety-negative.cpp
@@ -21,6 +21,15 @@ class LOCKABLE Mutex {
void AssertReaderHeld() ASSERT_SHARED_LOCK();
};
+class LOCKABLE REENTRANT_CAPABILITY ReentrantMutex {
+public:
+ void Lock() EXCLUSIVE_LOCK_FUNCTION();
+ void Unlock() UNLOCK_FUNCTION();
+
+ // for negative capabilities
+ const ReentrantMutex& operator!() const { return *this; }
+};
+
class SCOPED_LOCKABLE MutexLock {
public:
MutexLock(Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu);
@@ -89,6 +98,29 @@ class Foo {
}
};
+class Reentrant {
+ ReentrantMutex mu;
+
+public:
+ void acquire() {
+mu.Lock(); // no warning -- reentrant mutex
+mu.Unlock();
+ }
+
+ void requireNegative() EXCLUSIVE_LOCKS_REQUIRED(!mu) { // warning?
+mu.Lock();
+mu.Unlock();
+ }
+
+ void callRequireNegative() {
+requireNegative(); // expected-warning{{calling function 'requireNegative'
requires negative capability '!mu'}}
+ }
+
+ void callHaveNegative() EXCLUSIVE_LOCKS_REQUIRED(!mu) {
+requireNegative();
+ }
+};
+
} // end namespace SimpleTest
Mutex globalMutex;
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] f5ad8dc - [ELF][Hexagon] Fix host endianness assumption
Author: Jessica Clarke
Date: 2025-08-05T10:56:10+02:00
New Revision: f5ad8dc6876ab667d07fe6c3bd2ac2bad434f6fb
URL:
https://github.com/llvm/llvm-project/commit/f5ad8dc6876ab667d07fe6c3bd2ac2bad434f6fb
DIFF:
https://github.com/llvm/llvm-project/commit/f5ad8dc6876ab667d07fe6c3bd2ac2bad434f6fb.diff
LOG: [ELF][Hexagon] Fix host endianness assumption
Fixes: b42f96bc057f ("[lld] Add thunks for hexagon (#111217)")
(cherry picked from commit 723b40a8d92f76fc913ef21061fc3d74e8c47441)
Added:
Modified:
lld/ELF/Relocations.cpp
Removed:
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 9549cc6f56326..608cdd0d26660 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -2153,9 +2153,8 @@ static int getHexagonPacketOffset(const InputSection
&isec,
for (unsigned i = 0;; i++) {
if (i == 3 || rel.offset < (i + 1) * 4)
return i * 4;
-uint32_t instWord = 0;
-memcpy(&instWord, data.data() + (rel.offset - (i + 1) * 4),
- sizeof(instWord));
+uint32_t instWord =
+read32(isec.getCtx(), data.data() + (rel.offset - (i + 1) * 4));
if (((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_PACKET) ||
((instWord & HEXAGON_MASK_END_PACKET) == HEXAGON_END_OF_DUPLEX))
return i * 4;
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/21.x: [RISCV] vsha2cl intrinsics should select vsha2cl instructions. (PR #151834)
github-actions[bot] wrote: @topperc (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151834 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [LifetimeSafety] Add language option for experimental lifetime safety… (PR #152027)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/152027
>From 6419104d187807eafc61ae7dfda55b4101e8fd6f Mon Sep 17 00:00:00 2001
From: Utkarsh Saxena
Date: Tue, 22 Jul 2025 21:31:09 +0200
Subject: [PATCH] [LifetimeSafety] Add language option for experimental
lifetime safety (#149592)
Add a language option flag for experimental lifetime safety analysis in C++.
This change provides a language option to control the experimental lifetime
safety analysis feature, making it more explicit and easier to enable/disable.
Previously, the feature was controlled indirectly through a diagnostic warning
flag, which we do not want to accidentally enable with `-Weverything` (atm)!
- Added a new language option `EnableLifetimeSafety` in `LangOptions.def` for
experimental lifetime safety analysis in C++
- Added corresponding driver options `-fexperimental-lifetime-safety` and
`-fno-experimental-lifetime-safety` in `Options.td`
- Modified `AnalysisBasedWarnings.cpp` to use the new language option flag
instead of checking if a specific diagnostic is ignored
- Updated a test case to use the new flag instead of relying on the warning
flag alone
(cherry picked from commit 0d0478903474b2e53c874427e3d6eb2ed7567e50)
---
clang/include/clang/Basic/LangOptions.def | 2 ++
clang/include/clang/Driver/Options.td | 8
clang/lib/Sema/AnalysisBasedWarnings.cpp | 3 +--
clang/test/Sema/warn-lifetime-safety-dataflow.cpp | 2 +-
4 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/clang/include/clang/Basic/LangOptions.def
b/clang/include/clang/Basic/LangOptions.def
index 0d546cb3b8471..f5a5d84eefb80 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -496,6 +496,8 @@ LANGOPT(CheckConstexprFunctionBodies, 1, 1, Benign,
LANGOPT(BoundsSafety, 1, 0, NotCompatible, "Bounds safety extension for C")
+LANGOPT(EnableLifetimeSafety, 1, 0, NotCompatible, "Experimental lifetime
safety analysis for C++")
+
LANGOPT(PreserveVec3Type, 1, 0, NotCompatible, "Preserve 3-component vector
type")
#undef LANGOPT
diff --git a/clang/include/clang/Driver/Options.td
b/clang/include/clang/Driver/Options.td
index bce29a76f3ac7..18e4ab406ce4e 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1917,6 +1917,14 @@ defm bounds_safety : BoolFOption<
BothFlags<[], [CC1Option],
" experimental bounds safety extension for C">>;
+defm lifetime_safety : BoolFOption<
+ "experimental-lifetime-safety",
+ LangOpts<"EnableLifetimeSafety">, DefaultFalse,
+ PosFlag,
+ NegFlag,
+ BothFlags<[], [CC1Option],
+ " experimental lifetime safety for C++">>;
+
defm addrsig : BoolFOption<"addrsig",
CodeGenOpts<"Addrsig">, DefaultFalse,
PosFlag,
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp
b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index 85ac3c06ec2c2..ec39bca6039f0 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -2891,8 +2891,7 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
.setAlwaysAdd(Stmt::UnaryOperatorClass);
}
- bool EnableLifetimeSafetyAnalysis = !Diags.isIgnored(
- diag::warn_experimental_lifetime_safety_dummy_warning, D->getBeginLoc());
+ bool EnableLifetimeSafetyAnalysis = S.getLangOpts().EnableLifetimeSafety;
// Install the logical handler.
std::optional LEH;
if (LogicalErrorHandler::hasActiveDiagnostics(Diags, D->getBeginLoc())) {
diff --git a/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
b/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
index 38dfdb98f08fc..a956386ae9332 100644
--- a/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
+++ b/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -mllvm -debug-only=LifetimeFacts,LifetimeDataflow
-Wexperimental-lifetime-safety %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -fexperimental-lifetime-safety -mllvm
-debug-only=LifetimeFacts,LifetimeDataflow -Wexperimental-lifetime-safety %s
2>&1 | FileCheck %s
// REQUIRES: asserts
struct MyObj {
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [LifetimeSafety] Add language option for experimental lifetime safety… (PR #152027)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/152027 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [X86][AVX10.2] Fix VNNIINT16 maskz intrinsics arguments order (#151077) (PR #151092)
github-actions[bot] wrote: @phoebewang (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151092 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] d502822 - [C] static_assert in a for loop is not an extension (#151955)
Author: Aaron Ballman
Date: 2025-08-05T10:57:49+02:00
New Revision: d502822e682a1147e64e63ae93af2e8f794f05b0
URL:
https://github.com/llvm/llvm-project/commit/d502822e682a1147e64e63ae93af2e8f794f05b0
DIFF:
https://github.com/llvm/llvm-project/commit/d502822e682a1147e64e63ae93af2e8f794f05b0.diff
LOG: [C] static_assert in a for loop is not an extension (#151955)
The original wording can be squinted at to pretend this was always
allowed. GCC squints at it that way, so we're doing the same and no
longer issuing an extension diagnostic for use of static_assert in the
condition-1 of a for loop in C.
Fixes #149633
(cherry picked from commit cb50d78a0063244434d883d89ddda7f74abbffc9)
Added:
Modified:
clang/lib/Sema/SemaStmt.cpp
clang/test/Sema/for.c
Removed:
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index f85826aecadf3..f46be75bda20f 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -2287,7 +2287,11 @@ StmtResult Sema::ActOnForStmt(SourceLocation ForLoc,
SourceLocation LParenLoc,
// we can diagnose if we don't see any variable declarations. This
// covers a case like declaring a typedef, function, or structure
// type rather than a variable.
- NonVarSeen = DI;
+ //
+ // Note, _Static_assert is acceptable because it does not declare an
+ // identifier at all, so "for object having" does not apply.
+ if (!isa(DI))
+NonVarSeen = DI;
}
}
// Diagnose if we saw a non-variable declaration but no variable
diff --git a/clang/test/Sema/for.c b/clang/test/Sema/for.c
index e16169aac0c4c..35c4720ef3305 100644
--- a/clang/test/Sema/for.c
+++ b/clang/test/Sema/for.c
@@ -26,6 +26,5 @@ void b11 (void) { for (static _Thread_local struct { int i; }
s;s.i;); } /* c11-
#endif
void b12(void) {
- for(_Static_assert(1, "");;) {} /* c11-warning {{non-variable declaration in
'for' loop is a C23 extension}}
- c23-warning {{non-variable declaration in
'for' loop is incompatible with C standards before C23}} */
+ for(_Static_assert(1, "");;) {} /* okay, _Static_assert declares *no*
identifiers */
}
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] release/21.x: [libc++] Fix tests after #144220 (PR #152105)
https://github.com/cor3ntin created
https://github.com/llvm/llvm-project/pull/152105
This is a backport of the test fixes made in #151935
Fixes #150601
>From 4cadb6121917fe4a2f7aef0570585daf850dcac0 Mon Sep 17 00:00:00 2001
From: Corentin Jabot
Date: Tue, 5 Aug 2025 10:51:26 +0200
Subject: [PATCH] [libc++] Fix tests after #144220
This is a backport of the test fixes made in #151935
Fixes #150601
---
.../expected/expected.expected/value.observers.verify.cpp| 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
index 91a7db1d9a7c6..1a2d080d10c3c 100644
---
a/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
+++
b/libcxx/test/libcxx/utilities/expected/expected.expected/value.observers.verify.cpp
@@ -124,8 +124,9 @@ void test() {
#if _LIBCPP_HAS_EXCEPTIONS
// expected-error-re@*:* {{call to deleted constructor of{{.*
// expected-error-re@*:* {{call to deleted constructor of{{.*
- // expected-error-re@*:* 1-2{{call to deleted constructor of{{.*
- // expected-error-re@*:* 0-2{{call to deleted constructor of{{.*
#endif
+// These diagnostics can also additionally be produced by static_assert (see
GH150601).
+// expected-error-re@*:* 0-2{{call to deleted constructor of{{.*
+// expected-error-re@*:* 0-2{{call to deleted constructor of{{.*
}
// clang-format on
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [C] static_assert in a for loop is not an extension (#151955) (PR #151999)
github-actions[bot] wrote: @AaronBallman (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151999 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] [llvm] release/21.x: [DTLTO][LLD][ELF] Support bitcode members of thin archives (#149425) (PR #151674)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/151674
>From d9ddd18544a920fa562e682879642e4c9c0352ad Mon Sep 17 00:00:00 2001
From: bd1976bris
Date: Fri, 1 Aug 2025 09:38:46 +0100
Subject: [PATCH] [DTLTO][LLD][ELF] Support bitcode members of thin archives
(#149425)
This patch adds support for bitcode members of thin archives to DTLTO
(https://llvm.org/docs/DTLTO.html) in ELF LLD.
For DTLTO, bitcode identifiers must be valid paths to bitcode files on
disk. Clang does not support archive inputs for ThinLTO backend
compilations. This patch adjusts the identifier for bitcode members of
thin archives in DTLTO links so that it is the path to the member file
on disk, allowing such members to be supported in DTLTO.
This patch is sufficient to allow for self-hosting an LLVM build with
DTLTO when thin archives are used.
Note: Bitcode members of non-thin archives remain unsupported. This will
be addressed in a future change.
Testing:
- LLD lit test coverage has been added to check that the identifier is
adjusted appropriately.
- A cross-project lit test has been added to show that a DTLTO link can
succeed when linking bitcode members of thin archives.
For the design discussion of the DTLTO feature, see: #126654.
(cherry picked from commit 673476d96bed306be6ed81a8174f481a9a4b2934)
---
cross-project-tests/CMakeLists.txt| 5 +-
.../dtlto/ld-archive-thin.test| 97 +++
cross-project-tests/lit.cfg.py| 2 +
lld/ELF/InputFiles.cpp| 59 +--
lld/test/ELF/dtlto/archive-thin.test | 65 +
5 files changed, 216 insertions(+), 12 deletions(-)
create mode 100644 cross-project-tests/dtlto/ld-archive-thin.test
create mode 100644 lld/test/ELF/dtlto/archive-thin.test
diff --git a/cross-project-tests/CMakeLists.txt
b/cross-project-tests/CMakeLists.txt
index b4b1f47626073..192db87043177 100644
--- a/cross-project-tests/CMakeLists.txt
+++ b/cross-project-tests/CMakeLists.txt
@@ -19,11 +19,12 @@ set(CROSS_PROJECT_TEST_DEPS
FileCheck
check-gdb-llvm-support
count
- llvm-dwarfdump
+ llvm-ar
llvm-config
+ llvm-dwarfdump
llvm-objdump
- split-file
not
+ split-file
)
if ("clang" IN_LIST LLVM_ENABLE_PROJECTS)
diff --git a/cross-project-tests/dtlto/ld-archive-thin.test
b/cross-project-tests/dtlto/ld-archive-thin.test
new file mode 100644
index 0..979da5423962e
--- /dev/null
+++ b/cross-project-tests/dtlto/ld-archive-thin.test
@@ -0,0 +1,97 @@
+REQUIRES: ld.lld,llvm-ar
+
+## Test that a DTLTO link succeeds and outputs the expected set of files
+## correctly when thin archives are present.
+
+RUN: rm -rf %t && split-file %s %t && cd %t
+
+## Compile bitcode. -O2 is required for cross-module importing.
+RUN: %clang -O2 --target=x86_64-linux-gnu -flto=thin -c \
+RUN: foo.c bar.c dog.c cat.c start.c
+
+## Generate thin archives.
+RUN: llvm-ar rcs foo.a foo.o --thin
+## Create this bitcode thin archive in a subdirectory to test the expansion of
+## the path to a bitcode file that is referenced using "..", e.g., in this case
+## "../bar.o".
+RUN: mkdir lib
+RUN: llvm-ar rcs lib/bar.a bar.o --thin
+## Create this bitcode thin archive with an absolute path entry containing
"..".
+RUN: llvm-ar rcs dog.a %t/lib/../dog.o --thin
+## The bitcode member of cat.a will not be used in the link.
+RUN: llvm-ar rcs cat.a cat.o --thin
+RUN: llvm-ar rcs start.a start.o --thin
+
+## Link from a different directory to ensure that thin archive member paths are
+## resolved correctly relative to the archive locations.
+RUN: mkdir %t/out && cd %t/out
+
+RUN: %clang --target=x86_64-linux-gnu -flto=thin -fuse-ld=lld %t/foo.a
%t/lib/bar.a ../start.a %t/cat.a \
+RUN: -Wl,--whole-archive ../dog.a \
+RUN: -fthinlto-distributor=%python \
+RUN: -Xthinlto-distributor=%llvm_src_root/utils/dtlto/local.py \
+RUN: -Wl,--save-temps -nostdlib -Werror
+
+## Check that the required output files have been created.
+RUN: ls | sort | FileCheck %s
+
+## No files are expected before.
+CHECK-NOT: {{.}}
+
+## JSON jobs description.
+CHECK: {{^}}a.[[PID:[a-zA-Z0-9_]+]].dist-file.json{{$}}
+
+## Native output object files and individual summary index files.
+CHECK: {{^}}bar.3.[[PID]].native.o{{$}}
+CHECK: {{^}}bar.3.[[PID]].native.o.thinlto.bc{{$}}
+CHECK: {{^}}dog.1.[[PID]].native.o{{$}}
+CHECK: {{^}}dog.1.[[PID]].native.o.thinlto.bc{{$}}
+CHECK: {{^}}foo.2.[[PID]].native.o{{$}}
+CHECK: {{^}}foo.2.[[PID]].native.o.thinlto.bc{{$}}
+CHECK: {{^}}start.4.[[PID]].native.o{{$}}
+CHECK: {{^}}start.4.[[PID]].native.o.thinlto.bc{{$}}
+
+## No files are expected after.
+CHECK-NOT: {{.}}
+
+
+## It is important that cross-module inlining occurs for this test to show
that Clang can
+## successfully load the bitcode file dependencies recorded in the summary
indices.
+## Explicitly check that the expected importing has occurred.
+
+RUN: llvm-dis start.4.*.native.o.thinlto.bc -o - | \
+RUN: FileCheck %s --
[llvm-branch-commits] [clang] release/21.x: [Clang] Don't allow implicit this access when checking function constraints (PR #152073)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/152073 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] release/21.x: [TailDup] Delay aggressive computed-goto taildup to after RegAlloc. (#150911) (PR #151680)
tru wrote: I will wait with merging this until we have confirmation that we are good in that other ticket. https://github.com/llvm/llvm-project/pull/151680 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [Clang] Don't allow implicit this access when checking function constraints (PR #152073)
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/152073
>From 7ee100ccedcc52495179b8ac954f791312f1b9d1 Mon Sep 17 00:00:00 2001
From: Younan Zhang
Date: Wed, 30 Jul 2025 14:07:06 +0800
Subject: [PATCH] [Clang] Don't allow implicit this access when checking
function constraints (#151276)
We allowed implicit this access when checking associated constraints
after CWG2369. As a result, some of the invalid function call
expressions were not properly SFINAE'ed out and ended up as hard errors
at evaluation time.
We tried fixing that by mucking around the CurContext, but that spawned
additional breakages and I think it's probably safe to revert to the
previous behavior to avoid churns.
Though there is CWG2589, which justifies the previous change, it's not
what we're pursuing now.
Fixes https://github.com/llvm/llvm-project/issues/151271
Fixes https://github.com/llvm/llvm-project/issues/145505
---
clang/docs/ReleaseNotes.rst | 1 -
clang/lib/Sema/SemaConcept.cpp | 4
clang/lib/Sema/SemaTemplate.cpp | 2 --
clang/test/SemaTemplate/concepts.cpp | 34 ++--
4 files changed, 17 insertions(+), 24 deletions(-)
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 32794cbb4a1ba..1c6e7fc1c0760 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -953,7 +953,6 @@ Bug Fixes to C++ Support
- Fixed an access checking bug when initializing non-aggregates in default
arguments (#GH62444), (#GH83608)
- Fixed a pack substitution bug in deducing class template partial
specializations. (#GH53609)
- Fixed a crash when constant evaluating some explicit object member
assignment operators. (#GH142835)
-- Fixed an access checking bug when substituting into concepts (#GH115838)
- Fix a bug where private access specifier of overloaded function not
respected. (#GH107629)
- Correctly handles calling an explicit object member function template
overload set
through its address (``(&Foo::bar)()``).
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 834417f8e15ac..20567a6d9d1a8 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1097,10 +1097,6 @@ static bool CheckFunctionConstraintsWithoutInstantiation(
}
Sema::ContextRAII SavedContext(SemaRef, FD);
- std::optional ThisScope;
- if (auto *Method = dyn_cast(FD))
-ThisScope.emplace(SemaRef, /*Record=*/Method->getParent(),
- /*ThisQuals=*/Method->getMethodQualifiers());
return SemaRef.CheckConstraintSatisfaction(
Template, TemplateAC, MLTAL, PointOfInstantiation, Satisfaction);
}
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index b76619fc50268..f067aedf1cc9f 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -4749,8 +4749,6 @@ Sema::CheckConceptTemplateId(const CXXScopeSpec &SS,
EnterExpressionEvaluationContext EECtx{
*this, ExpressionEvaluationContext::Unevaluated, CSD};
- ContextRAII CurContext(*this, CSD->getDeclContext(),
- /*NewThisContext=*/false);
if (!AreArgsDependent &&
CheckConstraintSatisfaction(
NamedConcept,
AssociatedConstraint(NamedConcept->getConstraintExpr()),
diff --git a/clang/test/SemaTemplate/concepts.cpp
b/clang/test/SemaTemplate/concepts.cpp
index 62a4f95d79c74..6d6052791507d 100644
--- a/clang/test/SemaTemplate/concepts.cpp
+++ b/clang/test/SemaTemplate/concepts.cpp
@@ -1228,25 +1228,25 @@ template struct KnownType {
}
-namespace GH115838 {
+namespace CWG2369_Regression_2 {
-template concept has_x = requires(T t) {{ t.x };};
-
-class Publ { public:int x = 0; };
-class Priv { private: int x = 0; };
-class Prot { protected: int x = 0; };
-class Same { protected: int x = 0; };
-
-template class D;
-template requires ( has_x) class D: public T { public:
static constexpr bool has = 1; };
-template requires (!has_x) class D: public T { public:
static constexpr bool has = 0; };
+template
+concept HasFastPropertyForAttribute =
+requires(T element, int name) { element.propertyForAttribute(name); };
+
+template
+struct SVGPropertyOwnerRegistry {
+ static int fastAnimatedPropertyLookup() {
+static_assert (HasFastPropertyForAttribute);
+return 1;
+ }
+};
-// "Same" is identical to "Prot" but queried before used.
-static_assert(!has_x, "Protected should be invisible.");
-static_assert(!D::has, "Protected should be invisible.");
+class SVGCircleElement {
+ friend SVGPropertyOwnerRegistry;
+ void propertyForAttribute(int);
+};
-static_assert( D::has, "Public should be visible.");
-static_assert(!D::has, "Private should be invisible.");
-static_assert(!D::has, "Protected should be invisible.");
+int i =
SVGPropertyOwnerRegistry::fastAnimatedPropertyLookup();
}
___
llvm-branch-commits mailing list
[email protected].
[llvm-branch-commits] [clang] 7ee100c - [Clang] Don't allow implicit this access when checking function constraints (#151276)
Author: Younan Zhang
Date: 2025-08-05T10:59:43+02:00
New Revision: 7ee100ccedcc52495179b8ac954f791312f1b9d1
URL:
https://github.com/llvm/llvm-project/commit/7ee100ccedcc52495179b8ac954f791312f1b9d1
DIFF:
https://github.com/llvm/llvm-project/commit/7ee100ccedcc52495179b8ac954f791312f1b9d1.diff
LOG: [Clang] Don't allow implicit this access when checking function
constraints (#151276)
We allowed implicit this access when checking associated constraints
after CWG2369. As a result, some of the invalid function call
expressions were not properly SFINAE'ed out and ended up as hard errors
at evaluation time.
We tried fixing that by mucking around the CurContext, but that spawned
additional breakages and I think it's probably safe to revert to the
previous behavior to avoid churns.
Though there is CWG2589, which justifies the previous change, it's not
what we're pursuing now.
Fixes https://github.com/llvm/llvm-project/issues/151271
Fixes https://github.com/llvm/llvm-project/issues/145505
Added:
Modified:
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaConcept.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/test/SemaTemplate/concepts.cpp
Removed:
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 32794cbb4a1ba..1c6e7fc1c0760 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -953,7 +953,6 @@ Bug Fixes to C++ Support
- Fixed an access checking bug when initializing non-aggregates in default
arguments (#GH62444), (#GH83608)
- Fixed a pack substitution bug in deducing class template partial
specializations. (#GH53609)
- Fixed a crash when constant evaluating some explicit object member
assignment operators. (#GH142835)
-- Fixed an access checking bug when substituting into concepts (#GH115838)
- Fix a bug where private access specifier of overloaded function not
respected. (#GH107629)
- Correctly handles calling an explicit object member function template
overload set
through its address (``(&Foo::bar)()``).
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 834417f8e15ac..20567a6d9d1a8 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1097,10 +1097,6 @@ static bool CheckFunctionConstraintsWithoutInstantiation(
}
Sema::ContextRAII SavedContext(SemaRef, FD);
- std::optional ThisScope;
- if (auto *Method = dyn_cast(FD))
-ThisScope.emplace(SemaRef, /*Record=*/Method->getParent(),
- /*ThisQuals=*/Method->getMethodQualifiers());
return SemaRef.CheckConstraintSatisfaction(
Template, TemplateAC, MLTAL, PointOfInstantiation, Satisfaction);
}
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index b76619fc50268..f067aedf1cc9f 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -4749,8 +4749,6 @@ Sema::CheckConceptTemplateId(const CXXScopeSpec &SS,
EnterExpressionEvaluationContext EECtx{
*this, ExpressionEvaluationContext::Unevaluated, CSD};
- ContextRAII CurContext(*this, CSD->getDeclContext(),
- /*NewThisContext=*/false);
if (!AreArgsDependent &&
CheckConstraintSatisfaction(
NamedConcept,
AssociatedConstraint(NamedConcept->getConstraintExpr()),
diff --git a/clang/test/SemaTemplate/concepts.cpp
b/clang/test/SemaTemplate/concepts.cpp
index 62a4f95d79c74..6d6052791507d 100644
--- a/clang/test/SemaTemplate/concepts.cpp
+++ b/clang/test/SemaTemplate/concepts.cpp
@@ -1228,25 +1228,25 @@ template struct KnownType {
}
-namespace GH115838 {
+namespace CWG2369_Regression_2 {
-template concept has_x = requires(T t) {{ t.x };};
-
-class Publ { public:int x = 0; };
-class Priv { private: int x = 0; };
-class Prot { protected: int x = 0; };
-class Same { protected: int x = 0; };
-
-template class D;
-template requires ( has_x) class D: public T { public:
static constexpr bool has = 1; };
-template requires (!has_x) class D: public T { public:
static constexpr bool has = 0; };
+template
+concept HasFastPropertyForAttribute =
+requires(T element, int name) { element.propertyForAttribute(name); };
+
+template
+struct SVGPropertyOwnerRegistry {
+ static int fastAnimatedPropertyLookup() {
+static_assert (HasFastPropertyForAttribute);
+return 1;
+ }
+};
-// "Same" is identical to "Prot" but queried before used.
-static_assert(!has_x, "Protected should be invisible.");
-static_assert(!D::has, "Protected should be invisible.");
+class SVGCircleElement {
+ friend SVGPropertyOwnerRegistry;
+ void propertyForAttribute(int);
+};
-static_assert( D::has, "Public should be visible.");
-static_assert(!D::has, "Private should be invisible.");
-static_assert(!D::has, "Protected should be invisible.");
+int i =
SVGPropertyOwnerRegistry::fastAnimatedPropertyLookup();
}
___
[llvm-branch-commits] [clang] 6419104 - [LifetimeSafety] Add language option for experimental lifetime safety (#149592)
Author: Utkarsh Saxena
Date: 2025-08-05T10:59:05+02:00
New Revision: 6419104d187807eafc61ae7dfda55b4101e8fd6f
URL:
https://github.com/llvm/llvm-project/commit/6419104d187807eafc61ae7dfda55b4101e8fd6f
DIFF:
https://github.com/llvm/llvm-project/commit/6419104d187807eafc61ae7dfda55b4101e8fd6f.diff
LOG: [LifetimeSafety] Add language option for experimental lifetime safety
(#149592)
Add a language option flag for experimental lifetime safety analysis in C++.
This change provides a language option to control the experimental lifetime
safety analysis feature, making it more explicit and easier to enable/disable.
Previously, the feature was controlled indirectly through a diagnostic warning
flag, which we do not want to accidentally enable with `-Weverything` (atm)!
- Added a new language option `EnableLifetimeSafety` in `LangOptions.def` for
experimental lifetime safety analysis in C++
- Added corresponding driver options `-fexperimental-lifetime-safety` and
`-fno-experimental-lifetime-safety` in `Options.td`
- Modified `AnalysisBasedWarnings.cpp` to use the new language option flag
instead of checking if a specific diagnostic is ignored
- Updated a test case to use the new flag instead of relying on the warning
flag alone
(cherry picked from commit 0d0478903474b2e53c874427e3d6eb2ed7567e50)
Added:
Modified:
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Driver/Options.td
clang/lib/Sema/AnalysisBasedWarnings.cpp
clang/test/Sema/warn-lifetime-safety-dataflow.cpp
Removed:
diff --git a/clang/include/clang/Basic/LangOptions.def
b/clang/include/clang/Basic/LangOptions.def
index 0d546cb3b8471..f5a5d84eefb80 100644
--- a/clang/include/clang/Basic/LangOptions.def
+++ b/clang/include/clang/Basic/LangOptions.def
@@ -496,6 +496,8 @@ LANGOPT(CheckConstexprFunctionBodies, 1, 1, Benign,
LANGOPT(BoundsSafety, 1, 0, NotCompatible, "Bounds safety extension for C")
+LANGOPT(EnableLifetimeSafety, 1, 0, NotCompatible, "Experimental lifetime
safety analysis for C++")
+
LANGOPT(PreserveVec3Type, 1, 0, NotCompatible, "Preserve 3-component vector
type")
#undef LANGOPT
diff --git a/clang/include/clang/Driver/Options.td
b/clang/include/clang/Driver/Options.td
index bce29a76f3ac7..18e4ab406ce4e 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -1917,6 +1917,14 @@ defm bounds_safety : BoolFOption<
BothFlags<[], [CC1Option],
" experimental bounds safety extension for C">>;
+defm lifetime_safety : BoolFOption<
+ "experimental-lifetime-safety",
+ LangOpts<"EnableLifetimeSafety">, DefaultFalse,
+ PosFlag,
+ NegFlag,
+ BothFlags<[], [CC1Option],
+ " experimental lifetime safety for C++">>;
+
defm addrsig : BoolFOption<"addrsig",
CodeGenOpts<"Addrsig">, DefaultFalse,
PosFlag,
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp
b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index 85ac3c06ec2c2..ec39bca6039f0 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -2891,8 +2891,7 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
.setAlwaysAdd(Stmt::UnaryOperatorClass);
}
- bool EnableLifetimeSafetyAnalysis = !Diags.isIgnored(
- diag::warn_experimental_lifetime_safety_dummy_warning, D->getBeginLoc());
+ bool EnableLifetimeSafetyAnalysis = S.getLangOpts().EnableLifetimeSafety;
// Install the logical handler.
std::optional LEH;
if (LogicalErrorHandler::hasActiveDiagnostics(Diags, D->getBeginLoc())) {
diff --git a/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
b/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
index 38dfdb98f08fc..a956386ae9332 100644
--- a/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
+++ b/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -mllvm -debug-only=LifetimeFacts,LifetimeDataflow
-Wexperimental-lifetime-safety %s 2>&1 | FileCheck %s
+// RUN: %clang_cc1 -fexperimental-lifetime-safety -mllvm
-debug-only=LifetimeFacts,LifetimeDataflow -Wexperimental-lifetime-safety %s
2>&1 | FileCheck %s
// REQUIRES: asserts
struct MyObj {
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [libcxx] release/21.x: Revert "[libc++][Clang] Added explanation why is_constructible evaluated to false. Updated the diagnostics checks in libc++ tests. (#144220)" (PR #
cor3ntin wrote: @tru I just made a less disruptive fix https://github.com/llvm/llvm-project/pull/152105 https://github.com/llvm/llvm-project/pull/151695 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [C] static_assert in a for loop is not an extension (#151955) (PR #151999)
https://github.com/tru closed https://github.com/llvm/llvm-project/pull/151999 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [Clang] Don't allow implicit this access when checking function constraints (PR #152073)
github-actions[bot] wrote: @zyn0217 (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/152073 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] release/21.x: [clang-format] Google Style: disable DerivePointerAlignment. (#149602) (PR #151797)
github-actions[bot] wrote: @owenca (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR. https://github.com/llvm/llvm-project/pull/151797 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [libcxx] release/21.x: Revert "[libc++][Clang] Added explanation why is_constructible evaluated to false. Updated the diagnostics checks in libc++ tests. (#144220)" (PR #
tru wrote: Reading your comment @cor3ntin, it seems like we shouldn't merge this just yet? Can we get confirmation on how to handle this backport from both the clang and the libc++ side? https://github.com/llvm/llvm-project/pull/151695 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] ARM: Move more aeabi libcall config into tablegen (PR #152109)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/152109
>From dba5c476a03de8f14cc2de3adad150c6eb5f951b Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Tue, 5 Aug 2025 10:55:11 +0900
Subject: [PATCH] ARM: Move more aeabi libcall config into tablegen
---
llvm/include/llvm/IR/RuntimeLibcalls.h| 12 +-
llvm/include/llvm/IR/RuntimeLibcalls.td | 98 +-
.../llvm/TargetParser/ARMTargetParser.h | 6 +-
llvm/lib/IR/RuntimeLibcalls.cpp | 45 +--
llvm/lib/Target/ARM/ARMISelLowering.cpp | 120 --
.../RuntimeLibcallEmitter-calling-conv.td | 2 +-
llvm/test/TableGen/RuntimeLibcallEmitter.td | 2 +-
.../TableGen/Basic/RuntimeLibcallsEmitter.cpp | 3 +-
8 files changed, 119 insertions(+), 169 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index f39e2e3c26900..35cc49b0ee81c 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -182,6 +182,14 @@ struct RuntimeLibcallsInfo {
return true;
}
+ static bool isTargetAEABI(const Triple &TT) {
+return TT.isTargetAEABI() || TT.isTargetGNUAEABI() ||
+ TT.isTargetMuslAEABI() || TT.isAndroid();
+ }
+
+ LLVM_READONLY
+ static bool isAAPCS_ABI(const Triple &TT, StringRef ABIName);
+
static bool darwinHasExp10(const Triple &TT);
/// Return true if the target has sincosf/sincos/sincosl functions
@@ -195,8 +203,8 @@ struct RuntimeLibcallsInfo {
}
/// Generated by tablegen.
- void setTargetRuntimeLibcallSets(const Triple &TT,
- FloatABI::ABIType FloatABI);
+ void setTargetRuntimeLibcallSets(const Triple &TT, FloatABI::ABIType
FloatABI,
+ EABI ABIType, StringRef ABIName);
/// Set default libcall names. If a target wants to opt-out of a libcall it
/// should be placed here.
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td
b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 4905c8a420dcc..6c305f6936739 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -1482,8 +1482,99 @@ def WindowARMFPIntCasts : LibcallImpls<
def AEABIDivRemCalls : LibcallImpls<
(add __aeabi_idivmod, __aeabi_ldivmod,
__aeabi_uidivmod, __aeabi_uldivmod),
- RuntimeLibcallPredicate<[{TT.isTargetAEABI() || TT.isAndroid() ||
TT.isTargetGNUAEABI() ||
-TT.isTargetMuslAEABI()}]>> {
+ RuntimeLibcallPredicate<[{isTargetAEABI(TT)}]>> {
+ let CallingConv = ARM_AAPCS;
+}
+
+def AEABICalls : LibcallImpls<
+ (add
+ // Double-precision floating-point arithmetic helper functions
+ // RTABI chapter 4.1.2, Table 2
+ __aeabi_dadd,
+ __aeabi_ddiv,
+ __aeabi_dmul,
+ __aeabi_dsub,
+
+ // Double-precision floating-point comparison helper functions
+ // RTABI chapter 4.1.2, Table 3
+ __aeabi_dcmpeq__oeq,
+ __aeabi_dcmpeq__une,
+ __aeabi_dcmplt,
+ __aeabi_dcmple,
+ __aeabi_dcmpge,
+ __aeabi_dcmpgt,
+ __aeabi_dcmpun,
+
+ // Single-precision floating-point arithmetic helper functions
+ // RTABI chapter 4.1.2, Table 4
+ __aeabi_fadd,
+ __aeabi_fdiv,
+ __aeabi_fmul,
+ __aeabi_fsub,
+
+ // Single-precision floating-point comparison helper functions
+ // RTABI chapter 4.1.2, Table 5
+ __aeabi_fcmpeq__oeq,
+ __aeabi_fcmpeq__une,
+ __aeabi_fcmplt,
+ __aeabi_fcmple,
+ __aeabi_fcmpge,
+ __aeabi_fcmpgt,
+ __aeabi_fcmpun,
+
+ // Floating-point to integer conversions.
+ // RTABI chapter 4.1.2, Table 6
+ __aeabi_d2iz,
+ __aeabi_d2uiz,
+ __aeabi_d2lz,
+ __aeabi_d2ulz,
+ __aeabi_f2iz,
+ __aeabi_f2uiz,
+ __aeabi_f2lz,
+ __aeabi_f2ulz,
+
+ // Conversions between floating types.
+ // RTABI chapter 4.1.2, Table 7
+ __aeabi_d2f,
+ __aeabi_d2h,
+ __aeabi_f2d,
+
+ // Integer to floating-point conversions.
+ // RTABI chapter 4.1.2, Table 8
+ __aeabi_i2d,
+ __aeabi_ui2d,
+ __aeabi_l2d,
+ __aeabi_ul2d,
+ __aeabi_i2f,
+ __aeabi_ui2f,
+ __aeabi_l2f,
+ __aeabi_ul2f,
+
+ // Long long helper functions
+ // RTABI chapter 4.2, Table 9
+ __aeabi_lmul,
+ __aeabi_llsl,
+ __aeabi_llsr,
+ __aeabi_lasr,
+
+ // Integer division functions
+ // RTABI chapter 4.3.1
+ __aeabi_idiv,
+ __aeabi_uidiv),
+ RuntimeLibcallPredicate<[{isTargetAEABI(TT) && isAAPCS_ABI(TT, ABIName)}]>> {
+ let CallingConv = ARM_AAPCS;
+}
+
+// EABI dependent RTLIB, Memory operations
+// RTABI chapter 4.3.4
+def AEABI45MemCalls : LibcallImpls<
+ (add __aeabi_memcpy, __aeabi_memcpy4, __aeabi_memcpy8,
+ __aeabi_memmove, __aeabi_memmove4, __aeabi_memmove8,
+ __aeabi_memset, __aeabi_memset4, __aeabi_memset8,
+ __aeabi_memclr, __aeabi_memclr4, __aeabi_memclr8),
+ R
[llvm-branch-commits] [lld] release/21.x: [Test] Adjust quoting in archive-thin.test for spaces in paths (#151707) (PR #152120)
llvmbot wrote: @bd1976bris What do you think about merging this PR to the release branch? https://github.com/llvm/llvm-project/pull/152120 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [Test] Adjust quoting in archive-thin.test for spaces in paths (#151707) (PR #152120)
https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/152120 Backport 73ce0aca72348a80dc2c2175516a0993ab8d6be3 Requested by: @bd1976bris >From 400d8b067591d7052f04c6486d5ec533871ef29c Mon Sep 17 00:00:00 2001 From: bd1976bris Date: Fri, 1 Aug 2025 16:09:01 +0100 Subject: [PATCH] [Test] Adjust quoting in archive-thin.test for spaces in paths (#151707) As suggested in review (see: #149425), I believed that using single quotes was a nicer quoting scheme that correctly handled paths with spaces. Alas, build bot failures have demonstrated that this is not the case. Revert to the original quoting scheme (see: #146749). (cherry picked from commit 73ce0aca72348a80dc2c2175516a0993ab8d6be3) --- lld/test/ELF/dtlto/archive-thin.test | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/test/ELF/dtlto/archive-thin.test b/lld/test/ELF/dtlto/archive-thin.test index bcd5f138459b0..df3c2aadb06eb 100644 --- a/lld/test/ELF/dtlto/archive-thin.test +++ b/lld/test/ELF/dtlto/archive-thin.test @@ -29,9 +29,9 @@ RUN: mkdir %t/out && cd %t/out ## received JSON, pretty-prints the JSON and the supplied arguments, and then ## exits with an error. This allows FileCheck directives to verify the ## distributor inputs. -RUN: echo '%t/t1.a %t/lib/t2.a ../t3.a \ -RUN: --thinlto-distributor="%python" \ -RUN: --thinlto-distributor-arg="%llvm_src_root/utils/dtlto/validate.py"' > rsp +RUN: echo "%t/t1.a %t/lib/t2.a ../t3.a \ +RUN: --thinlto-distributor=\"%python\" \ +RUN: --thinlto-distributor-arg=\"%llvm_src_root/utils/dtlto/validate.py\"" > rsp ## Link thin archives using -u/--undefined. RUN: not ld.lld @rsp -u t1 -u t2 -u t3 2>&1 | FileCheck %s ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [Test] Adjust quoting in archive-thin.test for spaces in paths (#151707) (PR #152120)
https://github.com/llvmbot milestoned https://github.com/llvm/llvm-project/pull/152120 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] release/21.x: [Test] Adjust quoting in archive-thin.test for spaces in paths (#151707) (PR #152120)
llvmbot wrote: @llvm/pr-subscribers-lld-elf Author: None (llvmbot) Changes Backport 73ce0aca72348a80dc2c2175516a0993ab8d6be3 Requested by: @bd1976bris --- Full diff: https://github.com/llvm/llvm-project/pull/152120.diff 1 Files Affected: - (modified) lld/test/ELF/dtlto/archive-thin.test (+3-3) ``diff diff --git a/lld/test/ELF/dtlto/archive-thin.test b/lld/test/ELF/dtlto/archive-thin.test index bcd5f138459b0..df3c2aadb06eb 100644 --- a/lld/test/ELF/dtlto/archive-thin.test +++ b/lld/test/ELF/dtlto/archive-thin.test @@ -29,9 +29,9 @@ RUN: mkdir %t/out && cd %t/out ## received JSON, pretty-prints the JSON and the supplied arguments, and then ## exits with an error. This allows FileCheck directives to verify the ## distributor inputs. -RUN: echo '%t/t1.a %t/lib/t2.a ../t3.a \ -RUN: --thinlto-distributor="%python" \ -RUN: --thinlto-distributor-arg="%llvm_src_root/utils/dtlto/validate.py"' > rsp +RUN: echo "%t/t1.a %t/lib/t2.a ../t3.a \ +RUN: --thinlto-distributor=\"%python\" \ +RUN: --thinlto-distributor-arg=\"%llvm_src_root/utils/dtlto/validate.py\"" > rsp ## Link thin archives using -u/--undefined. RUN: not ld.lld @rsp -u t1 -u t2 -u t3 2>&1 | FileCheck %s `` https://github.com/llvm/llvm-project/pull/152120 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][ISel] Select constructive SVE2 ext instruction (PR #151730)
https://github.com/gbossu closed https://github.com/llvm/llvm-project/pull/151730 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AArch64][ISel] Select constructive SVE2 ext instruction (PR #151730)
gbossu wrote: Closing, I'll work on supporting `movprfx` for `ext` instead. https://github.com/llvm/llvm-project/pull/151730 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] ARM: Move more aeabi libcall config into tablegen (PR #152109)
https://github.com/arsenm updated
https://github.com/llvm/llvm-project/pull/152109
>From 027cfc35c3057f5a08b098c58a0daa734262e6d4 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Tue, 5 Aug 2025 10:55:11 +0900
Subject: [PATCH] ARM: Move more aeabi libcall config into tablegen
---
llvm/include/llvm/IR/RuntimeLibcalls.h| 12 +-
llvm/include/llvm/IR/RuntimeLibcalls.td | 98 +-
.../llvm/TargetParser/ARMTargetParser.h | 6 +-
llvm/lib/IR/RuntimeLibcalls.cpp | 45 +--
llvm/lib/Target/ARM/ARMISelLowering.cpp | 120 --
.../RuntimeLibcallEmitter-calling-conv.td | 2 +-
llvm/test/TableGen/RuntimeLibcallEmitter.td | 2 +-
.../TableGen/Basic/RuntimeLibcallsEmitter.cpp | 3 +-
8 files changed, 119 insertions(+), 169 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index f39e2e3c26900..2d1d07c5fd81b 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -182,6 +182,14 @@ struct RuntimeLibcallsInfo {
return true;
}
+ static bool hasAEABILibcalls(const Triple &TT) {
+return TT.isTargetAEABI() || TT.isTargetGNUAEABI() ||
+ TT.isTargetMuslAEABI() || TT.isAndroid();
+ }
+
+ LLVM_READONLY
+ static bool isAAPCS_ABI(const Triple &TT, StringRef ABIName);
+
static bool darwinHasExp10(const Triple &TT);
/// Return true if the target has sincosf/sincos/sincosl functions
@@ -195,8 +203,8 @@ struct RuntimeLibcallsInfo {
}
/// Generated by tablegen.
- void setTargetRuntimeLibcallSets(const Triple &TT,
- FloatABI::ABIType FloatABI);
+ void setTargetRuntimeLibcallSets(const Triple &TT, FloatABI::ABIType
FloatABI,
+ EABI ABIType, StringRef ABIName);
/// Set default libcall names. If a target wants to opt-out of a libcall it
/// should be placed here.
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td
b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 5d1015e585e47..a561036aa0d91 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -1485,8 +1485,99 @@ def WindowARMFPIntCasts : LibcallImpls<
def AEABIDivRemCalls : LibcallImpls<
(add __aeabi_idivmod, __aeabi_ldivmod,
__aeabi_uidivmod, __aeabi_uldivmod),
- RuntimeLibcallPredicate<[{TT.isTargetAEABI() || TT.isAndroid() ||
TT.isTargetGNUAEABI() ||
-TT.isTargetMuslAEABI()}]>> {
+ RuntimeLibcallPredicate<[{hasAEABILibcalls(TT)}]>> {
+ let CallingConv = ARM_AAPCS;
+}
+
+def AEABICalls : LibcallImpls<
+ (add
+ // Double-precision floating-point arithmetic helper functions
+ // RTABI chapter 4.1.2, Table 2
+ __aeabi_dadd,
+ __aeabi_ddiv,
+ __aeabi_dmul,
+ __aeabi_dsub,
+
+ // Double-precision floating-point comparison helper functions
+ // RTABI chapter 4.1.2, Table 3
+ __aeabi_dcmpeq__oeq,
+ __aeabi_dcmpeq__une,
+ __aeabi_dcmplt,
+ __aeabi_dcmple,
+ __aeabi_dcmpge,
+ __aeabi_dcmpgt,
+ __aeabi_dcmpun,
+
+ // Single-precision floating-point arithmetic helper functions
+ // RTABI chapter 4.1.2, Table 4
+ __aeabi_fadd,
+ __aeabi_fdiv,
+ __aeabi_fmul,
+ __aeabi_fsub,
+
+ // Single-precision floating-point comparison helper functions
+ // RTABI chapter 4.1.2, Table 5
+ __aeabi_fcmpeq__oeq,
+ __aeabi_fcmpeq__une,
+ __aeabi_fcmplt,
+ __aeabi_fcmple,
+ __aeabi_fcmpge,
+ __aeabi_fcmpgt,
+ __aeabi_fcmpun,
+
+ // Floating-point to integer conversions.
+ // RTABI chapter 4.1.2, Table 6
+ __aeabi_d2iz,
+ __aeabi_d2uiz,
+ __aeabi_d2lz,
+ __aeabi_d2ulz,
+ __aeabi_f2iz,
+ __aeabi_f2uiz,
+ __aeabi_f2lz,
+ __aeabi_f2ulz,
+
+ // Conversions between floating types.
+ // RTABI chapter 4.1.2, Table 7
+ __aeabi_d2f,
+ __aeabi_d2h,
+ __aeabi_f2d,
+
+ // Integer to floating-point conversions.
+ // RTABI chapter 4.1.2, Table 8
+ __aeabi_i2d,
+ __aeabi_ui2d,
+ __aeabi_l2d,
+ __aeabi_ul2d,
+ __aeabi_i2f,
+ __aeabi_ui2f,
+ __aeabi_l2f,
+ __aeabi_ul2f,
+
+ // Long long helper functions
+ // RTABI chapter 4.2, Table 9
+ __aeabi_lmul,
+ __aeabi_llsl,
+ __aeabi_llsr,
+ __aeabi_lasr,
+
+ // Integer division functions
+ // RTABI chapter 4.3.1
+ __aeabi_idiv,
+ __aeabi_uidiv),
+ RuntimeLibcallPredicate<[{hasAEABILibcalls(TT) && isAAPCS_ABI(TT,
ABIName)}]>> {
+ let CallingConv = ARM_AAPCS;
+}
+
+// EABI dependent RTLIB, Memory operations
+// RTABI chapter 4.3.4
+def AEABI45MemCalls : LibcallImpls<
+ (add __aeabi_memcpy, __aeabi_memcpy4, __aeabi_memcpy8,
+ __aeabi_memmove, __aeabi_memmove4, __aeabi_memmove8,
+ __aeabi_memset, __aeabi_memset4, __aeabi_memset8,
+ __aeabi_memclr, __aeabi_memclr4, __aeabi_memc
[llvm-branch-commits] [llvm] release/21.x: [Hexagon] Add nounwind to hexagon-strcpy.ll (#151293) (PR #151458)
https://github.com/androm3da approved this pull request. https://github.com/llvm/llvm-project/pull/151458 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [AMDGPU] Baseline test for ptrtoaddr in lower-buffer-fat-pointers (PR #143812)
https://github.com/arsenm approved this pull request. https://github.com/llvm/llvm-project/pull/143812 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] f5aae27 - Revert "[compiler-rt][test] Apply CFLAGS from sanitizer_common to all tests (…"
Author: gulfemsavrun
Date: 2025-08-05T10:02:21-07:00
New Revision: f5aae27909984a0747dce08e7031f843f6693103
URL:
https://github.com/llvm/llvm-project/commit/f5aae27909984a0747dce08e7031f843f6693103
DIFF:
https://github.com/llvm/llvm-project/commit/f5aae27909984a0747dce08e7031f843f6693103.diff
LOG: Revert "[compiler-rt][test] Apply CFLAGS from sanitizer_common to all
tests (…"
This reverts commit b757bc8b13b1088e2f2b1b98aa33ebb16334b59d.
Added:
Modified:
compiler-rt/cmake/config-ix.cmake
compiler-rt/test/sanitizer_common/CMakeLists.txt
Removed:
diff --git a/compiler-rt/cmake/config-ix.cmake
b/compiler-rt/cmake/config-ix.cmake
index 212a09f55b32b..e3310b1ff0e2c 100644
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -309,14 +309,6 @@ macro(get_test_cc_for_arch arch cc_out cflags_out)
endif()
string(REPLACE ";" " " ${cflags_out} "${${cflags_out}}")
endif()
- if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT ANDROID)
-# ARM on Linux might use the slow unwinder as default and the unwind table
-# is required to get a complete stacktrace.
-string(APPEND ${cflags_out} " -funwind-tables")
-if(CMAKE_SYSROOT)
- string(APPEND ${cflags_out} " --sysroot=${CMAKE_SYSROOT}")
-endif()
- endif()
endmacro()
# Returns CFLAGS that should be used to run tests for the
diff --git a/compiler-rt/test/sanitizer_common/CMakeLists.txt
b/compiler-rt/test/sanitizer_common/CMakeLists.txt
index b044b9c6c3e08..61576f57a 100644
--- a/compiler-rt/test/sanitizer_common/CMakeLists.txt
+++ b/compiler-rt/test/sanitizer_common/CMakeLists.txt
@@ -73,6 +73,17 @@ foreach(tool ${SUPPORTED_TOOLS})
get_test_cc_for_arch(${arch} SANITIZER_COMMON_TEST_TARGET_CC
SANITIZER_COMMON_TEST_TARGET_CFLAGS)
set(CONFIG_NAME ${tool}-${arch}-${OS_NAME})
+# ARM on Linux might use the slow unwinder as default and the unwind table
is
+# required to get a complete stacktrace.
+if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID)
+ list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS -funwind-tables)
+ if(CMAKE_SYSROOT)
+list(APPEND SANITIZER_COMMON_TEST_TARGET_CFLAGS
"--sysroot=${CMAKE_SYSROOT}")
+ endif()
+ string(REPLACE ";" " " SANITIZER_COMMON_TEST_TARGET_CFLAGS
+ "${SANITIZER_COMMON_TEST_TARGET_CFLAGS}")
+endif()
+
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py)
___
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [lldb] [PATCH 7/7] [clang] improve NestedNameSpecifier: LLDB changes (PR #149949)
https://github.com/mizvekov updated
https://github.com/llvm/llvm-project/pull/149949
>From 552fc80db7be58372f489cff1d7764894dad0649 Mon Sep 17 00:00:00 2001
From: Matheus Izvekov
Date: Mon, 21 Jul 2025 22:00:01 -0300
Subject: [PATCH] [PATCH 7/7] [clang] improve NestedNameSpecifier: LLDB changes
Patch series starting at https://github.com/llvm/llvm-project/pull/147835
---
clang/include/clang/AST/DeclBase.h| 6 +
clang/include/clang/AST/QualTypeNames.h | 10 +
clang/lib/AST/QualTypeNames.cpp | 7 +
.../Clang/ClangASTImporter.cpp| 37 ++-
.../ExpressionParser/Clang/ClangASTSource.cpp | 5 +-
.../Clang/ClangExpressionDeclMap.cpp | 4 +-
.../Clang/ClangPersistentVariables.cpp| 6 +-
.../Clang/NameSearchContext.cpp | 2 +-
.../Plugins/Language/ObjC/NSDictionary.cpp| 3 +-
.../RegisterTypeBuilderClang.cpp | 4 +-
.../SymbolFile/NativePDB/PdbAstBuilder.cpp| 11 +-
.../Plugins/SymbolFile/PDB/PDBASTParser.cpp | 11 +-
.../TypeSystem/Clang/TypeSystemClang.cpp | 243 +-
.../TypeSystem/Clang/TypeSystemClang.h| 9 +-
.../string/TestDataFormatterStdString.py | 3 -
.../completions/TestDAP_completions.py| 2 +-
.../DWARF/x86/dwp-foreign-type-units.cpp | 8 +-
lldb/tools/lldb-rpc-gen/lldb-rpc-gen.cpp | 5 +-
18 files changed, 193 insertions(+), 183 deletions(-)
diff --git a/clang/include/clang/AST/DeclBase.h
b/clang/include/clang/AST/DeclBase.h
index 5ac664202db6d..c6326a8ba506d 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -622,6 +622,12 @@ class alignas(8) Decl {
void setReferenced(bool R = true) { Referenced = R; }
+ /// When doing manipulations which might change the computed linkage,
+ /// such as changing the DeclContext after the declaration has already been
+ /// used, invalidating the cache will make sure its linkage will be
+ /// recomputed.
+ void invalidateCachedLinkage() { setCachedLinkage(Linkage::Invalid); }
+
/// Whether this declaration is a top-level declaration (function,
/// global variable, etc.) that is lexically inside an objc container
/// definition.
diff --git a/clang/include/clang/AST/QualTypeNames.h
b/clang/include/clang/AST/QualTypeNames.h
index daa86cda2d992..9f5cf045d1d4c 100644
--- a/clang/include/clang/AST/QualTypeNames.h
+++ b/clang/include/clang/AST/QualTypeNames.h
@@ -87,6 +87,16 @@ std::string getFullyQualifiedName(QualType QT, const
ASTContext &Ctx,
/// specifier "::" should be prepended or not.
QualType getFullyQualifiedType(QualType QT, const ASTContext &Ctx,
bool WithGlobalNsPrefix = false);
+
+/// Get the fully qualified name for the declared context of a declaration.
+///
+/// \param[in] Ctx - the ASTContext to be used.
+/// \param[in] Decl - the declaration for which to get the fully qualified
name.
+/// \param[in] WithGlobalNsPrefix - If true, then the global namespace
+/// specifier "::" will be prepended to the fully qualified name.
+NestedNameSpecifier
+getFullyQualifiedDeclaredContext(const ASTContext &Ctx, const Decl *Decl,
+ bool WithGlobalNsPrefix = false);
} // end namespace TypeName
} // end namespace clang
#endif // LLVM_CLANG_AST_QUALTYPENAMES_H
diff --git a/clang/lib/AST/QualTypeNames.cpp b/clang/lib/AST/QualTypeNames.cpp
index 4f94923fde108..ee7fec3372fcf 100644
--- a/clang/lib/AST/QualTypeNames.cpp
+++ b/clang/lib/AST/QualTypeNames.cpp
@@ -491,5 +491,12 @@ std::string getFullyQualifiedName(QualType QT,
return FQQT.getAsString(Policy);
}
+NestedNameSpecifier getFullyQualifiedDeclaredContext(const ASTContext &Ctx,
+ const Decl *Decl,
+ bool WithGlobalNsPrefix) {
+ return createNestedNameSpecifierForScopeOf(Ctx, Decl,
/*FullyQualified=*/true,
+ WithGlobalNsPrefix);
+}
+
} // end namespace TypeName
} // end namespace clang
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
index 2529e78f78bca..73f9480bc57e7 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
@@ -123,6 +123,12 @@ class DeclContextOverride {
decl->setDeclContext(decl->getASTContext().getTranslationUnitDecl());
decl->setLexicalDeclContext(decl->getASTContext().getTranslationUnitDecl());
+// Changing the DeclContext might change the linkage. For example, if the
+// function was previously declared inside a function, it will not be
+// external, but changing the declaration context to the TU will make it
+// external. Make sure this will recompute the linkage if it was computed
+// before.
+decl->invalida
[llvm-branch-commits] [clang] [lldb] [PATCH 7/7] [clang] improve NestedNameSpecifier: LLDB changes (PR #149949)
mizvekov wrote: @Michael137 this is ready for another look. https://github.com/llvm/llvm-project/pull/149949 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [PATCH 6/7] [clang] improve NestedNameSpecifier (PR #149748)
mizvekov wrote: ping, this is the only patch which is still unreviewed. https://github.com/llvm/llvm-project/pull/149748 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [PATCH 6/7] [clang] improve NestedNameSpecifier (PR #149748)
https://github.com/erichkeane approved this pull request. I did a run through this a while back and didn't see anything concerning, but getting a deep enough dive on this is unfortunately/obviously quite difficult. So for now, approve, though I can imagine these getting pulled out if they cause problems because we can't do a good enough review. https://github.com/llvm/llvm-project/pull/149748 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [lldb] [PATCH 7/7] [clang] improve NestedNameSpecifier: LLDB changes (PR #149949)
https://github.com/mizvekov updated
https://github.com/llvm/llvm-project/pull/149949
>From 4abdd2322b0336c72cf3c700710504b3ac6e0ef6 Mon Sep 17 00:00:00 2001
From: Matheus Izvekov
Date: Mon, 21 Jul 2025 22:00:01 -0300
Subject: [PATCH] [PATCH 7/7] [clang] improve NestedNameSpecifier: LLDB changes
Patch series starting at https://github.com/llvm/llvm-project/pull/147835
---
clang/include/clang/AST/DeclBase.h| 6 +
clang/include/clang/AST/QualTypeNames.h | 10 +
clang/lib/AST/QualTypeNames.cpp | 7 +
.../Clang/ClangASTImporter.cpp| 37 ++-
.../ExpressionParser/Clang/ClangASTSource.cpp | 5 +-
.../Clang/ClangExpressionDeclMap.cpp | 4 +-
.../Clang/ClangPersistentVariables.cpp| 6 +-
.../Clang/NameSearchContext.cpp | 2 +-
.../Plugins/Language/ObjC/NSDictionary.cpp| 3 +-
.../RegisterTypeBuilderClang.cpp | 4 +-
.../SymbolFile/NativePDB/PdbAstBuilder.cpp| 11 +-
.../Plugins/SymbolFile/PDB/PDBASTParser.cpp | 11 +-
.../TypeSystem/Clang/TypeSystemClang.cpp | 243 +-
.../TypeSystem/Clang/TypeSystemClang.h| 9 +-
.../string/TestDataFormatterStdString.py | 3 -
.../completions/TestDAP_completions.py| 2 +-
.../DWARF/x86/dwp-foreign-type-units.cpp | 8 +-
lldb/tools/lldb-rpc-gen/lldb-rpc-gen.cpp | 5 +-
18 files changed, 193 insertions(+), 183 deletions(-)
diff --git a/clang/include/clang/AST/DeclBase.h
b/clang/include/clang/AST/DeclBase.h
index 5ac664202db6d..c6326a8ba506d 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -622,6 +622,12 @@ class alignas(8) Decl {
void setReferenced(bool R = true) { Referenced = R; }
+ /// When doing manipulations which might change the computed linkage,
+ /// such as changing the DeclContext after the declaration has already been
+ /// used, invalidating the cache will make sure its linkage will be
+ /// recomputed.
+ void invalidateCachedLinkage() { setCachedLinkage(Linkage::Invalid); }
+
/// Whether this declaration is a top-level declaration (function,
/// global variable, etc.) that is lexically inside an objc container
/// definition.
diff --git a/clang/include/clang/AST/QualTypeNames.h
b/clang/include/clang/AST/QualTypeNames.h
index daa86cda2d992..9f5cf045d1d4c 100644
--- a/clang/include/clang/AST/QualTypeNames.h
+++ b/clang/include/clang/AST/QualTypeNames.h
@@ -87,6 +87,16 @@ std::string getFullyQualifiedName(QualType QT, const
ASTContext &Ctx,
/// specifier "::" should be prepended or not.
QualType getFullyQualifiedType(QualType QT, const ASTContext &Ctx,
bool WithGlobalNsPrefix = false);
+
+/// Get the fully qualified name for the declared context of a declaration.
+///
+/// \param[in] Ctx - the ASTContext to be used.
+/// \param[in] Decl - the declaration for which to get the fully qualified
name.
+/// \param[in] WithGlobalNsPrefix - If true, then the global namespace
+/// specifier "::" will be prepended to the fully qualified name.
+NestedNameSpecifier
+getFullyQualifiedDeclaredContext(const ASTContext &Ctx, const Decl *Decl,
+ bool WithGlobalNsPrefix = false);
} // end namespace TypeName
} // end namespace clang
#endif // LLVM_CLANG_AST_QUALTYPENAMES_H
diff --git a/clang/lib/AST/QualTypeNames.cpp b/clang/lib/AST/QualTypeNames.cpp
index 4f94923fde108..ee7fec3372fcf 100644
--- a/clang/lib/AST/QualTypeNames.cpp
+++ b/clang/lib/AST/QualTypeNames.cpp
@@ -491,5 +491,12 @@ std::string getFullyQualifiedName(QualType QT,
return FQQT.getAsString(Policy);
}
+NestedNameSpecifier getFullyQualifiedDeclaredContext(const ASTContext &Ctx,
+ const Decl *Decl,
+ bool WithGlobalNsPrefix) {
+ return createNestedNameSpecifierForScopeOf(Ctx, Decl,
/*FullyQualified=*/true,
+ WithGlobalNsPrefix);
+}
+
} // end namespace TypeName
} // end namespace clang
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
index 2529e78f78bca..624eea91b48f2 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.cpp
@@ -123,6 +123,12 @@ class DeclContextOverride {
decl->setDeclContext(decl->getASTContext().getTranslationUnitDecl());
decl->setLexicalDeclContext(decl->getASTContext().getTranslationUnitDecl());
+// Changing the DeclContext might change the linkage. For example, if the
+// entity was previously declared inside a function, it will not be
+// external, but changing the declaration context to the TU will make it
+// external. Make sure this will recompute the linkage if it was computed
+// before.
+decl->invalidate
[llvm-branch-commits] [llvm] [AMDGPU][UnifyDivergentExitNodes][StructurizeCFG] Add support for callbr instruction with basic inline-asm (PR #152161)
@@ -16476,12 +16476,12 @@ SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI_, const TargetRegisterClass *RC = nullptr; ro-i wrote: No, this is actually important to support the asm label constraint "!i". This should fall through to the default case (imho) without causing `VT.getSizeInBits()` to crash. https://github.com/llvm/llvm-project/pull/152161 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AMDGPU][UnifyDivergentExitNodes][StructurizeCFG] Add support for callbr instruction with basic inline-asm (PR #152161)
ro-i wrote: > StructurizeCFG is very sensitive to changes. Could you do a full CQE cycles > for this? Will be done after the reviews before the merge 👍 https://github.com/llvm/llvm-project/pull/152161 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [AMDGPU][UnifyDivergentExitNodes][StructurizeCFG] Add support for callbr instruction with basic inline-asm (PR #152161)
https://github.com/ro-i updated https://github.com/llvm/llvm-project/pull/152161
>From 47408c30af9b0dd6b4c791130aad4a91efee8949 Mon Sep 17 00:00:00 2001
From: Robert Imschweiler
Date: Tue, 5 Aug 2025 10:24:07 -0500
Subject: [PATCH 1/2] [AMDGPU][UnifyDivergentExitNodes][StructurizeCFG] Add
support for callbr instruction with basic inline-asm
Finishes adding basic inline-asm callbr support for AMDGPU, started by
https://github.com/llvm/llvm-project/pull/149308.
---
.../AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp | 89 +++---
llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 10 +-
llvm/lib/Transforms/Scalar/StructurizeCFG.cpp | 15 +-
llvm/test/CodeGen/AMDGPU/callbr.ll| 54
...nify-divergent-exit-nodes-with-musttail.ll | 51
llvm/test/CodeGen/AMDGPU/infinite-loop.ll | 258 --
.../si-annotate-nested-control-flows.ll | 100 ++-
.../si-unify-exit-multiple-unreachables.ll| 161 ++-
llvm/test/CodeGen/AMDGPU/update-phi.ll| 39 +++
llvm/test/Transforms/StructurizeCFG/callbr.ll | 56
10 files changed, 751 insertions(+), 82 deletions(-)
create mode 100644 llvm/test/CodeGen/AMDGPU/callbr.ll
create mode 100644 llvm/test/Transforms/StructurizeCFG/callbr.ll
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
b/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
index 733c5d520fb23..2df6bbc74f6da 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
@@ -181,14 +181,52 @@ BasicBlock
*AMDGPUUnifyDivergentExitNodesImpl::unifyReturnBlockSet(
return NewRetBlock;
}
+static BasicBlock *
+createDummyReturnBlock(Function &F,
+ SmallVector &ReturningBlocks) {
+ BasicBlock *DummyReturnBB =
+ BasicBlock::Create(F.getContext(), "DummyReturnBlock", &F);
+ Type *RetTy = F.getReturnType();
+ Value *RetVal = RetTy->isVoidTy() ? nullptr : PoisonValue::get(RetTy);
+ ReturnInst::Create(F.getContext(), RetVal, DummyReturnBB);
+ ReturningBlocks.push_back(DummyReturnBB);
+ return DummyReturnBB;
+}
+
+/// Handle conditional branch instructions (-> 2 targets) and callbr
+/// instructions with N targets.
+static void handleNBranch(Function &F, BasicBlock *BB, Instruction *BI,
+ BasicBlock *DummyReturnBB,
+ std::vector &Updates) {
+ SmallVector Successors(successors(BB));
+
+ // Create a new transition block to hold the conditional branch.
+ BasicBlock *TransitionBB = BB->splitBasicBlock(BI, "TransitionBlock");
+
+ Updates.reserve(Updates.size() + 2 * Successors.size() + 2);
+
+ // 'Successors' become successors of TransitionBB instead of BB,
+ // and TransitionBB becomes a single successor of BB.
+ Updates.emplace_back(DominatorTree::Insert, BB, TransitionBB);
+ for (BasicBlock *Successor : Successors) {
+Updates.emplace_back(DominatorTree::Insert, TransitionBB, Successor);
+Updates.emplace_back(DominatorTree::Delete, BB, Successor);
+ }
+
+ // Create a branch that will always branch to the transition block and
+ // references DummyReturnBB.
+ BB->getTerminator()->eraseFromParent();
+ BranchInst::Create(TransitionBB, DummyReturnBB,
+ ConstantInt::getTrue(F.getContext()), BB);
+ Updates.emplace_back(DominatorTree::Insert, BB, DummyReturnBB);
+}
+
bool AMDGPUUnifyDivergentExitNodesImpl::run(Function &F, DominatorTree *DT,
const PostDominatorTree &PDT,
const UniformityInfo &UA) {
- assert(hasOnlySimpleTerminator(F) && "Unsupported block terminator.");
-
if (PDT.root_size() == 0 ||
(PDT.root_size() == 1 &&
- !isa(PDT.getRoot()->getTerminator(
+ !isa(PDT.getRoot()->getTerminator(
return false;
// Loop over all of the blocks in a function, tracking all of the blocks that
@@ -222,46 +260,27 @@ bool AMDGPUUnifyDivergentExitNodesImpl::run(Function &F,
DominatorTree *DT,
if (HasDivergentExitBlock)
UnreachableBlocks.push_back(BB);
} else if (BranchInst *BI = dyn_cast(BB->getTerminator())) {
-
- ConstantInt *BoolTrue = ConstantInt::getTrue(F.getContext());
- if (DummyReturnBB == nullptr) {
-DummyReturnBB = BasicBlock::Create(F.getContext(),
- "DummyReturnBlock", &F);
-Type *RetTy = F.getReturnType();
-Value *RetVal = RetTy->isVoidTy() ? nullptr : PoisonValue::get(RetTy);
-ReturnInst::Create(F.getContext(), RetVal, DummyReturnBB);
-ReturningBlocks.push_back(DummyReturnBB);
- }
+ if (DummyReturnBB == nullptr)
+DummyReturnBB = createDummyReturnBlock(F, ReturningBlocks);
if (BI->isUnconditional()) {
BasicBlock *LoopHeaderBB = BI->getSuccessor(0);
BI->eraseFromParent(); // Delete the unconditional branch.
// Add a new conditional branch with a dummy ed
[llvm-branch-commits] [llvm] release/21.x: [llvm][sroa] Disable support for `invariant.group` (#151743) (PR #152099)
llvmbot wrote: @nikic What do you think about merging this PR to the release branch? https://github.com/llvm/llvm-project/pull/152099 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] [flang][OpenMP] Make OpenMPCriticalConstruct follow block structure (PR #152007)
@@ -34,6 +34,7 @@ #include "flang/Parser/openmp-utils.h" #include "flang/Parser/parse-tree.h" #include "flang/Semantics/openmp-directive-sets.h" +#include "flang/Semantics/openmp-utils.h" Stylie777 wrote: nit: Is this change to the header file location critical for this patch? If it is not, could we do this in a separate PR? Otherwise, please ignore this comment. https://github.com/llvm/llvm-project/pull/152007 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] [flang][OpenMP] Make OpenMPCriticalConstruct follow block structure (PR #152007)
https://github.com/Stylie777 edited https://github.com/llvm/llvm-project/pull/152007 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] ARM: Move more aeabi libcall config into tablegen (PR #152109)
https://github.com/arsenm created
https://github.com/llvm/llvm-project/pull/152109
None
>From 9b024d1269c7ead25af2961655cca373829300c4 Mon Sep 17 00:00:00 2001
From: Matt Arsenault
Date: Tue, 5 Aug 2025 10:55:11 +0900
Subject: [PATCH] ARM: Move more aeabi libcall config into tablegen
---
llvm/include/llvm/IR/RuntimeLibcalls.h| 12 +-
llvm/include/llvm/IR/RuntimeLibcalls.td | 98 +-
.../llvm/TargetParser/ARMTargetParser.h | 6 +-
llvm/lib/IR/RuntimeLibcalls.cpp | 45 +--
llvm/lib/Target/ARM/ARMISelLowering.cpp | 120 --
.../RuntimeLibcallEmitter-calling-conv.td | 2 +-
llvm/test/TableGen/RuntimeLibcallEmitter.td | 2 +-
.../TableGen/Basic/RuntimeLibcallsEmitter.cpp | 3 +-
8 files changed, 119 insertions(+), 169 deletions(-)
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index f39e2e3c26900..35cc49b0ee81c 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -182,6 +182,14 @@ struct RuntimeLibcallsInfo {
return true;
}
+ static bool isTargetAEABI(const Triple &TT) {
+return TT.isTargetAEABI() || TT.isTargetGNUAEABI() ||
+ TT.isTargetMuslAEABI() || TT.isAndroid();
+ }
+
+ LLVM_READONLY
+ static bool isAAPCS_ABI(const Triple &TT, StringRef ABIName);
+
static bool darwinHasExp10(const Triple &TT);
/// Return true if the target has sincosf/sincos/sincosl functions
@@ -195,8 +203,8 @@ struct RuntimeLibcallsInfo {
}
/// Generated by tablegen.
- void setTargetRuntimeLibcallSets(const Triple &TT,
- FloatABI::ABIType FloatABI);
+ void setTargetRuntimeLibcallSets(const Triple &TT, FloatABI::ABIType
FloatABI,
+ EABI ABIType, StringRef ABIName);
/// Set default libcall names. If a target wants to opt-out of a libcall it
/// should be placed here.
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td
b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 4905c8a420dcc..6cefb54b79d5c 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -1482,8 +1482,99 @@ def WindowARMFPIntCasts : LibcallImpls<
def AEABIDivRemCalls : LibcallImpls<
(add __aeabi_idivmod, __aeabi_ldivmod,
__aeabi_uidivmod, __aeabi_uldivmod),
- RuntimeLibcallPredicate<[{TT.isTargetAEABI() || TT.isAndroid() ||
TT.isTargetGNUAEABI() ||
-TT.isTargetMuslAEABI()}]>> {
+ RuntimeLibcallPredicate<[{isTargetAEABI(TT)}]>> {
+ let CallingConv = ARM_AAPCS;
+}
+
+def AEABICalls : LibcallImpls<
+ (add
+ // Double-precision floating-point arithmetic helper functions
+ // RTABI chapter 4.1.2, Table 2
+ __aeabi_dadd,
+ __aeabi_ddiv,
+ __aeabi_dmul,
+ __aeabi_dsub,
+
+ // Double-precision floating-point comparison helper functions
+ // RTABI chapter 4.1.2, Table 3
+ __aeabi_dcmpeq__oeq,
+ __aeabi_dcmpeq__une,
+ __aeabi_dcmplt,
+ __aeabi_dcmple,
+ __aeabi_dcmpge,
+ __aeabi_dcmpgt,
+ __aeabi_dcmpun,
+
+ // Single-precision floating-point arithmetic helper functions
+ // RTABI chapter 4.1.2, Table 4
+ __aeabi_fadd,
+ __aeabi_fdiv,
+ __aeabi_fmul,
+ __aeabi_fsub,
+
+ // Single-precision floating-point comparison helper functions
+ // RTABI chapter 4.1.2, Table 5
+ __aeabi_fcmpeq__oeq,
+ __aeabi_fcmpeq__une,
+ __aeabi_fcmplt,
+ __aeabi_fcmple,
+ __aeabi_fcmpge,
+ __aeabi_fcmpgt,
+ __aeabi_fcmpun,
+
+ // Floating-point to integer conversions.
+ // RTABI chapter 4.1.2, Table 6
+ __aeabi_d2iz,
+ __aeabi_d2uiz,
+ __aeabi_d2lz,
+ __aeabi_d2ulz,
+ __aeabi_f2iz,
+ __aeabi_f2uiz,
+ __aeabi_f2lz,
+ __aeabi_f2ulz,
+
+ // Conversions between floating types.
+ // RTABI chapter 4.1.2, Table 7
+ __aeabi_d2f,
+ __aeabi_d2h,
+ __aeabi_f2d,
+
+ // Integer to floating-point conversions.
+ // RTABI chapter 4.1.2, Table 8
+ __aeabi_i2d,
+ __aeabi_ui2d,
+ __aeabi_l2d,
+ __aeabi_ul2d,
+ __aeabi_i2f,
+ __aeabi_ui2f,
+ __aeabi_l2f,
+ __aeabi_ul2f,
+
+ // Long long helper functions
+ // RTABI chapter 4.2, Table 9
+ __aeabi_lmul,
+ __aeabi_llsl,
+ __aeabi_llsr,
+ __aeabi_lasr,
+
+ // Integer division functions
+ // RTABI chapter 4.3.1
+ __aeabi_idiv,
+ __aeabi_uidiv),
+ RuntimeLibcallPredicate<[{isTargetAEABI(TT) && isAAPCS_ABI(TT, ABIName)}]>> {
+ let CallingConv = ARM_AAPCS;
+}
+
+// EABI dependent RTLIB, Memory operations
+// RTABI chapter 4.3.4
+def AEABI44MemCalls : LibcallImpls<
+ (add __aeabi_memcpy, __aeabi_memcpy4, __aeabi_memcpy8,
+ __aeabi_memmove, __aeabi_memmove4, __aeabi_memmove8,
+ __aeabi_memset, __aeabi_memset4, __aeabi_memset8,
+ __aeabi_memclr, __aeabi_memclr4, __aeabi_memclr8)
[llvm-branch-commits] [llvm] ARM: Move more aeabi libcall config into tablegen (PR #152109)
llvmbot wrote:
@llvm/pr-subscribers-backend-arm
Author: Matt Arsenault (arsenm)
Changes
---
Full diff: https://github.com/llvm/llvm-project/pull/152109.diff
8 Files Affected:
- (modified) llvm/include/llvm/IR/RuntimeLibcalls.h (+10-2)
- (modified) llvm/include/llvm/IR/RuntimeLibcalls.td (+96-2)
- (modified) llvm/include/llvm/TargetParser/ARMTargetParser.h (+3-3)
- (modified) llvm/lib/IR/RuntimeLibcalls.cpp (+6-39)
- (modified) llvm/lib/Target/ARM/ARMISelLowering.cpp (-120)
- (modified) llvm/test/TableGen/RuntimeLibcallEmitter-calling-conv.td (+1-1)
- (modified) llvm/test/TableGen/RuntimeLibcallEmitter.td (+1-1)
- (modified) llvm/utils/TableGen/Basic/RuntimeLibcallsEmitter.cpp (+2-1)
``diff
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h
b/llvm/include/llvm/IR/RuntimeLibcalls.h
index f39e2e3c26900..35cc49b0ee81c 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -182,6 +182,14 @@ struct RuntimeLibcallsInfo {
return true;
}
+ static bool isTargetAEABI(const Triple &TT) {
+return TT.isTargetAEABI() || TT.isTargetGNUAEABI() ||
+ TT.isTargetMuslAEABI() || TT.isAndroid();
+ }
+
+ LLVM_READONLY
+ static bool isAAPCS_ABI(const Triple &TT, StringRef ABIName);
+
static bool darwinHasExp10(const Triple &TT);
/// Return true if the target has sincosf/sincos/sincosl functions
@@ -195,8 +203,8 @@ struct RuntimeLibcallsInfo {
}
/// Generated by tablegen.
- void setTargetRuntimeLibcallSets(const Triple &TT,
- FloatABI::ABIType FloatABI);
+ void setTargetRuntimeLibcallSets(const Triple &TT, FloatABI::ABIType
FloatABI,
+ EABI ABIType, StringRef ABIName);
/// Set default libcall names. If a target wants to opt-out of a libcall it
/// should be placed here.
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td
b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 4905c8a420dcc..6cefb54b79d5c 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -1482,8 +1482,99 @@ def WindowARMFPIntCasts : LibcallImpls<
def AEABIDivRemCalls : LibcallImpls<
(add __aeabi_idivmod, __aeabi_ldivmod,
__aeabi_uidivmod, __aeabi_uldivmod),
- RuntimeLibcallPredicate<[{TT.isTargetAEABI() || TT.isAndroid() ||
TT.isTargetGNUAEABI() ||
-TT.isTargetMuslAEABI()}]>> {
+ RuntimeLibcallPredicate<[{isTargetAEABI(TT)}]>> {
+ let CallingConv = ARM_AAPCS;
+}
+
+def AEABICalls : LibcallImpls<
+ (add
+ // Double-precision floating-point arithmetic helper functions
+ // RTABI chapter 4.1.2, Table 2
+ __aeabi_dadd,
+ __aeabi_ddiv,
+ __aeabi_dmul,
+ __aeabi_dsub,
+
+ // Double-precision floating-point comparison helper functions
+ // RTABI chapter 4.1.2, Table 3
+ __aeabi_dcmpeq__oeq,
+ __aeabi_dcmpeq__une,
+ __aeabi_dcmplt,
+ __aeabi_dcmple,
+ __aeabi_dcmpge,
+ __aeabi_dcmpgt,
+ __aeabi_dcmpun,
+
+ // Single-precision floating-point arithmetic helper functions
+ // RTABI chapter 4.1.2, Table 4
+ __aeabi_fadd,
+ __aeabi_fdiv,
+ __aeabi_fmul,
+ __aeabi_fsub,
+
+ // Single-precision floating-point comparison helper functions
+ // RTABI chapter 4.1.2, Table 5
+ __aeabi_fcmpeq__oeq,
+ __aeabi_fcmpeq__une,
+ __aeabi_fcmplt,
+ __aeabi_fcmple,
+ __aeabi_fcmpge,
+ __aeabi_fcmpgt,
+ __aeabi_fcmpun,
+
+ // Floating-point to integer conversions.
+ // RTABI chapter 4.1.2, Table 6
+ __aeabi_d2iz,
+ __aeabi_d2uiz,
+ __aeabi_d2lz,
+ __aeabi_d2ulz,
+ __aeabi_f2iz,
+ __aeabi_f2uiz,
+ __aeabi_f2lz,
+ __aeabi_f2ulz,
+
+ // Conversions between floating types.
+ // RTABI chapter 4.1.2, Table 7
+ __aeabi_d2f,
+ __aeabi_d2h,
+ __aeabi_f2d,
+
+ // Integer to floating-point conversions.
+ // RTABI chapter 4.1.2, Table 8
+ __aeabi_i2d,
+ __aeabi_ui2d,
+ __aeabi_l2d,
+ __aeabi_ul2d,
+ __aeabi_i2f,
+ __aeabi_ui2f,
+ __aeabi_l2f,
+ __aeabi_ul2f,
+
+ // Long long helper functions
+ // RTABI chapter 4.2, Table 9
+ __aeabi_lmul,
+ __aeabi_llsl,
+ __aeabi_llsr,
+ __aeabi_lasr,
+
+ // Integer division functions
+ // RTABI chapter 4.3.1
+ __aeabi_idiv,
+ __aeabi_uidiv),
+ RuntimeLibcallPredicate<[{isTargetAEABI(TT) && isAAPCS_ABI(TT, ABIName)}]>> {
+ let CallingConv = ARM_AAPCS;
+}
+
+// EABI dependent RTLIB, Memory operations
+// RTABI chapter 4.3.4
+def AEABI44MemCalls : LibcallImpls<
+ (add __aeabi_memcpy, __aeabi_memcpy4, __aeabi_memcpy8,
+ __aeabi_memmove, __aeabi_memmove4, __aeabi_memmove8,
+ __aeabi_memset, __aeabi_memset4, __aeabi_memset8,
+ __aeabi_memclr, __aeabi_memclr4, __aeabi_memclr8),
+ RuntimeLibcallPredicate<[{(EABIVersion == EABI::EABI4 ||
+ EABIVers
[llvm-branch-commits] [llvm] ARM: Move more aeabi libcall config into tablegen (PR #152109)
arsenm wrote: > [!WARNING] > This pull request is not mergeable via GitHub because a downstack PR is > open. Once all requirements are satisfied, merge this PR as a stack href="https://app.graphite.dev/github/pr/llvm/llvm-project/152109?utm_source=stack-comment-downstack-mergeability-warning"; > >on Graphite. > https://graphite.dev/docs/merge-pull-requests";>Learn more * **#152109** https://app.graphite.dev/github/pr/llvm/llvm-project/152109?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> 👈 https://app.graphite.dev/github/pr/llvm/llvm-project/152109?utm_source=stack-comment-view-in-graphite"; target="_blank">(View in Graphite) * **#152065** https://app.graphite.dev/github/pr/llvm/llvm-project/152065?utm_source=stack-comment-icon"; target="_blank">https://static.graphite.dev/graphite-32x32-black.png"; alt="Graphite" width="10px" height="10px"/> * `main` This stack of pull requests is managed by https://graphite.dev?utm-source=stack-comment";>Graphite. Learn more about https://stacking.dev/?utm_source=stack-comment";>stacking. https://github.com/llvm/llvm-project/pull/152109 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] ARM: Move more aeabi libcall config into tablegen (PR #152109)
https://github.com/arsenm ready_for_review https://github.com/llvm/llvm-project/pull/152109 ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] 1f17474 - [llvm][docs] Add release note for LLDB MTE changes
Author: David Spickett Date: 2025-08-05T10:47:45+02:00 New Revision: 1f174745928283df10386cd5e8345567da47bb83 URL: https://github.com/llvm/llvm-project/commit/1f174745928283df10386cd5e8345567da47bb83 DIFF: https://github.com/llvm/llvm-project/commit/1f174745928283df10386cd5e8345567da47bb83.diff LOG: [llvm][docs] Add release note for LLDB MTE changes Goes with https://github.com/llvm/llvm-project/pull/15. Added: Modified: llvm/docs/ReleaseNotes.md Removed: diff --git a/llvm/docs/ReleaseNotes.md b/llvm/docs/ReleaseNotes.md index de6b1181158d2..a126d7ae1ab4a 100644 --- a/llvm/docs/ReleaseNotes.md +++ b/llvm/docs/ReleaseNotes.md @@ -326,6 +326,9 @@ Changes to LLDB RISC-V code with `disassemble`'s `--byte` option. * LLDB added native support for the Model Context Protocol (MCP). An MCP server can be started with the `protocol-server start MCP` command. +* On AArch64 Linux, LLDB will now show the state of the `STORE_ONLY` field of + `mte_ctrl`. This will only be shown on hardware that has the + `FEAT_MTE_STORE_ONLY` architecture feature. ### Changes to lldb-dap ___ llvm-branch-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
