[PATCH] D106550: [PowerPC] Allow MMA builtins to accpet restrict qualified pointers
Ahsan Saghir via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 22 07:49:46 PDT 2021
saghir created this revision.
Herald added subscribers: steven.zhang, shchenz, kbarton, nemanjai.
saghir requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This patch allows MMA builtins on PowerPC to accept restrict
qualified pointers.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106550
Files:
clang/lib/Sema/SemaChecking.cpp
clang/test/Sema/ppc-pair-mma-types.c
Index: clang/test/Sema/ppc-pair-mma-types.c
===================================================================
--- clang/test/Sema/ppc-pair-mma-types.c
+++ clang/test/Sema/ppc-pair-mma-types.c
@@ -333,3 +333,8 @@
__vector_pair vp = __builtin_vsx_lxvp(ll, v); // expected-error {{passing '__vector int' (vector of 4 'int' values) to parameter of incompatible type 'const __vector_pair *'}}
__builtin_vsx_stxvp(vp, ll, s); // expected-error {{passing 'unsigned short' to parameter of incompatible type 'const __vector_pair *'}}
}
+
+void testRestrictQualifiedPointer(__vector_quad *__restrict acc) {
+ vector float arr[4];
+ __builtin_mma_disassemble_acc((void*)arr, acc);
+}
Index: clang/lib/Sema/SemaChecking.cpp
===================================================================
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -7303,7 +7303,8 @@
if ((ExpectedType->isVoidPointerType() && !ArgType->isPointerType()) ||
(!ExpectedType->isVoidPointerType() &&
- ArgType.getCanonicalType() != ExpectedType))
+ (!ArgType.isRestrictQualified() &&
+ ArgType.getCanonicalType() != ExpectedType)))
return Diag(Arg->getBeginLoc(), diag::err_typecheck_convert_incompatible)
<< ArgType << ExpectedType << 1 << 0 << 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106550.360812.patch
Type: text/x-patch
Size: 1325 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210722/899c55d0/attachment-0001.bin>
More information about the cfe-commits
mailing list