Skip to content

Commit 1facbe8

Browse files
authored
Merge branch 'main' into x86-movemask-constexpr
2 parents b215828 + bd6ed29 commit 1facbe8

File tree

392 files changed

+12581
-6432
lines changed

Some content is hidden

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

392 files changed

+12581
-6432
lines changed

.ci/generate_test_report_lib.py

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,23 @@ def _format_ninja_failures(ninja_failures: list[tuple[str, str]]) -> list[str]:
9898
)
9999
return output
100100

101+
def get_failures(junit_objects) -> dict[str, list[tuple[str, str]]]:
102+
failures = {}
103+
for results in junit_objects:
104+
for testsuite in results:
105+
for test in testsuite:
106+
if (
107+
not test.is_passed
108+
and test.result
109+
and isinstance(test.result[0], Failure)
110+
):
111+
if failures.get(testsuite.name) is None:
112+
failures[testsuite.name] = []
113+
failures[testsuite.name].append(
114+
(test.classname + "/" + test.name, test.result[0].text)
115+
)
116+
return failures
117+
101118

102119
# Set size_limit to limit the byte size of the report. The default is 1MB as this
103120
# is the most that can be put into an annotation. If the generated report exceeds
@@ -113,7 +130,7 @@ def generate_report(
113130
size_limit=1024 * 1024,
114131
list_failures=True,
115132
):
116-
failures = {}
133+
failures = get_failures(junit_objects)
117134
tests_run = 0
118135
tests_skipped = 0
119136
tests_failed = 0
@@ -124,18 +141,6 @@ def generate_report(
124141
tests_skipped += testsuite.skipped
125142
tests_failed += testsuite.failures
126143

127-
for test in testsuite:
128-
if (
129-
not test.is_passed
130-
and test.result
131-
and isinstance(test.result[0], Failure)
132-
):
133-
if failures.get(testsuite.name) is None:
134-
failures[testsuite.name] = []
135-
failures[testsuite.name].append(
136-
(test.classname + "/" + test.name, test.result[0].text)
137-
)
138-
139144
report = [f"# {title}", ""]
140145

141146
if tests_run == 0:
@@ -258,7 +263,7 @@ def plural(num_tests):
258263
return report
259264

260265

261-
def generate_report_from_files(title, return_code, build_log_files):
266+
def load_info_from_files(build_log_files):
262267
junit_files = [
263268
junit_file for junit_file in build_log_files if junit_file.endswith(".xml")
264269
]
@@ -271,6 +276,9 @@ def generate_report_from_files(title, return_code, build_log_files):
271276
ninja_logs.append(
272277
[log_line.strip() for log_line in ninja_log_file_handle.readlines()]
273278
)
274-
return generate_report(
275-
title, return_code, [JUnitXml.fromfile(p) for p in junit_files], ninja_logs
276-
)
279+
return [JUnitXml.fromfile(p) for p in junit_files], ninja_logs
280+
281+
282+
def generate_report_from_files(title, return_code, build_log_files):
283+
junit_objects, ninja_logs = load_info_from_files(build_log_files)
284+
return generate_report(title, return_code, junit_objects, ninja_logs)

bolt/include/bolt/Passes/PLTCall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class PLTCall : public BinaryFunctionPass {
2626
explicit PLTCall(const cl::opt<bool> &PrintPass)
2727
: BinaryFunctionPass(PrintPass) {}
2828

29-
const char *getName() const override { return "PLT call optimization"; }
29+
const char *getName() const override { return "plt-call-optimization"; }
3030
bool shouldPrint(const BinaryFunction &BF) const override {
3131
return BinaryFunctionPass::shouldPrint(BF);
3232
}

bolt/include/bolt/Passes/TailDuplication.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class TailDuplication : public BinaryFunctionPass {
143143

144144
explicit TailDuplication() : BinaryFunctionPass(false) {}
145145

146-
const char *getName() const override { return "tail duplication"; }
146+
const char *getName() const override { return "tail-duplication"; }
147147

148148
Error runOnFunctions(BinaryContext &BC) override;
149149
};

clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,17 @@ static unsigned getLength(const Expr *E,
6464
if (!E)
6565
return 0;
6666

67-
Expr::EvalResult Length;
6867
E = E->IgnoreImpCasts();
6968

7069
if (const auto *LengthDRE = dyn_cast<DeclRefExpr>(E))
7170
if (const auto *LengthVD = dyn_cast<VarDecl>(LengthDRE->getDecl()))
7271
if (!isa<ParmVarDecl>(LengthVD))
73-
if (const Expr *LengthInit = LengthVD->getInit())
72+
if (const Expr *LengthInit = LengthVD->getInit();
73+
LengthInit && !LengthInit->isValueDependent()) {
74+
Expr::EvalResult Length;
7475
if (LengthInit->EvaluateAsInt(Length, *Result.Context))
7576
return Length.Val.getInt().getZExtValue();
77+
}
7678

7779
if (const auto *LengthIL = dyn_cast<IntegerLiteral>(E))
7880
return LengthIL->getValue().getZExtValue();

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ Changes in existing checks
274274
<clang-tidy/checks/bugprone/narrowing-conversions>` check by fixing
275275
false positive from analysis of a conditional expression in C.
276276

277+
- Improved :doc:`bugprone-not-null-terminated-result
278+
<clang-tidy/checks/bugprone/not-null-terminated-result>` check by fixing
279+
a crash caused by certain value-dependent expressions.
280+
277281
- Improved :doc:`bugprone-reserved-identifier
278282
<clang-tidy/checks/bugprone/reserved-identifier>` check by ignoring
279283
declarations and macros in system headers.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %check_clang_tidy %s bugprone-not-null-terminated-result %t -- \
2+
// RUN: -- -std=c++17 -I %S/Inputs/not-null-terminated-result
3+
4+
// This test case reproduces the crash when the check tries to evaluate
5+
// a value-dependent expression using EvaluateAsInt() in
6+
// bugprone-not-null-terminated-result, where the src parameter of memcpy is
7+
// value-dependent, but the length is not.
8+
9+
// expected-no-diagnostics
10+
11+
#include "not-null-terminated-result-cxx.h"
12+
13+
template<size_t N>
14+
class ValueDependentClass {
15+
public:
16+
void copyData(char* Dst) {
17+
const char* Src = reinterpret_cast<const char*>(this);
18+
// The length parameter is arbitrary, but the crash is not reproduced if it is N.
19+
memcpy(Dst, Src, 32);
20+
}
21+
};
22+
23+
template class ValueDependentClass<42>; // The template parameter value is arbitrary.

clang/docs/PointerAuthentication.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,36 @@ The result value is never zero and always within range for both the
592592

593593
This can be used in constant expressions.
594594

595+
``ptrauth_type_discriminator``
596+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
597+
598+
.. code-block:: c
599+
600+
ptrauth_type_discriminator(type)
601+
602+
Compute the constant discriminator derived from the given type, as is computed
603+
for automatically type diversified schemas.
604+
605+
``type`` must be a type. The result has the type ``ptrauth_extra_data_t``.
606+
607+
This can be used in constant expressions.
608+
609+
``ptrauth_function_pointer_type_discriminator``
610+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
611+
612+
.. code-block:: c
613+
614+
ptrauth_function_pointer_type_discriminator(function_type)
615+
616+
Compute the constant discriminator derived from the provided function type, for
617+
use in contexts where the default function authentication schema. If function
618+
pointer type diversity is enabled, this is equivalent to
619+
`ptrauth_type_discriminator(function_type)`, if it is not enabled this is `0`.
620+
621+
``function_type`` must be a function type. The result has the type ``ptrauth_extra_data_t``.
622+
623+
This can be used in constant expressions.
624+
595625
``ptrauth_strip``
596626
^^^^^^^^^^^^^^^^^
597627

clang/docs/ReleaseNotes.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ C23 Feature Support
191191
- Added ``FLT_SNAN``, ``DBL_SNAN``, and ``LDBL_SNAN`` to Clang's ``<float.h>``
192192
header in C23 and later modes. This implements
193193
`WG14 N2710 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2710.htm>`_.
194+
- Fixed accepting as compatible unnamed tag types with the same fields within
195+
the same translation unit but from different types.
194196

195197
Non-comprehensive list of changes in this release
196198
-------------------------------------------------
@@ -274,7 +276,7 @@ New Compiler Flags
274276
- New option ``-fno-sanitize-debug-trap-reasons`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
275277
- New option ``-fsanitize-debug-trap-reasons=`` added to control emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
276278
- New options for enabling allocation token instrumentation: ``-fsanitize=alloc-token``, ``-falloc-token-max=``, ``-fsanitize-alloc-token-fast-abi``, ``-fsanitize-alloc-token-extended``.
277-
279+
- The ``-resource-dir`` option is now displayed in the list of options shown by ``--help``.
278280

279281
Lanai Support
280282
^^^^^^^^^^^^^^
@@ -411,6 +413,7 @@ Bug Fixes in This Version
411413
(#GH159080)
412414
- Fixed a failed assertion with empty filename arguments in ``__has_embed``. (#GH159898)
413415
- Fixed a failed assertion with empty filename in ``#embed`` directive. (#GH162951)
416+
- Fixed a crash triggered by unterminated ``__has_embed``. (#GH162953)
414417

415418
Bug Fixes to Compiler Builtins
416419
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -424,7 +427,8 @@ Bug Fixes to Attribute Support
424427
(#GH141504) and on types returned from indirect calls (#GH142453).
425428
- Fixes some late parsed attributes, when applied to function definitions, not being parsed
426429
in function try blocks, and some situations where parsing of the function body
427-
is skipped, such as error recovery and code completion. (#GH153551)
430+
is skipped, such as error recovery, code completion, and msvc-compatible delayed
431+
template parsing. (#GH153551)
428432
- Using ``[[gnu::cleanup(some_func)]]`` where some_func is annotated with
429433
``[[gnu::error("some error")]]`` now correctly triggers an error. (#GH146520)
430434
- Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075)
@@ -513,6 +517,7 @@ X86 Support
513517
driver.
514518
- Remove `[no-]evex512` feature request from intrinsics and builtins.
515519
- Change features `avx10.x-[256,512]` to `avx10.x`.
520+
- `-march=wildcatlake` is now supported.
516521

517522
Arm and AArch64 Support
518523
^^^^^^^^^^^^^^^^^^^^^^^

clang/docs/UsersManual.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,7 +2325,7 @@ are listed below.
23252325
devirtualization and virtual constant propagation, for classes with
23262326
:doc:`hidden LTO visibility <LTOVisibility>`. Requires ``-flto``.
23272327

2328-
.. option:: -f[no]split-lto-unit
2328+
.. option:: -f[no-]split-lto-unit
23292329

23302330
Controls splitting the :doc:`LTO unit <LTOVisibility>` into regular LTO and
23312331
:doc:`ThinLTO` portions, when compiling with -flto=thin. Defaults to false
@@ -2518,7 +2518,7 @@ are listed below.
25182518

25192519
.. _funique_internal_linkage_names:
25202520

2521-
.. option:: -f[no]-unique-internal-linkage-names
2521+
.. option:: -f[no-]unique-internal-linkage-names
25222522

25232523
Controls whether Clang emits a unique (best-effort) symbol name for internal
25242524
linkage symbols. When this option is set, compiler hashes the main source
@@ -2539,7 +2539,7 @@ are listed below.
25392539
$ cd $P/bar && clang -c -funique-internal-linkage-names name_conflict.c
25402540
$ cd $P && clang foo/name_conflict.o && bar/name_conflict.o
25412541
2542-
.. option:: -f[no]-basic-block-address-map:
2542+
.. option:: -f[no-]basic-block-address-map:
25432543
Emits a ``SHT_LLVM_BB_ADDR_MAP`` section which includes address offsets for each
25442544
basic block in the program, relative to the parent function address.
25452545

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<128>] in {
125125

126126
let Features = "ssse3" in {
127127
def pmulhrsw128 : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>)">;
128-
def pshufb128 : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<16, char>)">;
129128
def psignb128 : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<16, char>)">;
130129
def psignw128 : X86Builtin<"_Vector<8, short>(_Vector<8, short>, _Vector<8, short>)">;
131130
def psignd128 : X86Builtin<"_Vector<4, int>(_Vector<4, int>, _Vector<4, int>)">;
132131
}
133132

134133
let Features = "ssse3", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<128>] in {
135134
def pmaddubsw128 : X86Builtin<"_Vector<8, short>(_Vector<16, char>, _Vector<16, char>)">;
135+
def pshufb128 : X86Builtin<"_Vector<16, char>(_Vector<16, char>, _Vector<16, char>)">;
136136
}
137137
}
138138

@@ -604,7 +604,6 @@ let Features = "avx2", Attributes = [NoThrow, Const, RequiredVectorWidth<256>] i
604604
"_Vector<32, char>, _Constant int)">;
605605
def pmulhrsw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;
606606
def psadbw256 : X86Builtin<"_Vector<4, long long int>(_Vector<32, char>, _Vector<32, char>)">;
607-
def pshufb256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>)">;
608607
def psignb256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>)">;
609608
def psignw256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, _Vector<16, short>)">;
610609
def psignd256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, _Vector<8, int>)">;
@@ -644,6 +643,8 @@ let Features = "avx2", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWi
644643
def pmuldq256 : X86Builtin<"_Vector<4, long long int>(_Vector<8, int>, _Vector<8, int>)">;
645644
def pmuludq256 : X86Builtin<"_Vector<4, long long int>(_Vector<8, int>, _Vector<8, int>)">;
646645

