Skip to content

Commit 25b492c

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merge upstream LLVM into amd-gfx12
2 parents 784d5f9 + 76bebb5 commit 25b492c

Some content is hidden

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

44 files changed

+970
-218
lines changed

clang/lib/CodeGen/TargetBuiltins/ARM.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4922,19 +4922,6 @@ Value *CodeGenFunction::EmitAArch64SMEBuiltinExpr(unsigned BuiltinID,
49224922
if (Builtin->LLVMIntrinsic == 0)
49234923
return nullptr;
49244924

4925-
if (BuiltinID == SME::BI__builtin_sme___arm_in_streaming_mode) {
4926-
// If we already know the streaming mode, don't bother with the intrinsic
4927-
// and emit a constant instead
4928-
const auto *FD = cast<FunctionDecl>(CurFuncDecl);
4929-
if (const auto *FPT = FD->getType()->getAs<FunctionProtoType>()) {
4930-
unsigned SMEAttrs = FPT->getAArch64SMEAttributes();
4931-
if (!(SMEAttrs & FunctionType::SME_PStateSMCompatibleMask)) {
4932-
bool IsStreaming = SMEAttrs & FunctionType::SME_PStateSMEnabledMask;
4933-
return ConstantInt::getBool(Builder.getContext(), IsStreaming);
4934-
}
4935-
}
4936-
}
4937-
49384925
// Predicates must match the main datatype.
49394926
for (Value *&Op : Ops)
49404927
if (auto PredTy = dyn_cast<llvm::VectorType>(Op->getType()))

libclc/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ set( LIBCLC_TARGETS_TO_BUILD "all"
4242

4343
option( ENABLE_RUNTIME_SUBNORMAL "Enable runtime linking of subnormal support." OFF )
4444

45+
# Top level target used to build all Libclc libraries.
46+
add_custom_target( libclc ALL )
47+
48+
add_custom_target( libclc-opencl-builtins COMMENT "Build libclc OpenCL builtins" )
49+
add_dependencies( libclc libclc-opencl-builtins )
50+
4551
if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
4652
# Out-of-tree configuration
4753
set( LIBCLC_STANDALONE_BUILD TRUE )
@@ -463,6 +469,7 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} )
463469
LIB_FILES ${opencl_lib_files}
464470
GEN_FILES ${opencl_gen_files}
465471
ALIASES ${${d}_aliases}
472+
PARENT_TARGET libclc-opencl-builtins
466473
# Link in the CLC builtins and internalize their symbols
467474
INTERNAL_LINK_DEPENDENCIES builtins.link.clc-${arch_suffix}
468475
)

libclc/cmake/modules/AddLibclc.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ endfunction()
207207
# libclc architecture/triple suffix
208208
# * TRIPLE <string>
209209
# Triple used to compile
210+
# * PARENT_TARGET <string>
211+
# Target into which to group the target builtins
210212
#
211213
# Optional Arguments:
212214
# * CLC_INTERNAL
@@ -229,7 +231,7 @@ endfunction()
229231
function(add_libclc_builtin_set)
230232
cmake_parse_arguments(ARG
231233
"CLC_INTERNAL"
232-
"ARCH;TRIPLE;ARCH_SUFFIX"
234+
"ARCH;TRIPLE;ARCH_SUFFIX;PARENT_TARGET"
233235
"LIB_FILES;GEN_FILES;COMPILE_FLAGS;OPT_FLAGS;ALIASES;INTERNAL_LINK_DEPENDENCIES"
234236
${ARGN}
235237
)
@@ -403,6 +405,9 @@ function(add_libclc_builtin_set)
403405
add_custom_target( prepare-${ARG_TRIPLE} ALL )
404406
endif()
405407
add_dependencies( prepare-${ARG_TRIPLE} prepare-${obj_suffix} )
408+
# Add dependency to top-level pseudo target to ease making other
409+
# targets dependent on libclc.
410+
add_dependencies( ${ARG_PARENT_TARGET} prepare-${ARG_TRIPLE} )
406411

