Skip to content

Commit 3af3996

Browse files
update
2 parents 4b0a756 + 6ae6c4f commit 3af3996

File tree

1,456 files changed

+65323
-17733
lines changed

Some content is hidden

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

1,456 files changed

+65323
-17733
lines changed

.ci/utils.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ function at-exit {
2626
mkdir -p artifacts
2727
sccache --show-stats >> artifacts/sccache_stats.txt
2828
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
29+
cp "${MONOREPO_ROOT}"/*.log artifacts/ || :
2930
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
3031

3132
# If building fails there will be no results files.
3233
shopt -s nullglob
3334

3435
if [[ "$GITHUB_STEP_SUMMARY" != "" ]]; then
3536
python "${MONOREPO_ROOT}"/.ci/generate_test_report_github.py \
36-
$retcode "${BUILD_DIR}"/test-results.*.xml "${BUILD_DIR}"/ninja*.log \
37+
$retcode "${BUILD_DIR}"/test-results.*.xml "${MONOREPO_ROOT}"/ninja*.log \
3738
>> $GITHUB_STEP_SUMMARY
3839
fi
3940
}

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ concurrency:
3636
jobs:
3737
stage1:
3838
if: github.repository_owner == 'llvm'
39-
runs-on: llvm-premerge-libcxx-runners
39+
runs-on: llvm-premerge-libcxx-next-runners
4040
continue-on-error: false
4141
strategy:
4242
fail-fast: false
@@ -47,8 +47,8 @@ jobs:
4747
'generic-cxx26',
4848
'generic-modules'
4949
]
50-
cc: [ 'clang-21' ]
51-
cxx: [ 'clang++-21' ]
50+
cc: [ 'clang-22' ]
51+
cxx: [ 'clang++-22' ]
5252
include:
5353
- config: 'generic-gcc'
5454
cc: 'gcc-15'
@@ -73,7 +73,7 @@ jobs:
7373
**/crash_diagnostics/*
7474
stage2:
7575
if: github.repository_owner == 'llvm'
76-
runs-on: llvm-premerge-libcxx-runners
76+
runs-on: llvm-premerge-libcxx-next-runners
7777
needs: [ stage1 ]
7878
continue-on-error: false
7979
strategy:
@@ -86,18 +86,18 @@ jobs:
8686
'generic-cxx20',
8787
'generic-cxx23'
8888
]
89-
cc: [ 'clang-21' ]
90-
cxx: [ 'clang++-21' ]
89+
cc: [ 'clang-22' ]
90+
cxx: [ 'clang++-22' ]
9191
include:
9292
- config: 'generic-gcc-cxx11'
9393
cc: 'gcc-15'
9494
cxx: 'g++-15'
95+
- config: 'generic-cxx26'
96+
cc: 'clang-21'
97+
cxx: 'clang++-21'
9598
- config: 'generic-cxx26'
9699
cc: 'clang-20'
97100
cxx: 'clang++-20'
98-
- config: 'generic-cxx26'
99-
cc: 'clang-19'
100-
cxx: 'clang++-19'
101101
steps:
102102
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103103
- name: ${{ matrix.config }}
@@ -148,27 +148,27 @@ jobs:
148148
'generic-static',
149149
'bootstrapping-build'
150150
]
151-
machine: [ 'llvm-premerge-libcxx-runners' ]
151+
machine: [ 'llvm-premerge-libcxx-next-runners' ]
152152
include:
153153
- config: 'generic-cxx26'
154-
machine: llvm-premerge-libcxx-runners
154+
machine: llvm-premerge-libcxx-next-runners
155155
- config: 'generic-asan'
156-
machine: llvm-premerge-libcxx-runners
156+
machine: llvm-premerge-libcxx-next-runners
157157
- config: 'generic-tsan'
158-
machine: llvm-premerge-libcxx-runners
158+
machine: llvm-premerge-libcxx-next-runners
159159
- config: 'generic-ubsan'
160-
machine: llvm-premerge-libcxx-runners
160+
machine: llvm-premerge-libcxx-next-runners
161161
# Use a larger machine for MSAN to avoid timeout and memory allocation issues.
162162
- config: 'generic-msan'
163-
machine: llvm-premerge-libcxx-runners
163+
machine: llvm-premerge-libcxx-next-runners
164164
runs-on: ${{ matrix.machine }}
165165
steps:
166166
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
167167
- name: ${{ matrix.config }}
168168
run: libcxx/utils/ci/run-buildbot ${{ matrix.config }}
169169
env:
170-
CC: clang-21
171-
CXX: clang++-21
170+
CC: clang-22
171+
CXX: clang++-22
172172
- uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
173173
if: always()
174174
with:

clang/docs/LanguageExtensions.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,8 @@ Unless specified otherwise operation(±0) = ±0 and operation(±infinity) = ±in
759759

760760
The integer elementwise intrinsics, including ``__builtin_elementwise_popcount``,
761761
``__builtin_elementwise_bitreverse``, ``__builtin_elementwise_add_sat``,
762-
``__builtin_elementwise_sub_sat`` can be called in a ``constexpr`` context.
762+
``__builtin_elementwise_sub_sat``, ``__builtin_elementwise_max``,
763+
``__builtin_elementwise_min`` can be called in a ``constexpr`` context.
763764

764765
No implicit promotion of integer types takes place. The mixing of integer types
765766
of different sizes and signs is forbidden in binary and ternary builtins.
@@ -859,6 +860,15 @@ of different sizes and signs is forbidden in binary and ternary builtins.
859860
semantics, see `LangRef
860861
<http://llvm.org/docs/LangRef.html#llvm-min-intrinsics-comparation>`_
861862
for the comparison.
863+
T __builtin_elementwise_fshl(T x, T y, T z) perform a funnel shift left. Concatenate x and y (x is the most integer types
864+
significant bits of the wide value), the combined value is shifted
865+
left by z, and the most significant bits are extracted to produce
866+
a result that is the same size as the original arguments.
867+
868+
T __builtin_elementwise_fshr(T x, T y, T z) perform a funnel shift right. Concatenate x and y (x is the most integer types
869+
significant bits of the wide value), the combined value is shifted
870+
right by z, and the least significant bits are extracted to produce
871+
a result that is the same size as the original arguments.
862872
============================================== ====================================================================== =========================================
863873

864874

clang/docs/OpenMPSupport.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ implementation.
191191
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
192192
| device | teams construct on the host device | :good:`done` | r371553 |
193193
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
194-
| device | support non-contiguous array sections for target update | :good:`done` | |
194+
| device | support non-contiguous array sections for target update | :good:`done` | https://github.com/llvm/llvm-project/pull/144635 |
195195
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
196196
| device | pointer attachment | :good:`done` | |
197197
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
@@ -338,7 +338,7 @@ implementation.
338338
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
339339
| OMPT | new 'emi' callbacks for external monitoring interfaces | :good:`done` | |
340340
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
341-
| OMPT | device tracing interface | :none:`unclaimed` | |
341+
| OMPT | device tracing interface | :none:`in progress` | jplehr |
342342
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
343343
| task | 'strict' modifier for taskloop construct | :none:`unclaimed` | |
344344
+------------------------------+--------------------------------------------------------------+--------------------------+-----------------------------------------------------------------------+
@@ -470,9 +470,9 @@ implementation.
470470
| need_device_addr modifier for adjust_args clause | :part:`partial` | :none:`unclaimed` | Parsing/Sema: https://github.com/llvm/llvm-project/pull/143442 |
471471
| | | | https://github.com/llvm/llvm-project/pull/149586 |
472472
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
473-
| Prescriptive num_threads | :part:`In Progress` | :none:`unclaimed` | |
473+
| Prescriptive num_threads | :part:`In Progress` | :none:`unclaimed` | ro-i |
474474
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
475-
| Message and severity clauses | :part:`In Progress` | :none:`unclaimed` | |
475+
| Message and severity clauses | :part:`In Progress` | :none:`unclaimed` | ro-i |
476476
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
477477
| Local clause on declare target | :part:`In Progress` | :none:`unclaimed` | |
478478
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+

clang/docs/ReleaseNotes.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ C23 Feature Support
113113

114114
Non-comprehensive list of changes in this release
115115
-------------------------------------------------
116+
- Added ``__builtin_elementwise_fshl`` and ``__builtin_elementwise_fshr``.
117+
116118
- Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``.
117119

118120
- Trapping UBSan (e.g. ``-fsanitize-trap=undefined``) now emits a string describing the reason for
@@ -124,6 +126,9 @@ Non-comprehensive list of changes in this release
124126
This feature is enabled by default but can be disabled by compiling with
125127
``-fno-sanitize-annotate-debug-info-traps``.
126128

129+
- ``__builtin_elementwise_max`` and ``__builtin_elementwise_min`` functions for integer types can
130+
now be used in constant expressions.
131+
127132
New Compiler Flags
128133
------------------
129134
- New option ``-fno-sanitize-annotate-debug-info-traps`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
@@ -150,6 +155,17 @@ Improvements to Clang's diagnostics
150155
- Fixed fix-it hint for fold expressions. Clang now correctly places the suggested right
151156
parenthesis when diagnosing malformed fold expressions. (#GH151787)
152157

158+
- Fixed an issue where emitted format-signedness diagnostics were not associated with an appropriate
159+
diagnostic id. Besides being incorrect from an API standpoint, this was user visible, e.g.:
160+
"format specifies type 'unsigned int' but the argument has type 'int' [-Wformat]"
161+
"signedness of format specifier 'u' is incompatible with 'c' [-Wformat]"
162+
This was misleading, because even though -Wformat is required in order to emit the diagnostics,
163+
the warning flag the user needs to concerned with here is -Wformat-signedness, which is also
164+
required and is not enabled by default. With the change you'll now see:
165+
"format specifies type 'unsigned int' but the argument has type 'int', which differs in signedness [-Wformat-signedness]"
166+
"signedness of format specifier 'u' is incompatible with 'c' [-Wformat-signedness]"
167+
and the API-visible diagnostic id will be appropriate.
168+
153169
Improvements to Clang's time-trace
154170
----------------------------------
155171

@@ -189,6 +205,7 @@ Bug Fixes to C++ Support
189205
- Fix the dynamic_cast to final class optimization to correctly handle
190206
casts that are guaranteed to fail (#GH137518).
191207
- Fix bug rejecting partial specialization of variable templates with auto NTTPs (#GH118190).
208+
- Fix a crash when using ``explicit(bool)`` in pre-C++11 language modes. (#GH152729)
192209

193210
Bug Fixes to AST Handling
194211
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -317,6 +334,7 @@ OpenMP Support
317334
- Added parsing and semantic analysis support for the ``need_device_addr``
318335
modifier in the ``adjust_args`` clause.
319336
- Allow array length to be omitted in array section subscript expression.
337+
- Fixed non-contiguous strided update in the ``omp target update`` directive with the ``from`` clause.
320338

321339
Improvements
322340
^^^^^^^^^^^^

clang/include/clang/APINotes/Types.h

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ class CommonTypeInfo : public CommonEntityInfo {
141141
/// The NS error domain for this type.
142142
std::optional<std::string> NSErrorDomain;
143143

144+
/// The Swift protocol that this type should be automatically conformed to.
145+
std::optional<std::string> SwiftConformance;
146+
144147
public:
145148
CommonTypeInfo() {}
146149

@@ -165,6 +168,14 @@ class CommonTypeInfo : public CommonEntityInfo {
165168
: std::nullopt;
166169
}
167170

171+
std::optional<std::string> getSwiftConformance() const {
172+
return SwiftConformance;
173+
}
174+
175+
void setSwiftConformance(std::optional<std::string> conformance) {
176+
SwiftConformance = conformance;
177+
}
178+
168179
friend bool operator==(const CommonTypeInfo &, const CommonTypeInfo &);
169180

170181
CommonTypeInfo &operator|=(const CommonTypeInfo &RHS) {
@@ -175,6 +186,8 @@ class CommonTypeInfo : public CommonEntityInfo {
175186
setSwiftBridge(RHS.getSwiftBridge());
176187
if (!NSErrorDomain)
177188
setNSErrorDomain(RHS.getNSErrorDomain());
189+
if (SwiftConformance)
190+
setSwiftConformance(RHS.getSwiftConformance());
178191

179192
return *this;
180193
}
@@ -185,7 +198,8 @@ class CommonTypeInfo : public CommonEntityInfo {
185198
inline bool operator==(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
186199
return static_cast<const CommonEntityInfo &>(LHS) == RHS &&
187200
LHS.SwiftBridge == RHS.SwiftBridge &&
188-
LHS.NSErrorDomain == RHS.NSErrorDomain;
201+
LHS.NSErrorDomain == RHS.NSErrorDomain &&
202+
LHS.SwiftConformance == RHS.SwiftConformance;
189203
}
190204

191205
inline bool operator!=(const CommonTypeInfo &LHS, const CommonTypeInfo &RHS) {
@@ -739,9 +753,6 @@ class TagInfo : public CommonTypeInfo {
739753
std::optional<std::string> SwiftReleaseOp;
740754
std::optional<std::string> SwiftDefaultOwnership;
741755

742-
/// The Swift protocol that this type should be automatically conformed to.
743-
std::optional<std::string> SwiftConformance;
744-
745756
std::optional<EnumExtensibilityKind> EnumExtensibility;
746757

747758
TagInfo()
@@ -790,9 +801,6 @@ class TagInfo : public CommonTypeInfo {
790801
if (!SwiftDefaultOwnership)
791802
SwiftDefaultOwnership = RHS.SwiftDefaultOwnership;
792803

793-
if (!SwiftConformance)
794-
SwiftConformance = RHS.SwiftConformance;
795-
796804
if (!HasFlagEnum)
797805
setFlagEnum(RHS.isFlagEnum());
798806

@@ -819,7 +827,6 @@ inline bool operator==(const TagInfo &LHS, const TagInfo &RHS) {
819827
LHS.SwiftRetainOp == RHS.SwiftRetainOp &&
820828
LHS.SwiftReleaseOp == RHS.SwiftReleaseOp &&
821829
LHS.SwiftDefaultOwnership == RHS.SwiftDefaultOwnership &&
822-
LHS.SwiftConformance == RHS.SwiftConformance &&
823830
LHS.isFlagEnum() == RHS.isFlagEnum() &&
824831
LHS.isSwiftCopyable() == RHS.isSwiftCopyable() &&
825832
LHS.isSwiftEscapable() == RHS.isSwiftEscapable() &&

clang/include/clang/AST/APValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class APValue {
143143
AddrLabelDiff
144144
};
145145

146-
class LValueBase {
146+
class alignas(uint64_t) LValueBase {
147147
typedef llvm::PointerUnion<const ValueDecl *, const Expr *, TypeInfoLValue,
148148
DynamicAllocLValue>
149149
PtrTy;

clang/include/clang/Basic/Attr.td

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4932,6 +4932,7 @@ def HLSLResourceBinding: InheritableAttr {
49324932
return SpaceNumber;
49334933
}
49344934
void setImplicitBindingOrderID(uint32_t Value) {
4935+
assert(!hasImplicitBindingOrderID() && "attribute already has implicit binding order id");
49354936
ImplicitBindingOrderID = Value;
49364937
}
49374938
bool hasImplicitBindingOrderID() const {

clang/include/clang/Basic/Builtins.td

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,13 +1300,13 @@ def ElementwiseBitreverse : Builtin {
13001300

13011301
def ElementwiseMax : Builtin {
13021302
let Spellings = ["__builtin_elementwise_max"];
1303-
let Attributes = [NoThrow, Const, CustomTypeChecking];
1303+
let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
13041304
let Prototype = "void(...)";
13051305
}
13061306

13071307
def ElementwiseMin : Builtin {
13081308
let Spellings = ["__builtin_elementwise_min"];
1309-
let Attributes = [NoThrow, Const, CustomTypeChecking];
1309+
let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];
13101310
let Prototype = "void(...)";
13111311
}
13121312

@@ -1514,6 +1514,18 @@ def ElementwiseSubSat : Builtin {
15141514
let Prototype = "void(...)";
15151515
}
15161516

1517+
def ElementwiseFshl : Builtin {
1518+
let Spellings = ["__builtin_elementwise_fshl"];
1519+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1520+
let Prototype = "void(...)";
1521+
}
1522+
1523+
def ElementwiseFshr : Builtin {
1524+
let Spellings = ["__builtin_elementwise_fshr"];
1525+
let Attributes = [NoThrow, Const, CustomTypeChecking];
1526+
let Prototype = "void(...)";
1527+
}
1528+
15171529
def ReduceMax : Builtin {
15181530
let Spellings = ["__builtin_reduce_max"];
15191531
let Attributes = [NoThrow, Const, CustomTypeChecking, Constexpr];

clang/include/clang/Basic/BuiltinsAMDGPU.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,9 @@ TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal, "vIi", "n", "gfx12-insts")
503503
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal_var, "vv*i", "n", "gfx12-insts")
504504
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_wait, "vIs", "n", "gfx12-insts")
505505
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_signal_isfirst, "bIi", "n", "gfx12-insts")
506+
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_init, "vv*i", "n", "gfx12-insts")
507+
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_join, "vv*", "n", "gfx12-insts")
508+
TARGET_BUILTIN(__builtin_amdgcn_s_barrier_leave, "vIs", "n", "gfx12-insts")
506509
TARGET_BUILTIN(__builtin_amdgcn_s_get_barrier_state, "Uii", "n", "gfx12-insts")
507510
TARGET_BUILTIN(__builtin_amdgcn_s_get_named_barrier_state, "Uiv*", "n", "gfx12-insts")
508511
TARGET_BUILTIN(__builtin_amdgcn_s_prefetch_data, "vvC*Ui", "nc", "gfx12-insts")

0 commit comments

Comments
 (0)