[clang] 1013967 - [PowerPC] Remove const from paired vector store builtins

Nemanja Ivanovic via cfe-commits cfe-commits at lists.llvm.org
Tue May 31 19:51:30 PDT 2022


Author: Nemanja Ivanovic
Date: 2022-05-31T21:51:15-05:00
New Revision: 1013967436694f362097a7c12f675c0ad7de90b7

URL: https://github.com/llvm/llvm-project/commit/1013967436694f362097a7c12f675c0ad7de90b7
DIFF: https://github.com/llvm/llvm-project/commit/1013967436694f362097a7c12f675c0ad7de90b7.diff

LOG: [PowerPC] Remove const from paired vector store builtins

For some reason, we implemented the xx_stxvp intrinsics
to require a const pointer. This absolutely doesn't make
sense for a store. Remove the const from the definition.

Added: 
    

Modified: 
    clang/include/clang/Basic/BuiltinsPPC.def
    clang/test/CodeGen/PowerPC/builtins-ppc-pair-mma.c
    clang/test/Sema/ppc-mma-builtins.c
    clang/test/Sema/ppc-pair-mma-types.c

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/BuiltinsPPC.def b/clang/include/clang/Basic/BuiltinsPPC.def
index 923215cc3e5d0..04934ec2b9e18 100644
--- a/clang/include/clang/Basic/BuiltinsPPC.def
+++ b/clang/include/clang/Basic/BuiltinsPPC.def
@@ -843,7 +843,7 @@ BUILTIN(__builtin_dcbf, "vvC*", "")
 
 // Provided builtins with _mma_ prefix for compatibility.
 CUSTOM_BUILTIN(mma_lxvp, vsx_lxvp, "W256SLiW256C*", false)
-CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLiW256C*", false)
+CUSTOM_BUILTIN(mma_stxvp, vsx_stxvp, "vW256SLiW256*", false)
 CUSTOM_BUILTIN(mma_assemble_pair, vsx_assemble_pair, "vW256*VV", false)
 CUSTOM_BUILTIN(mma_disassemble_pair, vsx_disassemble_pair, "vv*W256*", false)
 CUSTOM_BUILTIN(vsx_build_pair, vsx_assemble_pair,  "vW256*VV", false)
@@ -855,7 +855,7 @@ CUSTOM_BUILTIN(mma_build_acc, mma_assemble_acc, "vW512*VVVV", false)
 // This avoids repeating the ID and INTR in the macro expression.
 
 UNALIASED_CUSTOM_BUILTIN(vsx_lxvp, "W256SLiW256C*", false)
-UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLiW256C*", false)
+UNALIASED_CUSTOM_BUILTIN(vsx_stxvp, "vW256SLiW256*", false)
 UNALIASED_CUSTOM_BUILTIN(vsx_assemble_pair, "vW256*VV", false)
 UNALIASED_CUSTOM_BUILTIN(vsx_disassemble_pair, "vv*W256*", false)
 

diff  --git a/clang/test/CodeGen/PowerPC/builtins-ppc-pair-mma.c b/clang/test/CodeGen/PowerPC/builtins-ppc-pair-mma.c
index 72867007afddf..f7811a4d1129c 100644
--- a/clang/test/CodeGen/PowerPC/builtins-ppc-pair-mma.c
+++ b/clang/test/CodeGen/PowerPC/builtins-ppc-pair-mma.c
@@ -1048,7 +1048,7 @@ void test65(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, uns
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP1]], i8* [[TMP2]])
 // CHECK-NEXT:    ret void
 //
