Skip to content

Commit d137719

Browse files
author
Valery N Dmitriev
committed
Merge from 'master' to 'sycl-web' (#2)
CONFLICT (content): Merge conflict in clang/include/clang/Basic/DiagnosticSemaKinds.td
2 parents 962c679 + 043b608 commit d137719

File tree

7 files changed

+204
-89
lines changed

7 files changed

+204
-89
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 53 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10830,8 +10830,61 @@ def err_matrix_separate_incomplete_index: Error<
1083010830
"matrix row and column subscripts cannot be separated by any expression">;
1083110831
def err_matrix_subscript_comma: Error<
1083210832
"comma expressions are not allowed as indices in matrix subscript expressions">;
10833+
def err_builtin_matrix_arg: Error<"1st argument must be a matrix">;
10834+
def err_builtin_matrix_scalar_unsigned_arg: Error<
10835+
"%0 argument must be a constant unsigned integer expression">;
10836+
def err_builtin_matrix_pointer_arg: Error<
10837+
"%ordinal0 argument must be a pointer to a valid matrix element type">;
10838+
def err_builtin_matrix_pointer_arg_mismatch: Error<
10839+
"the pointee of the 2nd argument must match the element type of the 1st argument (%0 != %1)">;
10840+
def err_builtin_matrix_store_to_const: Error<
10841+
"cannot store matrix to read-only pointer">;
10842+
def err_builtin_matrix_stride_too_small: Error<
10843+
"stride must be greater or equal to the number of rows">;
10844+
def err_builtin_matrix_invalid_dimension: Error<
10845+
"%0 dimension is outside the allowed range [1, %1]">;
10846+
10847+
def warn_mismatched_import : Warning<
10848+
"import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
10849+
"previous declaration">,
10850+
InGroup<IgnoredAttributes>;
10851+
def warn_import_on_definition : Warning<
10852+
"import %select{module|name}0 cannot be applied to a function with a definition">,
10853+
InGroup<IgnoredAttributes>;
10854+
10855+
def err_preserve_field_info_not_field : Error<
10856+
"__builtin_preserve_field_info argument %0 not a field access">;
10857+
def err_preserve_field_info_not_const: Error<
10858+
"__builtin_preserve_field_info argument %0 not a constant">;
10859+
def err_btf_type_id_not_const: Error<
10860+
"__builtin_btf_type_id argument %0 not a constant">;
10861+
10862+
def err_bit_cast_non_trivially_copyable : Error<
10863+
"__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
10864+
def err_bit_cast_type_size_mismatch : Error<
10865+
"__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
1083310866

1083410867
// SYCL-specific diagnostics
10868+
def warn_sycl_kernel_num_of_template_params : Warning<
10869+
"'sycl_kernel' attribute only applies to a function template with at least"
10870+
" two template parameters">, InGroup<IgnoredAttributes>;
10871+
def warn_sycl_kernel_invalid_template_param_type : Warning<
10872+
"template parameter of a function template with the 'sycl_kernel' attribute"
10873+
" cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
10874+
def warn_sycl_kernel_num_of_function_params : Warning<
10875+
"function template with 'sycl_kernel' attribute must have a single parameter">,
10876+
InGroup<IgnoredAttributes>;
10877+
def warn_sycl_kernel_return_type : Warning<
10878+
"function template with 'sycl_kernel' attribute must have a 'void' return type">,
10879+
InGroup<IgnoredAttributes>;
10880+
10881+
def err_ext_int_bad_size : Error<"%select{signed|unsigned}0 _ExtInt must "
10882+
"have a bit size of at least %select{2|1}0">;
10883+
def err_ext_int_max_size : Error<"%select{signed|unsigned}0 _ExtInt of bit "
10884+
"sizes greater than %1 not supported">;
10885+
def err_esimd_glob_cant_init : Error<
10886+
"SYCL explicit SIMD does not permit private global variable to have an initializer">;
10887+
1083510888
def err_sycl_kernel_incorrectly_named : Error<
1083610889
"kernel %select{name is missing"
1083710890
"|needs to have a globally-visible name"
@@ -10900,66 +10953,11 @@ def warn_ivdep_redundant : Warning <"ignoring redundant Intel FPGA loop "
1090010953
"attribute 'ivdep': safelen %select{INF|%1}0 >= safelen %select{INF|%3}2">,
1090110954
InGroup<IgnoredAttributes>;
1090210955

10903-
def err_builtin_matrix_arg: Error<"first argument must be a matrix">;
10904-
def err_builtin_matrix_scalar_unsigned_arg: Error<
10905-
"%0 argument must be a constant unsigned integer expression">;
10906-
def err_builtin_matrix_pointer_arg: Error<
10907-
"%0 argument must be a pointer to a valid matrix element type">;
10908-
def err_builtin_matrix_pointer_arg_mismatch: Error<
10909-
"the pointee of the second argument must match the element type of the first argument (%0 != %1)">;
10910-
def err_builtin_matrix_store_to_const: Error<
10911-
"cannot store matrix to read-only pointer">;
10912-
def err_builtin_matrix_stride_too_small: Error<
10913-
"stride must be greater or equal to the number of rows">;
10914-
def err_builtin_matrix_invalid_dimension: Error<
10915-
"%0 dimension is outside the allowed range [1, %1]">;
10916-
10917-
def warn_mismatched_import : Warning<
10918-
"import %select{module|name}0 (%1) does not match the import %select{module|name}0 (%2) of the "
10919-
"previous declaration">,
10920-
InGroup<IgnoredAttributes>;
10921-
def warn_import_on_definition : Warning<
10922-
"import %select{module|name}0 cannot be applied to a function with a definition">,
10923-
InGroup<IgnoredAttributes>;
10924-
10925-
def err_preserve_field_info_not_field : Error<
10926-
"__builtin_preserve_field_info argument %0 not a field access">;
10927-
def err_preserve_field_info_not_const: Error<
10928-
"__builtin_preserve_field_info argument %0 not a constant">;
10929-
def err_btf_type_id_not_const: Error<
10930-
"__builtin_btf_type_id argument %0 not a constant">;
10931-
10932-
def err_bit_cast_non_trivially_copyable : Error<
10933-
"__builtin_bit_cast %select{source|destination}0 type must be trivially copyable">;
10934-
def err_bit_cast_type_size_mismatch : Error<
10935-
"__builtin_bit_cast source size does not equal destination size (%0 vs %1)">;
10936-
1093710956
// errors of expect.with.probability
1093810957
def err_probability_not_constant_float : Error<
1093910958
"probability argument to __builtin_expect_with_probability must be constant "
1094010959
"floating-point expression">;
1094110960
def err_probability_out_of_range : Error<
1094210961
"probability argument to __builtin_expect_with_probability is outside the "
1094310962
"range [0.0, 1.0]">;
10944-
10945-
// SYCL-specific diagnostics
10946-
def warn_sycl_kernel_num_of_template_params : Warning<
10947-
"'sycl_kernel' attribute only applies to a function template with at least"
10948-
" two template parameters">, InGroup<IgnoredAttributes>;
10949-
def warn_sycl_kernel_invalid_template_param_type : Warning<
10950-
"template parameter of a function template with the 'sycl_kernel' attribute"
10951-
" cannot be a non-type template parameter">, InGroup<IgnoredAttributes>;
10952-
def warn_sycl_kernel_num_of_function_params : Warning<
10953-
"function template with 'sycl_kernel' attribute must have a single parameter">,
10954-
InGroup<IgnoredAttributes>;
10955-
def warn_sycl_kernel_return_type : Warning<
10956-
"function template with 'sycl_kernel' attribute must have a 'void' return type">,
10957-
InGroup<IgnoredAttributes>;
10958-
10959-
def err_ext_int_bad_size : Error<"%select{signed|unsigned}0 _ExtInt must "
10960-
"have a bit size of at least %select{2|1}0">;
10961-
def err_ext_int_max_size : Error<"%select{signed|unsigned}0 _ExtInt of bit "
10962-
"sizes greater than %1 not supported">;
10963-
def err_esimd_glob_cant_init : Error<
10964-
"SYCL explicit SIMD does not permit private global variable to have an initializer">;
1096510963
} // end of sema component.

