Skip to content

Commit 5d2f0ec

Browse files
authored
Merge branch 'llvm:main' into feature/extend-macros
2 parents 1720b12 + ed5aadd commit 5d2f0ec

File tree

550 files changed

+13707
-3524
lines changed

Some content is hidden

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

550 files changed

+13707
-3524
lines changed

bolt/unittests/Core/MCPlusBuilder.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ INSTANTIATE_TEST_SUITE_P(AArch64, MCPlusBuilderTester,
9090
::testing::Values(Triple::aarch64));
9191

9292
TEST_P(MCPlusBuilderTester, AliasX0) {
93-
uint64_t AliasesX0[] = {AArch64::W0, AArch64::X0, AArch64::W0_W1,
93+
uint64_t AliasesX0[] = {AArch64::W0, AArch64::W0_HI,
94+
AArch64::X0, AArch64::W0_W1,
9495
AArch64::X0_X1, AArch64::X0_X1_X2_X3_X4_X5_X6_X7};
9596
size_t AliasesX0Count = sizeof(AliasesX0) / sizeof(*AliasesX0);
9697
testRegAliases(Triple::aarch64, AArch64::X0, AliasesX0, AliasesX0Count);
9798
}
9899

99100
TEST_P(MCPlusBuilderTester, AliasSmallerX0) {
100-
uint64_t AliasesX0[] = {AArch64::W0, AArch64::X0};
101+
uint64_t AliasesX0[] = {AArch64::W0, AArch64::W0_HI, AArch64::X0};
101102
size_t AliasesX0Count = sizeof(AliasesX0) / sizeof(*AliasesX0);
102103
testRegAliases(Triple::aarch64, AArch64::X0, AliasesX0, AliasesX0Count, true);
103104
}

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi)
329329
foreach(lang C;CXX;ASM)
330330
# TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
331331
# These should be addressed and removed over time.
332-
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "--target=${target} -mthumb -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1")
332+
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "--target=${target} -mthumb -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dtimeval=struct timeval{int tv_sec; int tv_usec;}\" \"-Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1")
333333
if(${target} STREQUAL "armv8m.main-none-eabi")
334334
set(RUNTIMES_${target}_CMAKE_${lang}_local_flags "${RUNTIMES_${target}_CMAKE_${lang}_local_flags} -mfloat-abi=softfp -march=armv8m.main+fp+dsp -mcpu=cortex-m33" CACHE STRING "")
335335
endif()
@@ -340,6 +340,7 @@ foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi)
340340
endforeach()
341341
set(RUNTIMES_${target}_LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
342342
set(RUNTIMES_${target}_LIBC_ENABLE_USE_BY_CLANG ON CACHE BOOL "")
343+
set(RUNTIMES_${target}_LIBC_USE_NEW_HEADER_GEN OFF CACHE BOOL "")
343344
set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
344345
set(RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "")
345346
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
@@ -384,13 +385,14 @@ foreach(target riscv32-unknown-elf)
384385
foreach(lang C;CXX;ASM)
385386
# TODO: The preprocessor defines workaround various issues in libc and libc++ integration.
386387
# These should be addressed and removed over time.
387-
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1" CACHE STRING "")
388+
set(RUNTIMES_${target}_CMAKE_${lang}_FLAGS "--target=${target} -march=rv32imafc -mabi=ilp32f -Wno-atomic-alignment \"-Dvfprintf(stream, format, vlist)=vprintf(format, vlist)\" \"-Dfprintf(stream, format, ...)=printf(format)\" \"-Dtimeval=struct timeval{int tv_sec; int tv_usec;}\" \"-Dgettimeofday(tv, tz)\" -D_LIBCPP_PRINT=1" CACHE STRING "")
388389
endforeach()
389390
foreach(type SHARED;MODULE;EXE)
390391
set(RUNTIMES_${target}_CMAKE_${type}_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
391392
endforeach()
392393
set(RUNTIMES_${target}_LLVM_LIBC_FULL_BUILD ON CACHE BOOL "")
393394
set(RUNTIMES_${target}_LIBC_ENABLE_USE_BY_CLANG ON CACHE BOOL "")
395+
set(RUNTIMES_${target}_LIBC_USE_NEW_HEADER_GEN OFF CACHE BOOL "")
394396
set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
395397
set(RUNTIMES_${target}_LIBCXX_CXX_ABI none CACHE STRING "")
396398
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")

clang/docs/LanguageExtensions.rst

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -745,12 +745,10 @@ Let ``VT`` be a vector type and ``ET`` the element type of ``VT``.
745745
======================================= ====================================================================== ==================================
746746
Name Operation Supported element types
747747
======================================= ====================================================================== ==================================
748-
ET __builtin_reduce_max(VT a) return x or y, whichever is larger; If exactly one argument is integer and floating point types
749-
a NaN, return the other argument. If both arguments are NaNs,
750-
fmax() return a NaN.
751-
ET __builtin_reduce_min(VT a) return x or y, whichever is smaller; If exactly one argument integer and floating point types
752-
is a NaN, return the other argument. If both arguments are
753-
NaNs, fmax() return a NaN.
748+
ET __builtin_reduce_max(VT a) return the largest element of the vector. The floating point result integer and floating point types
749+
will always be a number unless all elements of the vector are NaN.
750+
ET __builtin_reduce_min(VT a) return the smallest element of the vector. The floating point result integer and floating point types
751+
will always be a number unless all elements of the vector are NaN.
754752
ET __builtin_reduce_add(VT a) \+ integer types
755753
ET __builtin_reduce_mul(VT a) \* integer types
756754
ET __builtin_reduce_and(VT a) & integer types

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,8 @@ Bug Fixes in This Version
555555
the unsupported type instead of the ``register`` keyword (#GH109776).
556556
- Fixed a crash when emit ctor for global variant with flexible array init (#GH113187).
557557
- Fixed a crash when GNU statement expression contains invalid statement (#GH113468).
558+
- Fixed a failed assertion when using ``__attribute__((noderef))`` on an
559+
``_Atomic``-qualified type (#GH116124).
558560

559561
Bug Fixes to Compiler Builtins
560562
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -754,6 +756,7 @@ X86 Support
754756
- Support ISA of ``AMX-MOVRS``.
755757
- Support ISA of ``AMX-AVX512``.
756758
- Support ISA of ``AMX-TF32``.
759+
- Support ISA of ``MOVRS``.
757760

758761
Arm and AArch64 Support
759762
^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/Attr.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ def TargetELF : TargetSpec {
477477
def TargetELFOrMachO : TargetSpec {
478478
let ObjectFormats = ["ELF", "MachO"];
479479
}
480+
def TargetIFuncSupport : TargetSpec {
481+
let CustomCode = [{ Target.supportsIFunc() }];
482+
}
480483
def TargetWindowsArm64EC : TargetSpec {
481484
let CustomCode = [{ Target.getTriple().isWindowsArm64EC() }];
482485
}
@@ -1855,7 +1858,7 @@ def IBOutletCollection : InheritableAttr {
18551858
let Documentation = [Undocumented];
18561859
}
18571860

1858-
def IFunc : Attr, TargetSpecificAttr<TargetELFOrMachO> {
1861+
def IFunc : Attr, TargetSpecificAttr<TargetIFuncSupport> {
18591862
let Spellings = [GCC<"ifunc">];
18601863
let Args = [StringArgument<"Resolver">];
18611864
let Subjects = SubjectList<[Function]>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4017,7 +4017,8 @@ purposes of calls. For example:
40174017

40184018
If a type is trivial for the purposes of calls, has a non-trivial destructor,
40194019
and is passed as an argument by value, the convention is that the callee will
4020-
destroy the object before returning.
4020+
destroy the object before returning. The lifetime of the copy of the parameter
4021+
in the caller ends without a destructor call when the call begins.
40214022

40224023
If a type is trivial for the purpose of calls, it is assumed to be trivially
40234024
relocatable for the purpose of ``__is_trivially_relocatable``.
@@ -6050,12 +6051,19 @@ declared entity. The entity must not have weak linkage; for example, in C++,
60506051
it cannot be applied to a declaration if a definition at that location would be
60516052
considered inline.
60526053

6053-
Not all targets support this attribute. ELF target support depends on both the
6054-
linker and runtime linker, and is available in at least lld 4.0 and later,
6055-
binutils 2.20.1 and later, glibc v2.11.1 and later, and FreeBSD 9.1 and later.
6056-
Mach-O targets support it, but with slightly different semantics: the resolver
6057-
is run at first call, instead of at load time by the runtime linker. Targets
6058-
other than ELF and Mach-O currently do not support this attribute.
6054+
Not all targets support this attribute:
6055+
6056+
- ELF target support depends on both the linker and runtime linker, and is
6057+
available in at least lld 4.0 and later, binutils 2.20.1 and later, glibc
6058+
v2.11.1 and later, and FreeBSD 9.1 and later.
6059+
- Mach-O targets support it, but with slightly different semantics: the resolver
6060+
is run at first call, instead of at load time by the runtime linker.
6061+
- Windows target supports it on AArch64, but with different semantics: the
6062+
``ifunc`` is replaced with a global function pointer, and the call is replaced
6063+
with an indirect call. The function pointer is initialized by a constructor
6064+
that calls the resolver.
6065+
- Baremetal target supports it on AVR.
6066+
- Other targets currently do not support this attribute.
60596067
}];
60606068
}
60616069

clang/include/clang/Basic/BuiltinsX86.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,9 @@ TARGET_BUILTIN(__builtin_ia32_vpdpbuud256, "V8iV8iV8iV8i", "ncV:256:", "avxvnnii
660660
TARGET_BUILTIN(__builtin_ia32_vpdpbuuds128, "V4iV4iV4iV4i", "ncV:128:", "avxvnniint8|avx10.2-256")
661661
TARGET_BUILTIN(__builtin_ia32_vpdpbuuds256, "V8iV8iV8iV8i", "ncV:256:", "avxvnniint8|avx10.2-256")
662662

663+
// MOVRS
664+
TARGET_BUILTIN(__builtin_ia32_prefetchrs, "vvC*", "nc", "movrs")
665+
663666
TARGET_BUILTIN(__builtin_ia32_gather3div2df, "V2dV2dvC*V2OiUcIi", "nV:128:", "avx512vl")
664667
TARGET_BUILTIN(__builtin_ia32_gather3div2di, "V2OiV2OivC*V2OiUcIi", "nV:128:", "avx512vl")
665668
TARGET_BUILTIN(__builtin_ia32_gather3div4df, "V4dV4dvC*V4OiUcIi", "nV:256:", "avx512vl")

clang/include/clang/Basic/BuiltinsX86_64.def

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,12 @@ TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1rs_internal, "vUsUsUsV256i*V256i*vC*z",
139139
TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1t1_internal, "vUsUsUsV256i*V256i*vC*z", "n", "amx-transpose")
140140
TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1rst1_internal, "vUsUsUsV256i*V256i*vC*z", "n", "amx-movrs,amx-transpose")
141141
TARGET_BUILTIN(__builtin_ia32_ttransposed_internal, "V256iUsUsV256i", "n", "amx-transpose")
142+
TARGET_BUILTIN(__builtin_ia32_ttdpbf16ps_internal, "V256iUsUsUsV256iV256iV256i", "n", "amx-bf16,amx-transpose")
143+
TARGET_BUILTIN(__builtin_ia32_ttdpfp16ps_internal, "V256iUsUsUsV256iV256iV256i", "n", "amx-fp16,amx-transpose")
144+
TARGET_BUILTIN(__builtin_ia32_ttcmmimfp16ps_internal, "V256iUsUsUsV256iV256iV256i", "n", "amx-complex,amx-transpose")
145+
TARGET_BUILTIN(__builtin_ia32_ttcmmrlfp16ps_internal, "V256iUsUsUsV256iV256iV256i", "n", "amx-complex,amx-transpose")
146+
TARGET_BUILTIN(__builtin_ia32_tconjtcmmimfp16ps_internal, "V256iUsUsUsV256iV256iV256i", "n", "amx-complex,amx-transpose")
147+
TARGET_BUILTIN(__builtin_ia32_tconjtfp16_internal, "V256iUsUsV256i", "n", "amx-complex,amx-transpose")
142148

143149
TARGET_BUILTIN(__builtin_ia32_tcvtrowd2ps_internal, "V16fUsUsV256iUi", "n", "amx-avx512,avx10.2-512")
144150
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2pbf16h_internal, "V32yUsUsV256iUi", "n", "amx-avx512,avx10.2-512")
@@ -185,6 +191,12 @@ TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz0t1, "vIUcvC*z", "n","amx-transpose")
185191
TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1, "vIUcvC*z", "n", "amx-transpose")
186192
TARGET_BUILTIN(__builtin_ia32_t2rpntlvwz1t1, "vIUcvC*z", "n","amx-transpose")
187193
TARGET_BUILTIN(__builtin_ia32_ttransposed, "vIUcIUc", "n", "amx-transpose")
194+
TARGET_BUILTIN(__builtin_ia32_ttdpbf16ps, "vIUcIUcIUc", "n", "amx-bf16,amx-transpose")
195+
TARGET_BUILTIN(__builtin_ia32_ttdpfp16ps, "vIUcIUcIUc", "n", "amx-fp16,amx-transpose")
196+
TARGET_BUILTIN(__builtin_ia32_ttcmmimfp16ps, "vIUcIUcIUc", "n", "amx-complex,amx-transpose")
197+
TARGET_BUILTIN(__builtin_ia32_ttcmmrlfp16ps, "vIUcIUcIUc", "n", "amx-complex,amx-transpose")
198+
TARGET_BUILTIN(__builtin_ia32_tconjtcmmimfp16ps, "vIUcIUcIUc", "n", "amx-complex,amx-transpose")
199+
TARGET_BUILTIN(__builtin_ia32_tconjtfp16, "vIUcIUc", "n", "amx-complex,amx-transpose")
188200

189201
TARGET_BUILTIN(__builtin_ia32_tcvtrowd2ps, "V16fIUcUi", "n", "amx-avx512,avx10.2-512")
190202
TARGET_BUILTIN(__builtin_ia32_tcvtrowps2pbf16h, "V32yIUcUi", "n", "amx-avx512,avx10.2-512")
@@ -216,6 +228,12 @@ TARGET_BUILTIN(__builtin_ia32_aand64, "vv*SOi", "n", "raoint")
216228
TARGET_BUILTIN(__builtin_ia32_aor64, "vv*SOi", "n", "raoint")
217229
TARGET_BUILTIN(__builtin_ia32_axor64, "vv*SOi", "n", "raoint")
218230

231+
// MOVRS
232+
TARGET_BUILTIN(__builtin_ia32_movrsqi, "ScvC*", "n", "movrs")
233+
TARGET_BUILTIN(__builtin_ia32_movrshi, "SsvC*", "n", "movrs")
234+
TARGET_BUILTIN(__builtin_ia32_movrssi, "SivC*", "n", "movrs")
235+
TARGET_BUILTIN(__builtin_ia32_movrsdi, "SLLivC*", "n", "movrs")
236+
219237
// MOVRS and AVX10.2
220238
TARGET_BUILTIN(__builtin_ia32_vmovrsb128, "V16cV16cC*", "nV:128:", "movrs,avx10.2-256")
221239
TARGET_BUILTIN(__builtin_ia32_vmovrsb256, "V32cV32cC*", "nV:256:", "movrs,avx10.2-256")

clang/include/clang/Basic/TargetInfo.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,10 @@ class TargetInfo : public TransferrableTargetInfo,
14971497
bool supportsIFunc() const {
14981498
if (getTriple().isOSBinFormatMachO())
14991499
return true;
1500+
if (getTriple().isOSWindows() && getTriple().isAArch64())
1501+
return true;
1502+
if (getTriple().getArch() == llvm::Triple::ArchType::avr)
1503+
return true;
15001504
return getTriple().isOSBinFormatELF() &&
15011505
((getTriple().isOSLinux() && !getTriple().isMusl()) ||
15021506
getTriple().isOSFreeBSD());

clang/include/clang/Basic/arm_sve.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1964,7 +1964,7 @@ let SVETargetGuard = "sve2,lut,bf16", SMETargetGuard = "sme2,lut,bf16" in {
19641964
////////////////////////////////////////////////////////////////////////////////
19651965
// SVE2 - Optional
19661966

1967-
let SVETargetGuard = "sve2-aes", SMETargetGuard = InvalidMode in {
1967+
let SVETargetGuard = "sve2,sve-aes", SMETargetGuard = InvalidMode in {
19681968
def SVAESD : SInst<"svaesd[_{d}]", "ddd", "Uc", MergeNone, "aarch64_sve_aesd", [IsOverloadNone]>;
19691969
def SVAESIMC : SInst<"svaesimc[_{d}]", "dd", "Uc", MergeNone, "aarch64_sve_aesimc", [IsOverloadNone]>;
19701970
def SVAESE : SInst<"svaese[_{d}]", "ddd", "Uc", MergeNone, "aarch64_sve_aese", [IsOverloadNone]>;

0 commit comments

Comments
 (0)