[llvm-branch-commits] [clang] 84de157 - Changes from last revision:

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 1 00:02:58 PDT 2024


Author: Alexandros Lamprineas
Date: 2024-08-01T09:02:41+02:00
New Revision: 84de15796052e629a2276bcf1d502d1a8163e32b

URL: https://github.com/llvm/llvm-project/commit/84de15796052e629a2276bcf1d502d1a8163e32b
DIFF: https://github.com/llvm/llvm-project/commit/84de15796052e629a2276bcf1d502d1a8163e32b.diff

LOG: Changes from last revision:

Made __arm_locally_streaming require the same calling convention
as the rest of the callee versions and updated the tests.

Added: 
    

Modified: 
    clang/lib/Sema/SemaDecl.cpp
    clang/test/CodeGen/aarch64-fmv-streaming.c
    clang/test/Sema/aarch64-fmv-streaming.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 77331f0ca0997..4dc72063e54c0 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -11157,9 +11157,7 @@ bool Sema::areMultiversionVariantFunctionsCompatible(
     const auto *NewFPT = NewFD->getType()->getAs<FunctionProtoType>();
 
     bool ArmStreamingCCMismatched = false;
-    // Locally streaming does not affect the calling convention.
-    if (OldFPT && NewFPT && !OldFD->hasAttr<ArmLocallyStreamingAttr>() &&
-        !NewFD->hasAttr<ArmLocallyStreamingAttr>()) {
+    if (OldFPT && NewFPT) {
       unsigned Diff =
           OldFPT->getAArch64SMEAttributes() ^ NewFPT->getAArch64SMEAttributes();
       // Streaming versions cannot be mixed with non-streaming versions.

diff  --git a/clang/test/CodeGen/aarch64-fmv-streaming.c b/clang/test/CodeGen/aarch64-fmv-streaming.c
index e777a53b2f038..e549ccda59ad8 100644
--- a/clang/test/CodeGen/aarch64-fmv-streaming.c
+++ b/clang/test/CodeGen/aarch64-fmv-streaming.c
@@ -28,7 +28,7 @@ __attribute__((target_clones("sve", "simd"))) void s_callee(void) __arm_streamin
 // CHECK-LABEL: define {{[^@]+}}@s_callee._Msme2
 // CHECK-SAME: () #[[ATTR6:[0-9]+]] {
 //
-__arm_locally_streaming __attribute__((target_version("sme2"))) void s_callee(void) {}
+__arm_locally_streaming __attribute__((target_version("sme2"))) void s_callee(void) __arm_streaming {}
 // CHECK-LABEL: define {{[^@]+}}@s_callee.default
 // CHECK-SAME: () #[[ATTR7:[0-9]+]] {
 //
@@ -43,11 +43,11 @@ __attribute__((target_version("default"))) void s_callee(void) __arm_streaming {
 //
 __attribute__((target_clones("sve", "simd"))) void sc_callee(void) __arm_streaming_compatible {}
 // CHECK-LABEL: define {{[^@]+}}@sc_callee._Msme2
-// CHECK-SAME: () #[[ATTR6:[0-9]+]] {
+// CHECK-SAME: () #[[ATTR10:[0-9]+]] {
 //
-__arm_locally_streaming __attribute__((target_version("sme2"))) void sc_callee(void) {}
+__arm_locally_streaming __attribute__((target_version("sme2"))) void sc_callee(void) __arm_streaming_compatible {}
 // CHECK-LABEL: define {{[^@]+}}@sc_callee.default
-// CHECK-SAME: () #[[ATTR10:[0-9]+]] {
+// CHECK-SAME: () #[[ATTR11:[0-9]+]] {
 //
 __attribute__((target_version("default"))) void sc_callee(void) __arm_streaming_compatible {}
 
@@ -55,8 +55,8 @@ __attribute__((target_version("default"))) void sc_callee(void) __arm_streaming_
 // CHECK-LABEL: define {{[^@]+}}@n_caller
 // CHECK-SAME: () #[[ATTR3:[0-9]+]] {
 // CHECK:    call void @n_callee()
-// CHECK:    call void @s_callee() #[[ATTR11:[0-9]+]]
-// CHECK:    call void @sc_callee() #[[ATTR12:[0-9]+]]
+// CHECK:    call void @s_callee() #[[ATTR12:[0-9]+]]
+// CHECK:    call void @sc_callee() #[[ATTR13:[0-9]+]]
 //
 void n_caller(void) {
   n_callee();
@@ -68,8 +68,8 @@ void n_caller(void) {
 // CHECK-LABEL: define {{[^@]+}}@s_caller
 // CHECK-SAME: () #[[ATTR7:[0-9]+]] {
 // CHECK:    call void @n_callee()
-// CHECK:    call void @s_callee() #[[ATTR11]]
-// CHECK:    call void @sc_callee() #[[ATTR12]]
+// CHECK:    call void @s_callee() #[[ATTR12]]
+// CHECK:    call void @sc_callee() #[[ATTR13]]
 //
 void s_caller(void) __arm_streaming {
   n_callee();
@@ -79,10 +79,10 @@ void s_caller(void) __arm_streaming {
 
 
 // CHECK-LABEL: define {{[^@]+}}@sc_caller
-// CHECK-SAME: () #[[ATTR10:[0-9]+]] {
+// CHECK-SAME: () #[[ATTR11:[0-9]+]] {
 // CHECK:    call void @n_callee()
-// CHECK:    call void @s_callee() #[[ATTR11]]
-// CHECK:    call void @sc_callee() #[[ATTR12]]
+// CHECK:    call void @s_callee() #[[ATTR12]]
+// CHECK:    call void @sc_callee() #[[ATTR13]]
 //
 void sc_caller(void) __arm_streaming_compatible {
   n_callee();
@@ -97,10 +97,11 @@ void sc_caller(void) __arm_streaming_compatible {
 // CHECK: attributes #[[ATTR3]] = {{.*}}
 // CHECK: attributes #[[ATTR4:[0-9]+]] = {{.*}} "aarch64_pstate_sm_enabled"
 // CHECK: attributes #[[ATTR5:[0-9]+]] = {{.*}} "aarch64_pstate_sm_enabled"
-// CHECK: attributes #[[ATTR6:[0-9]+]] = {{.*}} "aarch64_pstate_sm_body"
+// CHECK: attributes #[[ATTR6:[0-9]+]] = {{.*}} "aarch64_pstate_sm_body" "aarch64_pstate_sm_enabled"
 // CHECK: attributes #[[ATTR7]] = {{.*}} "aarch64_pstate_sm_enabled"
 // CHECK: attributes #[[ATTR8:[0-9]+]] = {{.*}} "aarch64_pstate_sm_compatible"
 // CHECK: attributes #[[ATTR9:[0-9]+]] = {{.*}} "aarch64_pstate_sm_compatible"
-// CHECK: attributes #[[ATTR10]] = {{.*}} "aarch64_pstate_sm_compatible"
-// CHECK: attributes #[[ATTR11]] = {{.*}} "aarch64_pstate_sm_enabled"
-// CHECK: attributes #[[ATTR12]] = {{.*}} "aarch64_pstate_sm_compatible"
+// CHECK: attributes #[[ATTR10]] = {{.*}} "aarch64_pstate_sm_body" "aarch64_pstate_sm_compatible"
+// CHECK: attributes #[[ATTR11]] = {{.*}} "aarch64_pstate_sm_compatible"
+// CHECK: attributes #[[ATTR12]] = {{.*}} "aarch64_pstate_sm_enabled"
+// CHECK: attributes #[[ATTR13]] = {{.*}} "aarch64_pstate_sm_compatible"

diff  --git a/clang/test/Sema/aarch64-fmv-streaming.c b/clang/test/Sema/aarch64-fmv-streaming.c
index 050ce5c8c803b..93b7656216c0c 100644
--- a/clang/test/Sema/aarch64-fmv-streaming.c
+++ b/clang/test/Sema/aarch64-fmv-streaming.c
@@ -2,11 +2,11 @@
 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sme -Waarch64-sme-attributes -fsyntax-only -verify=expected-cpp -x c++ %s
 
 __attribute__((target_clones("sve", "simd"))) void ok_arm_streaming(void) __arm_streaming {}
-__arm_locally_streaming __attribute__((target_version("sme2"))) void ok_arm_streaming(void) {}
+__arm_locally_streaming __attribute__((target_version("sme2"))) void ok_arm_streaming(void) __arm_streaming {}
 __attribute__((target_version("default"))) void ok_arm_streaming(void) __arm_streaming {}
 
 __attribute__((target_clones("sve", "simd"))) void ok_arm_streaming_compatible(void) __arm_streaming_compatible {}
-__arm_locally_streaming __attribute__((target_version("sme2"))) void ok_arm_streaming_compatible(void) {}
+__arm_locally_streaming __attribute__((target_version("sme2"))) void ok_arm_streaming_compatible(void) __arm_streaming_compatible {}
 __attribute__((target_version("default"))) void ok_arm_streaming_compatible(void) __arm_streaming_compatible {}
 
 __arm_locally_streaming __attribute__((target_clones("sve", "simd"))) void ok_no_streaming(void) {}
@@ -20,6 +20,9 @@ __attribute__((target_version("sme2"))) void bad_mixed_streaming(void) __arm_str
 // expected-cpp-error at +2 {{multiversioned function declaration has a 
diff erent calling convention}}
 // expected-error at +1 {{multiversioned function declaration has a 
diff erent calling convention}}
 __attribute__((target_version("default"))) void bad_mixed_streaming(void) __arm_streaming_compatible {}
+// expected-cpp-error at +2 {{multiversioned function declaration has a 
diff erent calling convention}}
+// expected-error at +1 {{multiversioned function declaration has a 
diff erent calling convention}}
+__arm_locally_streaming __attribute__((target_version("dotprod"))) void bad_mixed_streaming(void) __arm_streaming {}
 
 void n_caller(void) {
   ok_arm_streaming();


        


More information about the llvm-branch-commits mailing list