Skip to content

Commit d1314f0

Browse files
SC llvm teamSC llvm team
SC llvm team
authored and
SC llvm team
committed
Merged main:998bdae7f5ce into amd-gfx:1f2edbe54368
Local branch amd-gfx 1f2edbe Merged main:6230f1ba945a into amd-gfx:76cd6fb61a94 Remote branch main 998bdae [MLGO] Only configure tests with LLVM_INCLUDE_TESTS (llvm#121293)
2 parents 1f2edbe + 998bdae commit d1314f0

File tree

24 files changed

+396
-129
lines changed

24 files changed

+396
-129
lines changed

clang/docs/ClangFormatStyleOptions.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,11 @@ the configuration (without a prefix: ``Auto``).
20882088
If ``true``, ``while (true) continue;`` can be put on a single
20892089
line.
20902090

2091+
.. _AllowShortNamespacesOnASingleLine:
2092+
2093+
**AllowShortNamespacesOnASingleLine** (``Boolean``) :versionbadge:`clang-format 20` :ref:`<AllowShortNamespacesOnASingleLine>`
2094+
If ``true``, ``namespace a { class b; }`` can be put on a single line.
2095+
20912096
.. _AlwaysBreakAfterDefinitionReturnType:
20922097

20932098
**AlwaysBreakAfterDefinitionReturnType** (``DefinitionReturnTypeBreakingStyle``) :versionbadge:`clang-format 3.7` :ref:`<AlwaysBreakAfterDefinitionReturnType>`

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,7 @@ clang-format
11231123
``Never``, and ``true`` to ``Always``.
11241124
- Adds ``RemoveEmptyLinesInUnwrappedLines`` option.
11251125
- Adds ``KeepFormFeed`` option and set it to ``true`` for ``GNU`` style.
1126+
- Adds ``AllowShortNamespacesOnASingleLine`` option.
11261127

11271128
libclang
11281129
--------

clang/include/clang/Format/Format.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,10 @@ struct FormatStyle {
988988
/// \version 3.7
989989
bool AllowShortLoopsOnASingleLine;
990990

991+
/// If ``true``, ``namespace a { class b; }`` can be put on a single line.
992+
/// \version 20
993+
bool AllowShortNamespacesOnASingleLine;
994+
991995
/// Different ways to break after the function definition return type.
992996
/// This option is **deprecated** and is retained for backwards compatibility.
993997
enum DefinitionReturnTypeBreakingStyle : int8_t {
@@ -5168,6 +5172,8 @@ struct FormatStyle {
51685172
R.AllowShortIfStatementsOnASingleLine &&
51695173
AllowShortLambdasOnASingleLine == R.AllowShortLambdasOnASingleLine &&
51705174
AllowShortLoopsOnASingleLine == R.AllowShortLoopsOnASingleLine &&
5175+
AllowShortNamespacesOnASingleLine ==
5176+
R.AllowShortNamespacesOnASingleLine &&
51715177
AlwaysBreakBeforeMultilineStrings ==
51725178
R.AlwaysBreakBeforeMultilineStrings &&
51735179
AttributeMacros == R.AttributeMacros &&

clang/lib/Format/Format.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,8 @@ template <> struct MappingTraits<FormatStyle> {
975975
Style.AllowShortLambdasOnASingleLine);
976976
IO.mapOptional("AllowShortLoopsOnASingleLine",
977977
Style.AllowShortLoopsOnASingleLine);
978+
IO.mapOptional("AllowShortNamespacesOnASingleLine",
979+
Style.AllowShortNamespacesOnASingleLine);
978980
IO.mapOptional("AlwaysBreakAfterDefinitionReturnType",
979981
Style.AlwaysBreakAfterDefinitionReturnType);
980982
IO.mapOptional("AlwaysBreakBeforeMultilineStrings",
@@ -1480,6 +1482,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
14801482
LLVMStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
14811483
LLVMStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All;
14821484
LLVMStyle.AllowShortLoopsOnASingleLine = false;
1485+
LLVMStyle.AllowShortNamespacesOnASingleLine = false;
14831486
LLVMStyle.AlwaysBreakAfterDefinitionReturnType = FormatStyle::DRTBS_None;
14841487
LLVMStyle.AlwaysBreakBeforeMultilineStrings = false;
14851488
LLVMStyle.AttributeMacros.push_back("__capability");

clang/lib/Format/UnwrappedLineFormatter.cpp

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,18 @@ class LineJoiner {
361361
const auto *FirstNonComment = TheLine->getFirstNonComment();
362362
if (!FirstNonComment)
363363
return 0;
364+
364365
// FIXME: There are probably cases where we should use FirstNonComment
365366
// instead of TheLine->First.
366367

368+
if (Style.AllowShortNamespacesOnASingleLine &&
369+
TheLine->First->is(tok::kw_namespace) &&
370+
TheLine->Last->is(tok::l_brace)) {
371+
const auto result = tryMergeNamespace(I, E, Limit);
372+
if (result > 0)
373+
return result;
374+
}
375+
367376
if (Style.CompactNamespaces) {
368377
if (const auto *NSToken = TheLine->First->getNamespaceToken()) {
369378
int J = 1;
@@ -373,7 +382,7 @@ class LineJoiner {
373382
ClosingLineIndex == I[J]->MatchingClosingBlockLineIndex &&
374383
I[J]->Last->TotalLength < Limit;
375384
++J, --ClosingLineIndex) {
376-
Limit -= I[J]->Last->TotalLength;
385+
Limit -= I[J]->Last->TotalLength + 1;
377386

378387
// Reduce indent level for bodies of namespaces which were compacted,
379388
// but only if their content was indented in the first place.
@@ -420,6 +429,7 @@ class LineJoiner {
420429
TheLine->First != LastNonComment) {
421430
return MergeShortFunctions ? tryMergeSimpleBlock(I, E, Limit) : 0;
422431
}
432+
423433
// Try to merge a control statement block with left brace unwrapped.
424434
if (TheLine->Last->is(tok::l_brace) && FirstNonComment != TheLine->Last &&
425435
FirstNonComment->isOneOf(tok::kw_if, tok::kw_while, tok::kw_for,
@@ -616,6 +626,72 @@ class LineJoiner {
616626
return 1;
617627
}
618628

629+
unsigned tryMergeNamespace(SmallVectorImpl<AnnotatedLine *>::const_iterator I,
630+
SmallVectorImpl<AnnotatedLine *>::const_iterator E,
631+
unsigned Limit) {
632+
if (Limit == 0)
633+
return 0;
634+
635+
assert(I[1]);
636+
const auto &L1 = *I[1];
637+
if (L1.InPPDirective != (*I)->InPPDirective ||
638+
(L1.InPPDirective && L1.First->HasUnescapedNewline)) {
639+
return 0;
640+
}
641+
642+
if (std::distance(I, E) <= 2)
643+
return 0;
644+
645+
assert(I[2]);
646+
const auto &L2 = *I[2];
647+
if (L2.Type == LT_Invalid)
648+
return 0;
649+
650+
Limit = limitConsideringMacros(I + 1, E, Limit);
651+
652+
if (!nextTwoLinesFitInto(I, Limit))
653+
return 0;
654+
655+
// Check if it's a namespace inside a namespace, and call recursively if so.
656+
// '3' is the sizes of the whitespace and closing brace for " _inner_ }".
657+
if (L1.First->is(tok::kw_namespace)) {
658+
if (L1.Last->is(tok::comment) || !Style.CompactNamespaces)
659+
return 0;
660+
661+
assert(Limit >= L1.Last->TotalLength + 3);
662+
const auto InnerLimit = Limit - L1.Last->TotalLength - 3;
663+
const auto MergedLines = tryMergeNamespace(I + 1, E, InnerLimit);
664+
if (MergedLines == 0)
665+
return 0;
666+
const auto N = MergedLines + 2;
667+
// Check if there is even a line after the inner result.
668+
if (std::distance(I, E) <= N)
669+
return 0;
670+
// Check that the line after the inner result starts with a closing brace
671+
// which we are permitted to merge into one line.
672+
if (I[N]->First->is(tok::r_brace) && !I[N]->First->MustBreakBefore &&
673+
I[MergedLines + 1]->Last->isNot(tok::comment) &&
674+
nextNLinesFitInto(I, I + N + 1, Limit)) {
675+
return N;
676+
}
677+
return 0;
678+
}
679+
680+
// There's no inner namespace, so we are considering to merge at most one
681+
// line.
682+
683+
// The line which is in the namespace should end with semicolon.
684+
if (L1.Last->isNot(tok::semi))
685+
return 0;
686+
687+
// Last, check that the third line starts with a closing brace.
688+
if (L2.First->isNot(tok::r_brace) || L2.First->MustBreakBefore)
689+
return 0;
690+
691+
// If so, merge all three lines.
692+
return 2;
693+
}
694+
619695
unsigned tryMergeSimpleControlStatement(
620696
SmallVectorImpl<AnnotatedLine *>::const_iterator I,
621697
SmallVectorImpl<AnnotatedLine *>::const_iterator E, unsigned Limit) {
@@ -916,6 +992,21 @@ class LineJoiner {
916992
return 1 + I[1]->Last->TotalLength + 1 + I[2]->Last->TotalLength <= Limit;
917993
}
918994

995+
bool nextNLinesFitInto(SmallVectorImpl<AnnotatedLine *>::const_iterator I,
996+
SmallVectorImpl<AnnotatedLine *>::const_iterator E,
997+
unsigned Limit) {
998+
unsigned JoinedLength = 0;
999+
for (const auto *J = I + 1; J != E; ++J) {
1000+
if ((*J)->First->MustBreakBefore)
1001+
return false;
1002+
1003+
JoinedLength += 1 + (*J)->Last->TotalLength;
1004+
if (JoinedLength > Limit)
1005+
return false;
1006+
}
1007+
return true;
1008+
}
1009+
9191010
bool containsMustBreak(const AnnotatedLine *Line) {
9201011
assert(Line->First);
9211012
// Ignore the first token, because in this situation, it applies more to the
Lines changed: 79 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
12
// RUN: %clang_cc1 -fenable-matrix %s -emit-llvm -triple x86_64-unknown-linux -disable-llvm-passes -o - -std=c++11 | FileCheck %s
23

34
using i8x3 = _BitInt(8) __attribute__((ext_vector_type(3)));
@@ -7,92 +8,104 @@ using i32x3x3 = _BitInt(32) __attribute__((matrix_type(3, 3)));
78
using i512x3 = _BitInt(512) __attribute__((ext_vector_type(3)));
89
using i512x3x3 = _BitInt(512) __attribute__((matrix_type(3, 3)));
910

10-
// CHECK-LABEL: define dso_local i32 @_Z2v1Dv3_DB8_(i32 %a.coerce)
11+
// CHECK-LABEL: define dso_local i32 @_Z2v1Dv3_DB8_(
12+
// CHECK-SAME: i32 [[A_COERCE:%.*]]) #[[ATTR0:[0-9]+]] {
13+
// CHECK-NEXT: [[ENTRY:.*:]]
14+
// CHECK-NEXT: [[RETVAL:%.*]] = alloca <3 x i8>, align 4
15+
// CHECK-NEXT: [[A:%.*]] = alloca <3 x i8>, align 4
16+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca <3 x i8>, align 4
17+
// CHECK-NEXT: store i32 [[A_COERCE]], ptr [[A]], align 4
18+
// CHECK-NEXT: [[LOADVEC4:%.*]] = load <4 x i8>, ptr [[A]], align 4
19+
// CHECK-NEXT: [[A1:%.*]] = shufflevector <4 x i8> [[LOADVEC4]], <4 x i8> poison, <3 x i32> <i32 0, i32 1, i32 2>
20+
// CHECK-NEXT: [[EXTRACTVEC:%.*]] = shufflevector <3 x i8> [[A1]], <3 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
21+
// CHECK-NEXT: store <4 x i8> [[EXTRACTVEC]], ptr [[A_ADDR]], align 4
22+
// CHECK-NEXT: [[LOADVEC42:%.*]] = load <4 x i8>, ptr [[A_ADDR]], align 4
23+
// CHECK-NEXT: [[EXTRACTVEC3:%.*]] = shufflevector <4 x i8> [[LOADVEC42]], <4 x i8> poison, <3 x i32> <i32 0, i32 1, i32 2>
24+
// CHECK-NEXT: [[LOADVEC44:%.*]] = load <4 x i8>, ptr [[A_ADDR]], align 4
25+
// CHECK-NEXT: [[EXTRACTVEC5:%.*]] = shufflevector <4 x i8> [[LOADVEC44]], <4 x i8> poison, <3 x i32> <i32 0, i32 1, i32 2>
26+
// CHECK-NEXT: [[ADD:%.*]] = add <3 x i8> [[EXTRACTVEC3]], [[EXTRACTVEC5]]
27+
// CHECK-NEXT: store <3 x i8> [[ADD]], ptr [[RETVAL]], align 4
28+
// CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[RETVAL]], align 4
29+
// CHECK-NEXT: ret i32 [[TMP0]]
30+
//
1131
i8x3 v1(i8x3 a) {
12-
// CHECK-NEXT: entry:
13-
// CHECK-NEXT: %retval = alloca <3 x i8>, align 4
14-
// CHECK-NEXT: %a = alloca <3 x i8>, align 4
15-
// CHECK-NEXT: %a.addr = alloca <3 x i8>, align 4
16-
// CHECK-NEXT: store i32 %a.coerce, ptr %a, align 4
17-
// CHECK-NEXT: %loadVec4 = load <4 x i8>, ptr %a, align 4
18-
// CHECK-NEXT: %a1 = shufflevector <4 x i8> %loadVec4, <4 x i8> poison, <3 x i32> <i32 0, i32 1, i32 2>
19-
// CHECK-NEXT: %extractVec = shufflevector <3 x i8> %a1, <3 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
20-
// CHECK-NEXT: store <4 x i8> %extractVec, ptr %a.addr, align 4
21-
// CHECK-NEXT: %loadVec42 = load <4 x i8>, ptr %a.addr, align 4
22-
// CHECK-NEXT: %extractVec3 = shufflevector <4 x i8> %loadVec42, <4 x i8> poison, <3 x i32> <i32 0, i32 1, i32 2>
23-
// CHECK-NEXT: %loadVec44 = load <4 x i8>, ptr %a.addr, align 4
24-
// CHECK-NEXT: %extractVec5 = shufflevector <4 x i8> %loadVec44, <4 x i8> poison, <3 x i32> <i32 0, i32 1, i32 2>
25-
// CHECK-NEXT: %add = add <3 x i8> %extractVec3, %extractVec5
26-
// CHECK-NEXT: store <3 x i8> %add, ptr %retval, align 4
27-
// CHECK-NEXT: %0 = load i32, ptr %retval, align 4
28-
// CHECK-NEXT: ret i32 %0
2932
return a + a;
3033
}
3134

32-
// CHECK-LABEL: define dso_local noundef <3 x i32> @_Z2v2Dv3_DB32_(<3 x i32> noundef %a)
35+
// CHECK-LABEL: define dso_local noundef <3 x i32> @_Z2v2Dv3_DB32_(
36+
// CHECK-SAME: <3 x i32> noundef [[A:%.*]]) #[[ATTR1:[0-9]+]] {
37+
// CHECK-NEXT: [[ENTRY:.*:]]
38+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca <3 x i32>, align 16
39+
// CHECK-NEXT: [[EXTRACTVEC:%.*]] = shufflevector <3 x i32> [[A]], <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
40+
// CHECK-NEXT: store <4 x i32> [[EXTRACTVEC]], ptr [[A_ADDR]], align 16
41+
// CHECK-NEXT: [[LOADVEC4:%.*]] = load <4 x i32>, ptr [[A_ADDR]], align 16
42+
// CHECK-NEXT: [[EXTRACTVEC1:%.*]] = shufflevector <4 x i32> [[LOADVEC4]], <4 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>
43+
// CHECK-NEXT: [[LOADVEC42:%.*]] = load <4 x i32>, ptr [[A_ADDR]], align 16
44+
// CHECK-NEXT: [[EXTRACTVEC3:%.*]] = shufflevector <4 x i32> [[LOADVEC42]], <4 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>
45+
// CHECK-NEXT: [[ADD:%.*]] = add <3 x i32> [[EXTRACTVEC1]], [[EXTRACTVEC3]]
46+
// CHECK-NEXT: ret <3 x i32> [[ADD]]
47+
//
3348
i32x3 v2(i32x3 a) {
34-
// CHECK-NEXT: entry:
35-
// CHECK-NEXT: %a.addr = alloca <3 x i32>, align 16
36-
// CHECK-NEXT: %extractVec = shufflevector <3 x i32> %a, <3 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
37-
// CHECK-NEXT: store <4 x i32> %extractVec, ptr %a.addr, align 16
38-
// CHECK-NEXT: %loadVec4 = load <4 x i32>, ptr %a.addr, align 16
39-
// CHECK-NEXT: %extractVec1 = shufflevector <4 x i32> %loadVec4, <4 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>
40-
// CHECK-NEXT: %loadVec42 = load <4 x i32>, ptr %a.addr, align 16
41-
// CHECK-NEXT: %extractVec3 = shufflevector <4 x i32> %loadVec42, <4 x i32> poison, <3 x i32> <i32 0, i32 1, i32 2>
42-
// CHECK-NEXT: %add = add <3 x i32> %extractVec1, %extractVec3
43-
// CHECK-NEXT: ret <3 x i32> %add
4449
return a + a;
4550
}
4651

47-
// CHECK-LABEL: define dso_local noundef <3 x i512> @_Z2v3Dv3_DB512_(ptr noundef byval(<3 x i512>) align 256 %0)
52+
// CHECK-LABEL: define dso_local noundef <3 x i512> @_Z2v3Dv3_DB512_(
53+
// CHECK-SAME: ptr noundef byval(<3 x i512>) align 256 [[TMP0:%.*]]) #[[ATTR2:[0-9]+]] {
54+
// CHECK-NEXT: [[ENTRY:.*:]]
55+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca <3 x i512>, align 256
56+
// CHECK-NEXT: [[LOADVEC4:%.*]] = load <4 x i512>, ptr [[TMP0]], align 256
57+
// CHECK-NEXT: [[A:%.*]] = shufflevector <4 x i512> [[LOADVEC4]], <4 x i512> poison, <3 x i32> <i32 0, i32 1, i32 2>
58+
// CHECK-NEXT: [[EXTRACTVEC:%.*]] = shufflevector <3 x i512> [[A]], <3 x i512> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
59+
// CHECK-NEXT: store <4 x i512> [[EXTRACTVEC]], ptr [[A_ADDR]], align 256
60+
// CHECK-NEXT: [[LOADVEC41:%.*]] = load <4 x i512>, ptr [[A_ADDR]], align 256
61+
// CHECK-NEXT: [[EXTRACTVEC2:%.*]] = shufflevector <4 x i512> [[LOADVEC41]], <4 x i512> poison, <3 x i32> <i32 0, i32 1, i32 2>
62+
// CHECK-NEXT: [[LOADVEC43:%.*]] = load <4 x i512>, ptr [[A_ADDR]], align 256
63+
// CHECK-NEXT: [[EXTRACTVEC4:%.*]] = shufflevector <4 x i512> [[LOADVEC43]], <4 x i512> poison, <3 x i32> <i32 0, i32 1, i32 2>
64+
// CHECK-NEXT: [[ADD:%.*]] = add <3 x i512> [[EXTRACTVEC2]], [[EXTRACTVEC4]]
65+
// CHECK-NEXT: ret <3 x i512> [[ADD]]
66+
//
4867
i512x3 v3(i512x3 a) {
49-
// CHECK-NEXT: entry:
50-
// CHECK-NEXT: %a.addr = alloca <3 x i512>, align 256
51-
// CHECK-NEXT: %loadVec4 = load <4 x i512>, ptr %0, align 256
52-
// CHECK-NEXT: %a = shufflevector <4 x i512> %loadVec4, <4 x i512> poison, <3 x i32> <i32 0, i32 1, i32 2>
53-
// CHECK-NEXT: %extractVec = shufflevector <3 x i512> %a, <3 x i512> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
54-
// CHECK-NEXT: store <4 x i512> %extractVec, ptr %a.addr, align 256
55-
// CHECK-NEXT: %loadVec41 = load <4 x i512>, ptr %a.addr, align 256
56-
// CHECK-NEXT: %extractVec2 = shufflevector <4 x i512> %loadVec41, <4 x i512> poison, <3 x i32> <i32 0, i32 1, i32 2>
57-
// CHECK-NEXT: %loadVec43 = load <4 x i512>, ptr %a.addr, align 256
58-
// CHECK-NEXT: %extractVec4 = shufflevector <4 x i512> %loadVec43, <4 x i512> poison, <3 x i32> <i32 0, i32 1, i32 2>
59-
// CHECK-NEXT: %add = add <3 x i512> %extractVec2, %extractVec4
60-
// CHECK-NEXT: ret <3 x i512> %add
6168
return a + a;
6269
}
6370

64-
// CHECK-LABEL: define dso_local noundef <9 x i8> @_Z2m1u11matrix_typeILm3ELm3EDB8_E(<9 x i8> noundef %a)
71+
// CHECK-LABEL: define dso_local noundef <9 x i8> @_Z2m1u11matrix_typeILm3ELm3EDB8_E(
72+
// CHECK-SAME: <9 x i8> noundef [[A:%.*]]) #[[ATTR3:[0-9]+]] {
73+
// CHECK-NEXT: [[ENTRY:.*:]]
74+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca [9 x i8], align 1
75+
// CHECK-NEXT: store <9 x i8> [[A]], ptr [[A_ADDR]], align 1
76+
// CHECK-NEXT: [[TMP0:%.*]] = load <9 x i8>, ptr [[A_ADDR]], align 1
77+
// CHECK-NEXT: [[TMP1:%.*]] = load <9 x i8>, ptr [[A_ADDR]], align 1
78+
// CHECK-NEXT: [[TMP2:%.*]] = add <9 x i8> [[TMP0]], [[TMP1]]
79+
// CHECK-NEXT: ret <9 x i8> [[TMP2]]
80+
//
6581
i8x3x3 m1(i8x3x3 a) {
66-
// CHECK-NEXT: entry:
67-
// CHECK-NEXT: %a.addr = alloca [9 x i8], align 1
68-
// CHECK-NEXT: store <9 x i8> %a, ptr %a.addr, align 1
69-
// CHECK-NEXT: %0 = load <9 x i8>, ptr %a.addr, align 1
70-
// CHECK-NEXT: %1 = load <9 x i8>, ptr %a.addr, align 1
71-
// CHECK-NEXT: %2 = add <9 x i8> %0, %1
72-
// CHECK-NEXT: ret <9 x i8> %2
7382
return a + a;
7483
}
7584

76-
// CHECK-LABEL: define dso_local noundef <9 x i32> @_Z2m2u11matrix_typeILm3ELm3EDB32_E(<9 x i32> noundef %a)
85+
// CHECK-LABEL: define dso_local noundef <9 x i32> @_Z2m2u11matrix_typeILm3ELm3EDB32_E(
86+
// CHECK-SAME: <9 x i32> noundef [[A:%.*]]) #[[ATTR4:[0-9]+]] {
87+
// CHECK-NEXT: [[ENTRY:.*:]]
88+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca [9 x i32], align 4
89+
// CHECK-NEXT: store <9 x i32> [[A]], ptr [[A_ADDR]], align 4
90+
// CHECK-NEXT: [[TMP0:%.*]] = load <9 x i32>, ptr [[A_ADDR]], align 4
91+
// CHECK-NEXT: [[TMP1:%.*]] = load <9 x i32>, ptr [[A_ADDR]], align 4
92+
// CHECK-NEXT: [[TMP2:%.*]] = add <9 x i32> [[TMP0]], [[TMP1]]
93+
// CHECK-NEXT: ret <9 x i32> [[TMP2]]
94+
//
7795
i32x3x3 m2(i32x3x3 a) {
78-
// CHECK-NEXT: entry:
79-
// CHECK-NEXT: %a.addr = alloca [9 x i32], align 4
80-
// CHECK-NEXT: store <9 x i32> %a, ptr %a.addr, align 4
81-
// CHECK-NEXT: %0 = load <9 x i32>, ptr %a.addr, align 4
82-
// CHECK-NEXT: %1 = load <9 x i32>, ptr %a.addr, align 4
83-
// CHECK-NEXT: %2 = add <9 x i32> %0, %1
84-
// CHECK-NEXT: ret <9 x i32> %2
8596
return a + a;
8697
}
8798

88-
// CHECK-LABEL: define dso_local noundef <9 x i512> @_Z2m3u11matrix_typeILm3ELm3EDB512_E(<9 x i512> noundef %a)
99+
// CHECK-LABEL: define dso_local noundef <9 x i512> @_Z2m3u11matrix_typeILm3ELm3EDB512_E(
100+
// CHECK-SAME: <9 x i512> noundef [[A:%.*]]) #[[ATTR5:[0-9]+]] {
101+
// CHECK-NEXT: [[ENTRY:.*:]]
102+
// CHECK-NEXT: [[A_ADDR:%.*]] = alloca [9 x i512], align 8
103+
// CHECK-NEXT: store <9 x i512> [[A]], ptr [[A_ADDR]], align 8
104+
// CHECK-NEXT: [[TMP0:%.*]] = load <9 x i512>, ptr [[A_ADDR]], align 8
105+
// CHECK-NEXT: [[TMP1:%.*]] = load <9 x i512>, ptr [[A_ADDR]], align 8
106+
// CHECK-NEXT: [[TMP2:%.*]] = add <9 x i512> [[TMP0]], [[TMP1]]
107+
// CHECK-NEXT: ret <9 x i512> [[TMP2]]
108+
//
89109
i512x3x3 m3(i512x3x3 a) {
90-
// CHECK-NEXT: entry:
91-
// CHECK-NEXT: %a.addr = alloca [9 x i512], align 8
92-
// CHECK-NEXT: store <9 x i512> %a, ptr %a.addr, align 8
93-
// CHECK-NEXT: %0 = load <9 x i512>, ptr %a.addr, align 8
94-
// CHECK-NEXT: %1 = load <9 x i512>, ptr %a.addr, align 8
95-
// CHECK-NEXT: %2 = add <9 x i512> %0, %1
96-
// CHECK-NEXT: ret <9 x i512> %2
97110
return a + a;
98111
}

clang/unittests/Format/ConfigParseTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ TEST(ConfigParseTest, ParsesConfigurationBools) {
159159
CHECK_PARSE_BOOL(AllowShortCompoundRequirementOnASingleLine);
160160
CHECK_PARSE_BOOL(AllowShortEnumsOnASingleLine);
161161
CHECK_PARSE_BOOL(AllowShortLoopsOnASingleLine);
162+
CHECK_PARSE_BOOL(AllowShortNamespacesOnASingleLine);
162163
CHECK_PARSE_BOOL(BinPackArguments);
163164
CHECK_PARSE_BOOL(BreakAdjacentStringLiterals);
164165
CHECK_PARSE_BOOL(BreakAfterJavaFieldAnnotations);

0 commit comments

Comments
 (0)