-void test66(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test66(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_vsx_lxvp(0L, vpp);
   __builtin_vsx_stxvp(vp, 0L, vp2);
 }
@@ -1063,7 +1063,7 @@ void test66(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test67(const __vector_pair *vpp, signed long offset, const __vector_pair *vp2) {
+void test67(const __vector_pair *vpp, signed long offset, __vector_pair *vp2) {
   __vector_pair vp = __builtin_vsx_lxvp(offset, vpp);
   __builtin_vsx_stxvp(vp, offset, vp2);
 }
@@ -1078,7 +1078,7 @@ void test67(const __vector_pair *vpp, signed long offset, const __vector_pair *v
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test68(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test68(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_vsx_lxvp(18L, vpp);
   __builtin_vsx_stxvp(vp, 18L, vp2);
 }
@@ -1093,7 +1093,7 @@ void test68(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test69(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test69(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_vsx_lxvp(1L, vpp);
   __builtin_vsx_stxvp(vp, 1L, vp2);
 }
@@ -1108,7 +1108,7 @@ void test69(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test70(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test70(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_vsx_lxvp(42L, vpp);
   __builtin_vsx_stxvp(vp, 42L, vp2);
 }
@@ -1123,7 +1123,7 @@ void test70(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test71(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test71(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_vsx_lxvp(32768L, vpp);
   __builtin_vsx_stxvp(vp, 32768L, vp2);
 }
@@ -1138,7 +1138,7 @@ void test71(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test72(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test72(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_vsx_lxvp(32799L, vpp);
   __builtin_vsx_stxvp(vp, 32799L, vp2);
 }
@@ -1240,7 +1240,7 @@ void test77(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, uns
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP1]], i8* [[TMP2]])
 // CHECK-NEXT:    ret void
 //
-void test78(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test78(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_mma_lxvp(0L, vpp);
   __builtin_mma_stxvp(vp, 0L, vp2);
 }
@@ -1255,7 +1255,7 @@ void test78(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test79(const __vector_pair *vpp, signed long offset, const __vector_pair *vp2) {
+void test79(const __vector_pair *vpp, signed long offset, __vector_pair *vp2) {
   __vector_pair vp = __builtin_mma_lxvp(offset, vpp);
   __builtin_mma_stxvp(vp, offset, vp2);
 }
@@ -1270,7 +1270,7 @@ void test79(const __vector_pair *vpp, signed long offset, const __vector_pair *v
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test80(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test80(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_mma_lxvp(18L, vpp);
   __builtin_mma_stxvp(vp, 18L, vp2);
 }
@@ -1285,7 +1285,7 @@ void test80(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test81(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test81(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_mma_lxvp(1L, vpp);
   __builtin_mma_stxvp(vp, 1L, vp2);
 }
@@ -1300,7 +1300,7 @@ void test81(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test82(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test82(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_mma_lxvp(42L, vpp);
   __builtin_mma_stxvp(vp, 42L, vp2);
 }
@@ -1315,7 +1315,7 @@ void test82(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test83(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test83(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_mma_lxvp(32768L, vpp);
   __builtin_mma_stxvp(vp, 32768L, vp2);
 }
@@ -1330,7 +1330,7 @@ void test83(const __vector_pair *vpp, const __vector_pair *vp2) {
 // CHECK-NEXT:    tail call void @llvm.ppc.vsx.stxvp(<256 x i1> [[TMP2]], i8* [[TMP4]])
 // CHECK-NEXT:    ret void
 //
-void test84(const __vector_pair *vpp, const __vector_pair *vp2) {
+void test84(const __vector_pair *vpp, __vector_pair *vp2) {
   __vector_pair vp = __builtin_mma_lxvp(32799L, vpp);
   __builtin_mma_stxvp(vp, 32799L, vp2);
 }

diff  --git a/clang/test/Sema/ppc-mma-builtins.c b/clang/test/Sema/ppc-mma-builtins.c
index 66cb54266f6ca..20d779557d28a 100644
--- a/clang/test/Sema/ppc-mma-builtins.c
+++ b/clang/test/Sema/ppc-mma-builtins.c
@@ -11,7 +11,7 @@ void test2(unsigned char *vqp, unsigned char *vpp, vector unsigned char vc, unsi
   __builtin_vsx_disassemble_pair(resp, (__vector_pair*)vpp);
 }
 
-void test3(const __vector_pair *vpp, signed long offset, const __vector_pair *vp2) {
+void test3(const __vector_pair *vpp, signed long offset, __vector_pair *vp2) {
   __vector_pair vp = __builtin_vsx_lxvp(offset, vpp);
   __builtin_vsx_stxvp(vp, offset, vp2);
 }

diff  --git a/clang/test/Sema/ppc-pair-mma-types.c b/clang/test/Sema/ppc-pair-mma-types.c
index 293688d49813c..6a7cfac031058 100644
--- a/clang/test/Sema/ppc-pair-mma-types.c
+++ b/clang/test/Sema/ppc-pair-mma-types.c
@@ -209,7 +209,7 @@ void testBuiltinTypes2(__vector_pair *vpp, const __vector_pair *vp2, unsigned ch
 
 void testBuiltinTypes3(vector int v, __vector_pair *vp2, signed long l, unsigned short s) {
   __vector_pair vp = __builtin_vsx_lxvp(l, v); // expected-error {{passing '__vector int' (vector of 4 'int' values) to parameter of incompatible type 'const __vector_pair *'}}
-  __builtin_vsx_stxvp(vp, l, s);               // expected-error {{passing 'unsigned short' to parameter of incompatible type 'const __vector_pair *'}}
+  __builtin_vsx_stxvp(vp, l, s);               // expected-error {{passing 'unsigned short' to parameter of incompatible type '__vector_pair *'}}
 }
 
 void testRestrictQualifiedPointer1(int *__restrict acc) {


        


More information about the cfe-commits mailing list