646+
def pshufb256 : X86Builtin<"_Vector<32, char>(_Vector<32, char>, _Vector<32, char>)">;
647+
647648
def psllwi256 : X86Builtin<"_Vector<16, short>(_Vector<16, short>, int)">;
648649
def pslldi256 : X86Builtin<"_Vector<8, int>(_Vector<8, int>, int)">;
649650
def psllqi256 : X86Builtin<"_Vector<4, long long int>(_Vector<4, long long int>, int)">;
@@ -1342,14 +1343,15 @@ let Features = "avx512f", Attributes = [NoThrow, Const, RequiredVectorWidth<512>
13421343

13431344
let Features = "avx512bw", Attributes = [NoThrow, Const, RequiredVectorWidth<512>] in {
13441345
def ucmpw512_mask : X86Builtin<"unsigned int(_Vector<32, short>, _Vector<32, short>, _Constant int, unsigned int)">;
1345-
def pshufb512 : X86Builtin<"_Vector<64, char>(_Vector<64, char>, _Vector<64, char>)">;
13461346
}
13471347

13481348
let Features = "avx512bw", Attributes = [NoThrow, Const, Constexpr, RequiredVectorWidth<512>] in {
13491349
def packsswb512 : X86Builtin<"_Vector<64, char>(_Vector<32, short>, _Vector<32, short>)">;
13501350
def packssdw512 : X86Builtin<"_Vector<32, short>(_Vector<16, int>, _Vector<16, int>)">;
13511351
def packuswb512 : X86Builtin<"_Vector<64, char>(_Vector<32, short>, _Vector<32, short>)">;
13521352
def packusdw512 : X86Builtin<"_Vector<32, short>(_Vector<16, int>, _Vector<16, int>)">;
1353+
1354+
def pshufb512 : X86Builtin<"_Vector<64, char>(_Vector<64, char>, _Vector<64, char>)">;
13531355
}
13541356

13551357
let Features = "avx512cd,avx512vl", Attributes = [NoThrow, Const, RequiredVectorWidth<128>] in {

0 commit comments

Comments
 (0)