clang/lib/Sema/SemaChecking.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15431,7 +15431,8 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorLoad(CallExpr *TheCall,
1543115431
if (checkArgCount(*this, TheCall, 4))
1543215432
return ExprError();
1543315433

15434-
Expr *PtrExpr = TheCall->getArg(0);
15434+
unsigned PtrArgIdx = 0;
15435+
Expr *PtrExpr = TheCall->getArg(PtrArgIdx);
1543515436
Expr *RowsExpr = TheCall->getArg(1);
1543615437
Expr *ColumnsExpr = TheCall->getArg(2);
1543715438
Expr *StrideExpr = TheCall->getArg(3);
@@ -15455,14 +15456,14 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorLoad(CallExpr *TheCall,
1545515456
QualType ElementTy;
1545615457
if (!PtrTy) {
1545715458
Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg)
15458-
<< "first";
15459+
<< PtrArgIdx + 1;
1545915460
ArgError = true;
1546015461
} else {
1546115462
ElementTy = PtrTy->getPointeeType().getUnqualifiedType();
1546215463

1546315464
if (!ConstantMatrixType::isValidElementType(ElementTy)) {
1546415465
Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg)
15465-
<< "first";
15466+
<< PtrArgIdx + 1;
1546615467
ArgError = true;
1546715468
}
1546815469
}
@@ -15538,8 +15539,9 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorStore(CallExpr *TheCall,
1553815539
if (checkArgCount(*this, TheCall, 3))
1553915540
return ExprError();
1554015541

15542+
unsigned PtrArgIdx = 1;
1554115543
Expr *MatrixExpr = TheCall->getArg(0);
15542-
Expr *PtrExpr = TheCall->getArg(1);
15544+
Expr *PtrExpr = TheCall->getArg(PtrArgIdx);
1554315545
Expr *StrideExpr = TheCall->getArg(2);
1554415546

1554515547
bool ArgError = false;
@@ -15578,7 +15580,7 @@ ExprResult Sema::SemaBuiltinMatrixColumnMajorStore(CallExpr *TheCall,
1557815580
auto *PtrTy = PtrExpr->getType()->getAs<PointerType>();
1557915581
if (!PtrTy) {
1558015582
Diag(PtrExpr->getBeginLoc(), diag::err_builtin_matrix_pointer_arg)
15581-
<< "second";
15583+
<< PtrArgIdx + 1;
1558215584
ArgError = true;
1558315585
} else {
1558415586
QualType ElementTy = PtrTy->getPointeeType();

clang/test/Sema/matrix-type-builtins.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ void transpose(sx5x10_t a, ix3x2_t b, dx3x3 c, int *d, int e) {
1111
b = __builtin_matrix_transpose(b);
1212
// expected-error@-1 {{assigning to 'ix3x2_t' (aka 'int __attribute__((matrix_type(3, 2)))') from incompatible type 'int __attribute__((matrix_type(2, 3)))'}}
1313
__builtin_matrix_transpose(d);
14-
// expected-error@-1 {{first argument must be a matrix}}
14+
// expected-error@-1 {{1st argument must be a matrix}}
1515
__builtin_matrix_transpose(e);
16-
// expected-error@-1 {{first argument must be a matrix}}
16+
// expected-error@-1 {{1st argument must be a matrix}}
1717
__builtin_matrix_transpose("test");
18-
// expected-error@-1 {{first argument must be a matrix}}
18+
// expected-error@-1 {{1st argument must be a matrix}}
1919

2020
ix3x3 m = __builtin_matrix_transpose(c);
2121
// expected-error@-1 {{initializing 'ix3x3' (aka 'unsigned int __attribute__((matrix_type(3, 3)))') with an expression of incompatible type 'double __attribute__((matrix_type(3, 3)))'}}
@@ -43,24 +43,24 @@ void column_major_load(float *p1, int *p2, _Bool *p3, struct Foo *p4) {
4343
// expected-error@-1 {{stride must be greater or equal to the number of rows}}
4444

4545
sx5x10_t a8 = __builtin_matrix_column_major_load(p3, 5, 10, 6);
46-
// expected-error@-1 {{first argument must be a pointer to a valid matrix element type}}
46+
// expected-error@-1 {{1st argument must be a pointer to a valid matrix element type}}
4747

4848
sx5x10_t a9 = __builtin_matrix_column_major_load(p4, 5, 10, 6);
49-
// expected-error@-1 {{first argument must be a pointer to a valid matrix element type}}
49+
// expected-error@-1 {{1st argument must be a pointer to a valid matrix element type}}
5050

5151
sx5x10_t a10 = __builtin_matrix_column_major_load(p1, 1ull << 21, 10, 6);
5252
// expected-error@-1 {{row dimension is outside the allowed range [1, 1048575}}
5353
sx5x10_t a11 = __builtin_matrix_column_major_load(p1, 10, 1ull << 21, 10);
5454
// expected-error@-1 {{column dimension is outside the allowed range [1, 1048575}}
5555

5656
sx5x10_t a12 = __builtin_matrix_column_major_load(
57-
10, // expected-error {{first argument must be a pointer to a valid matrix element type}}
57+
10, // expected-error {{1st argument must be a pointer to a valid matrix element type}}
5858
1ull << 21, // expected-error {{row dimension is outside the allowed range [1, 1048575]}}
5959
1ull << 21, // expected-error {{column dimension is outside the allowed range [1, 1048575]}}
6060
""); // expected-warning {{incompatible pointer to integer conversion casting 'char [1]' to type 'unsigned long'}}
6161

6262
sx5x10_t a13 = __builtin_matrix_column_major_load(
63-
10, // expected-error {{first argument must be a pointer to a valid matrix element type}}
63+
10, // expected-error {{1st argument must be a pointer to a valid matrix element type}}
6464
*p4, // expected-error {{casting 'struct Foo' to incompatible type 'unsigned long'}}
6565
"", // expected-error {{column argument must be a constant unsigned integer expression}}
6666
// expected-warning@-1 {{incompatible pointer to integer conversion casting 'char [1]' to type 'unsigned long'}}
@@ -73,18 +73,18 @@ void column_major_store(sx5x10_t *m1, ix3x2_t *m2, float *p1, int *p2, struct Fo
7373
__builtin_matrix_column_major_store(*m1, p1, 0);
7474
// expected-error@-1 {{stride must be greater or equal to the number of rows}}
7575
__builtin_matrix_column_major_store(*m1, p2, 10);
76-
// expected-error@-1 {{the pointee of the second argument must match the element type of the first argument ('int' != 'float')}}
76+
// expected-error@-1 {{the pointee of the 2nd argument must match the element type of the 1st argument ('int' != 'float')}}
7777
__builtin_matrix_column_major_store(p1, p2, 10);
78-
// expected-error@-1 {{first argument must be a matrix}}
78+
// expected-error@-1 {{1st argument must be a matrix}}
7979

8080
__builtin_matrix_column_major_store(
81-
"", // expected-error {{first argument must be a matrix}}
82-
10, // expected-error {{second argument must be a pointer to a valid matrix element type}}
81+
"", // expected-error {{1st argument must be a matrix}}
82+
10, // expected-error {{2nd argument must be a pointer to a valid matrix element type}}
8383
*p3); // expected-error {{casting 'struct Foo' to incompatible type 'unsigned long'}}
8484

8585
__builtin_matrix_column_major_store(
8686
*m1,
87-
10, // expected-error {{second argument must be a pointer to a valid matrix element type}}
87+
10, // expected-error {{2nd argument must be a pointer to a valid matrix element type}}
8888
10);
8989

9090
*m1 = __builtin_matrix_column_major_store(*m1, p1, 10);

clang/test/SemaCXX/matrix-type-builtins.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ typename MyMatrix<EltTy1, R1, C1>::matrix_t transpose(MyMatrix<EltTy0, R0, C0> &
1515
// expected-error@-3 {{cannot initialize a variable of type 'char *' with an rvalue of type 'unsigned int __attribute__((matrix_type(3, 3)))'}}
1616

1717
__builtin_matrix_transpose(A);
18-
// expected-error@-1 {{first argument must be a matrix}}
19-
// expected-error@-2 {{first argument must be a matrix}}
20-
// expected-error@-3 {{first argument must be a matrix}}
18+
// expected-error@-1 {{1st argument must be a matrix}}
19+
// expected-error@-2 {{1st argument must be a matrix}}
20+
// expected-error@-3 {{1st argument must be a matrix}}
2121

2222
return __builtin_matrix_transpose(A.value);
2323
// expected-error@-1 {{cannot initialize return object of type 'typename MyMatrix<unsigned int, 2U, 3U>::matrix_t' (aka 'unsigned int __attribute__((matrix_type(2, 3)))') with an rvalue of type 'unsigned int __attribute__((matrix_type(3, 2)))'}}
@@ -99,13 +99,13 @@ void call_column_major_load_temp(unsigned *Ptr, unsigned X) {
9999
// expected-error@-1 {{row argument must be a constant unsigned integer expression}}
100100
// expected-error@-2 {{column argument must be a constant unsigned integer expression}}
101101
(void)__builtin_matrix_column_major_load(X, 2, 2, 2);
102-
// expected-error@-1 {{first argument must be a pointer to a valid matrix element type}}
102+
// expected-error@-1 {{1st argument must be a pointer to a valid matrix element type}}
103103
}
104104

105105
template <typename EltTy0, unsigned R0, unsigned C0, typename PtrTy>
106106
void column_major_store(MyMatrix<EltTy0, R0, C0> &A, PtrTy Ptr, unsigned Stride) {
107107
__builtin_matrix_column_major_store(A.value, Ptr, Stride);
108-
// expected-error@-1 {{the pointee of the second argument must match the element type of the first argument ('float' != 'unsigned int')}}
108+
// expected-error@-1 {{the pointee of the 2nd argument must match the element type of the 1st argument ('float' != 'unsigned int')}}
109109
}
110110

111111
template <typename MTy, typename PtrTy, unsigned Stride>
@@ -126,14 +126,14 @@ template <typename EltTy0, unsigned R0, unsigned C0, typename EltTy1>
126126
void column_major_store(MyMatrix<EltTy0, R0, C0> &A, EltTy1 *Ptr) {
127127
__builtin_matrix_column_major_store(A.value, Ptr, 1);
128128
// expected-error@-1 3 {{stride must be greater or equal to the number of rows}}
129-
// expected-error@-2 {{the pointee of the second argument must match the element type of the first argument ('float' != 'unsigned int')}}
130-
// expected-error@-3 {{the pointee of the second argument must match the element type of the first argument ('unsigned int' != 'float')}}
129+
// expected-error@-2 {{the pointee of the 2nd argument must match the element type of the 1st argument ('float' != 'unsigned int')}}
130+
// expected-error@-3 {{the pointee of the 2nd argument must match the element type of the 1st argument ('unsigned int' != 'float')}}
131131

132132
char *s;
133133
return __builtin_matrix_column_major_store(A.value, s, 20);
134-
// expected-error@-1 {{the pointee of the second argument must match the element type of the first argument ('char' != 'unsigned int')}}
135-
// expected-error@-2 {{the pointee of the second argument must match the element type of the first argument ('char' != 'unsigned int')}}
136-
// expected-error@-3 {{he pointee of the second argument must match the element type of the first argument ('char' != 'float')}}
134+
// expected-error@-1 {{the pointee of the 2nd argument must match the element type of the 1st argument ('char' != 'unsigned int')}}
135+
// expected-error@-2 {{the pointee of the 2nd argument must match the element type of the 1st argument ('char' != 'unsigned int')}}
136+
// expected-error@-3 {{he pointee of the 2nd argument must match the element type of the 1st argument ('char' != 'float')}}
137137
}
138138

139139
void test_column_major_store_template(unsigned *Ptr1, float *Ptr2) {
@@ -152,15 +152,15 @@ void test_column_major_store_constexpr(unsigned *Ptr, MyMatrix<unsigned, 3, 3> &
152152
__builtin_matrix_column_major_store(M.value, Ptr, constexpr1());
153153
// expected-error@-1 {{stride must be greater or equal to the number of rows}}
154154
__builtin_matrix_column_major_store(constexpr1(), Ptr, 1);
155-
// expected-error@-1 {{first argument must be a matrix}}
155+
// expected-error@-1 {{1st argument must be a matrix}}
156156
__builtin_matrix_column_major_store(M.value, constexpr1(), 1);
157-
// expected-error@-1 {{second argument must be a pointer to a valid matrix element type}}
157+
// expected-error@-1 {{2nd argument must be a pointer to a valid matrix element type}}
158158
// expected-error@-2 {{stride must be greater or equal to the number of rows}}
159159
}
160160

161161
void test_column_major_store_wrapper(unsigned *Ptr, MyMatrix<unsigned, 3, 3> &M, IntWrapper &W) {
162162
__builtin_matrix_column_major_store(M.value, Ptr, W);
163163

164164
__builtin_matrix_column_major_store(W, Ptr, W);
165-
// expected-error@-1 {{first argument must be a matrix}}
165+
// expected-error@-1 {{1st argument must be a matrix}}
166166
}

clang/test/SemaObjC/matrix-type-builtins.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ void test_element_type_mismatch(u4x4 m, MatrixValue *mv) {
2222

2323
double test_store(MatrixValue *mv, float *Ptr) {
2424
__builtin_matrix_column_major_store(mv.value, Ptr, 1);
25-
// expected-error@-1 {{the pointee of the second argument must match the element type of the first argument ('float' != 'double')}}
25+
// expected-error@-1 {{the pointee of the 2nd argument must match the element type of the 1st argument ('float' != 'double')}}
2626
// expected-error@-2 {{stride must be greater or equal to the number of rows}}
2727

2828
__builtin_matrix_column_major_store(mv.value, mv.value, mv.value);
29-
// expected-error@-1 {{second argument must be a pointer to a valid matrix element type}}
29+
// expected-error@-1 {{2nd argument must be a pointer to a valid matrix element type}}
3030
// expected-error@-2 {{casting 'double4x4' (aka 'double __attribute__((matrix_type(4, 4)))') to incompatible type 'unsigned long}}
3131
}

llvm/lib/Target/ARM/MVETailPredication.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,14 @@ bool MVETailPredication::IsPredicatedVectorLoop() {
354354
return false;
355355
MaskedInsts.push_back(cast<IntrinsicInst>(&I));
356356
} else if (auto *Int = dyn_cast<IntrinsicInst>(&I)) {
357-
if (Int->getIntrinsicID() == Intrinsic::fma)
358-
continue;
357+
switch (Int->getIntrinsicID()) {
358+
case Intrinsic::fma:
359+
case Intrinsic::sadd_sat:
360+
case Intrinsic::uadd_sat:
361+
continue;
362+
default:
363+
break;
364+
}
359365
for (auto &U : Int->args()) {
360366
if (isa<VectorType>(U->getType()))
361367
return false;

0 commit comments

Comments
 (0)