407412
install(
408413
FILES ${libclc_builtins_lib}
@@ -445,6 +450,7 @@ function(add_libclc_builtin_set)
445450
add_custom_target( alias-${alias_suffix} ALL
446451
DEPENDS ${LIBCLC_OUTPUT_LIBRARY_DIR}/${alias_suffix}
447452
)
453+
add_dependencies( ${ARG_PARENT_TARGET} alias-${alias_suffix} )
448454
set_target_properties( alias-${alias_suffix}
449455
PROPERTIES FOLDER "libclc/Device IR/Aliases"
450456
)

libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ set(files
381381
__format/enable_insertable.h
382382
__format/escaped_output_table.h
383383
__format/extended_grapheme_cluster_table.h
384+
__format/fmt_pair_like.h
384385
__format/format_arg.h
385386
__format/format_arg_store.h
386387
__format/format_args.h

libcxx/include/__format/concepts.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@
1515
#include <__config>
1616
#include <__format/format_parse_context.h>
1717
#include <__fwd/format.h>
18-
#include <__fwd/tuple.h>
19-
#include <__tuple/tuple_size.h>
20-
#include <__type_traits/is_specialization.h>
2118
#include <__type_traits/remove_const.h>
2219
#include <__type_traits/remove_reference.h>
23-
#include <__utility/pair.h>
2420

2521
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2622
# pragma GCC system_header
@@ -65,16 +61,6 @@ concept __formattable =
6561
# if _LIBCPP_STD_VER >= 23
6662
template <class _Tp, class _CharT>
6763
concept formattable = __formattable<_Tp, _CharT>;
68-
69-
// [tuple.like] defines a tuple-like exposition only concept. This concept is
70-
// not related to that. Therefore it uses a different name for the concept.
71-
//
72-
// TODO FMT Add a test to validate we fail when using that concept after P2165
73-
// has been implemented.
74-
template <class _Tp>
75-
concept __fmt_pair_like =
76-
__is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);
77-
7864
# endif // _LIBCPP_STD_VER >= 23
7965
#endif // _LIBCPP_STD_VER >= 20
8066

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// -*- C++ -*-
2+
//===----------------------------------------------------------------------===//
3+
//
4+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5+
// See https://llvm.org/LICENSE.txt for license information.
6+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef _LIBCPP___FORMAT_FMT_PAIR_LIKE_H
11+
#define _LIBCPP___FORMAT_FMT_PAIR_LIKE_H
12+
13+
#include <__config>
14+
#include <__fwd/pair.h>
15+
#include <__fwd/tuple.h>
16+
#include <__tuple/tuple_size.h>
17+
#include <__type_traits/is_specialization.h>
18+
19+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
20+
# pragma GCC system_header
21+
#endif
22+
23+
_LIBCPP_BEGIN_NAMESPACE_STD
24+
25+
#if _LIBCPP_STD_VER >= 23
26+
27+
// [tuple.like] defines a tuple-like exposition only concept. This concept is not related to that. Therefore it uses a
28+
// different name for the concept.
29+
//
30+
// TODO FMT Add a test to validate we fail when using that concept after P2165 has been implemented.
31+
32+
// [format.range.fmtkind]/2.2.1 and [tab:formatter.range.type]:
33+
// "U is either a specialization of pair or a specialization of tuple such that tuple_size_v<U> is 2."
34+
template <class _Tp>
35+
concept __fmt_pair_like =
36+
__is_specialization_v<_Tp, pair> || (__is_specialization_v<_Tp, tuple> && tuple_size_v<_Tp> == 2);
37+
38+
#endif // _LIBCPP_STD_VER >= 23
39+
40+
_LIBCPP_END_NAMESPACE_STD
41+
42+
#endif // _LIBCPP___FORMAT_FMT_PAIR_LIKE_H

libcxx/include/__format/range_default_formatter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <__chrono/statically_widen.h>
1919
#include <__config>
2020
#include <__format/concepts.h>
21+
#include <__format/fmt_pair_like.h>
2122
#include <__format/formatter.h>
2223
#include <__format/range_format.h>
2324
#include <__format/range_formatter.h>

libcxx/include/__format/range_format.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#include <__concepts/same_as.h>
1818
#include <__config>
19-
#include <__format/concepts.h>
19+
#include <__format/fmt_pair_like.h>
2020
#include <__ranges/concepts.h>
2121
#include <__type_traits/remove_cvref.h>
2222

libcxx/include/__format/range_formatter.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <__config>
2121
#include <__format/buffer.h>
2222
#include <__format/concepts.h>
23+
#include <__format/fmt_pair_like.h>
2324
#include <__format/format_context.h>
2425
#include <__format/format_error.h>
2526
#include <__format/formatter.h>

libcxx/include/__vector/vector.h

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -341,59 +341,67 @@ class vector {
341341
}
342342
#endif
343343

344-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
344+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI allocator_type get_allocator() const _NOEXCEPT {
345345
return this->__alloc_;
346346
}
347347

348348
//
349349
// Iterators
350350
//
351-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
351+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator begin() _NOEXCEPT {
352352
return __make_iter(__add_alignment_assumption(this->__begin_));
353353
}
354-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
354+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator begin() const _NOEXCEPT {
355355
return __make_iter(__add_alignment_assumption(this->__begin_));
356356
}
357-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
357+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI iterator end() _NOEXCEPT {
358358
return __make_iter(__add_alignment_assumption(this->__end_));
359359
}
360-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
360+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator end() const _NOEXCEPT {
361361
return __make_iter(__add_alignment_assumption(this->__end_));
362362
}
363363

364-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {
364+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rbegin() _NOEXCEPT {
365365
return reverse_iterator(end());
366366
}
367-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rbegin() const _NOEXCEPT {
367+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator
368+
rbegin() const _NOEXCEPT {
368369
return const_reverse_iterator(end());
369370
}
370-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT {
371+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reverse_iterator rend() _NOEXCEPT {
371372
return reverse_iterator(begin());
372373
}
373-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
374+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator rend() const _NOEXCEPT {
374375
return const_reverse_iterator(begin());
375376
}
376377

377-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT { return begin(); }
378-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT { return end(); }
379-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crbegin() const _NOEXCEPT {
378+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cbegin() const _NOEXCEPT {
379+
return begin();
380+
}
381+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_iterator cend() const _NOEXCEPT {
382+
return end();
383+
}
384+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator
385+
crbegin() const _NOEXCEPT {
380386
return rbegin();
381387
}
382-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT { return rend(); }
388+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reverse_iterator crend() const _NOEXCEPT {
389+
return rend();
390+
}
383391

384392
//
385393
// [vector.capacity], capacity
386394
//
387-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
395+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type size() const _NOEXCEPT {
388396
return static_cast<size_type>(this->__end_ - this->__begin_);
389397
}
390-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {
398+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type capacity() const _NOEXCEPT {
391399
return static_cast<size_type>(this->__cap_ - this->__begin_);
392400
}
393401
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI bool empty() const _NOEXCEPT {
394402
return this->__begin_ == this->__end_;
395403
}
396-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
404+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI size_type max_size() const _NOEXCEPT {
397405
return std::min<size_type>(__alloc_traits::max_size(this->__alloc_), numeric_limits<difference_type>::max());
398406
}
399407
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void reserve(size_type __n);
@@ -402,50 +410,51 @@ class vector {
402410
//
403411
// element access
404412
//
405-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT {
413+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference operator[](size_type __n) _NOEXCEPT {
406414
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
407415
return this->__begin_[__n];
408416
}
409-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference operator[](size_type __n) const _NOEXCEPT {
417+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference
418+
operator[](size_type __n) const _NOEXCEPT {
410419
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(__n < size(), "vector[] index out of bounds");
411420
return this->__begin_[__n];
412421
}
413-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference at(size_type __n) {
422+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference at(size_type __n) {
414423
if (__n >= size())
415424
this->__throw_out_of_range();
416425
return this->__begin_[__n];
417426
}
418-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const {
427+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference at(size_type __n) const {
419428
if (__n >= size())
420429
this->__throw_out_of_range();
421430
return this->__begin_[__n];
422431
}
423432

424-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT {
433+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT {
425434
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
426435
return *this->__begin_;
427436
}
428-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {
437+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT {
429438
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "front() called on an empty vector");
430439
return *this->__begin_;
431440
}
432-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {
441+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT {
433442
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
434443
return *(this->__end_ - 1);
435444
}
436-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
445+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT {
437446
_LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(!empty(), "back() called on an empty vector");
438447
return *(this->__end_ - 1);
439448
}
440449

441450
//
442451
// [vector.data], data access
443452
//
444-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI value_type* data() _NOEXCEPT {
453+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI value_type* data() _NOEXCEPT {
445454
return std::__to_address(this->__begin_);
446455
}
447456

448-
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const value_type* data() const _NOEXCEPT {
457+
[[__nodiscard__]] _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const value_type* data() const _NOEXCEPT {
449458
return std::__to_address(this->__begin_);
450459
}
451460

0 commit comments

Comments
 (0)