This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG204aaf879548: [AArch64][SVE] Always use overloaded methods 
instead of preprocessor macro. (authored by sdesmalen).
Changed prior to commit:
  https://reviews.llvm.org/D100297?vs=336799&id=337243#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100297/new/

https://reviews.llvm.org/D100297

Files:
  clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfb.c
  clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfd.c
  clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfh.c
  clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfw.c
  clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_qdecb.c
  clang/utils/TableGen/SveEmitter.cpp

Index: clang/utils/TableGen/SveEmitter.cpp
===================================================================
--- clang/utils/TableGen/SveEmitter.cpp
+++ clang/utils/TableGen/SveEmitter.cpp
@@ -919,26 +919,22 @@
 }
 
 void Intrinsic::emitIntrinsic(raw_ostream &OS) const {
-  // Use the preprocessor to 
-  if (getClassKind() != ClassG || getProto().size() <= 1) {
-    OS << "#define " << mangleName(getClassKind())
-       << "(...) __builtin_sve_" << mangleName(ClassS)
-       << "(__VA_ARGS__)\n";
-  } else {
-    std::string FullName = mangleName(ClassS);
-    std::string ProtoName = mangleName(ClassG);
+  bool IsOverloaded = getClassKind() == ClassG && getProto().size() > 1;
 
-    OS << "__aio __attribute__((__clang_arm_builtin_alias("
-       << "__builtin_sve_" << FullName << ")))\n";
+  std::string FullName = mangleName(ClassS);
+  std::string ProtoName = mangleName(getClassKind());
 
-    OS << getTypes()[0].str() << " " << ProtoName << "(";
-    for (unsigned I = 0; I < getTypes().size() - 1; ++I) {
-      if (I != 0)
-        OS << ", ";
-      OS << getTypes()[I + 1].str();
-    }
-    OS << ");\n";
+  OS << (IsOverloaded ? "__aio " : "__ai ")
+     << "__attribute__((__clang_arm_builtin_alias("
+     << "__builtin_sve_" << FullName << ")))\n";
+
+  OS << getTypes()[0].str() << " " << ProtoName << "(";
+  for (unsigned I = 0; I < getTypes().size() - 1; ++I) {
+    if (I != 0)
+      OS << ", ";
+    OS << getTypes()[I + 1].str();
   }
+  OS << ");\n";
 }
 
 //===----------------------------------------------------------------------===//
@@ -1204,6 +1200,8 @@
   OS << "};\n\n";
 
   OS << "/* Function attributes */\n";
+  OS << "#define __ai static __inline__ __attribute__((__always_inline__, "
+        "__nodebug__))\n\n";
   OS << "#define __aio static __inline__ __attribute__((__always_inline__, "
         "__nodebug__, __overloadable__))\n\n";
 
Index: clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_qdecb.c
===================================================================
--- clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_qdecb.c
+++ clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_qdecb.c
@@ -105,3 +105,9 @@
   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
   return SVE_ACLE_FUNC(svqdecb_pat,_n_u64,,)(op, SV_VL7, 17);
 }
+
+uint64_t test_svqdecb_svprfop(uint64_t op)
+{
+  // expected-warning@+1 {{implicit conversion from enumeration type 'enum svprfop' to different enumeration type 'enum svpattern'}}
+  return SVE_ACLE_FUNC(svqdecb_pat,_n_u64,,)(op, SV_PLDL1KEEP, 1);
+}
Index: clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfw.c
===================================================================
--- clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfw.c
+++ clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfw.c
@@ -10,7 +10,7 @@
 
 void test_svprfw_1(svbool_t pg, const void *base)
 {
-  // expected-error@+1 {{argument value -1 is outside the valid range [0, 13]}}
+  // expected-error-re@+1 {{argument value {{.*}} is outside the valid range [0, 13]}}
   return svprfw(pg, base, -1);
 }
 
@@ -22,6 +22,6 @@
 
 void test_svprfw_vnum_1(svbool_t pg, const void *base)
 {
-  // expected-error@+1 {{argument value -1 is outside the valid range [0, 13]}}
+  // expected-error-re@+1 {{argument value {{.*}} is outside the valid range [0, 13]}}
   return svprfw_vnum(pg, base, 0, -1);
 }
Index: clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfh.c
===================================================================
--- clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfh.c
+++ clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfh.c
@@ -10,7 +10,7 @@
 
 void test_svprfh_1(svbool_t pg, const void *base)
 {
-  // expected-error@+1 {{argument value -1 is outside the valid range [0, 13]}}
+  // expected-error-re@+1 {{argument value {{.*}} is outside the valid range [0, 13]}}
   return svprfh(pg, base, -1);
 }
 
@@ -22,6 +22,6 @@
 
 void test_svprfh_vnum_1(svbool_t pg, const void *base)
 {
-  // expected-error@+1 {{argument value -1 is outside the valid range [0, 13]}}
+  // expected-error-re@+1 {{argument value {{.*}} is outside the valid range [0, 13]}}
   return svprfh_vnum(pg, base, 0, -1);
 }
Index: clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfd.c
===================================================================
--- clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfd.c
+++ clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfd.c
@@ -10,7 +10,7 @@
 
 void test_svprfd_1(svbool_t pg, const void *base)
 {
-  // expected-error@+1 {{argument value -1 is outside the valid range [0, 13]}}
+  // expected-error-re@+1 {{argument value {{.*}} is outside the valid range [0, 13]}}
   return svprfd(pg, base, -1);
 }
 
@@ -22,6 +22,6 @@
 
 void test_svprfd_vnum_1(svbool_t pg, const void *base)
 {
-  // expected-error@+1 {{argument value -1 is outside the valid range [0, 13]}}
+  // expected-error-re@+1 {{argument value {{.*}} is outside the valid range [0, 13]}}
   return svprfd_vnum(pg, base, 0, -1);
 }
Index: clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfb.c
===================================================================
--- clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfb.c
+++ clang/test/CodeGen/aarch64-sve-intrinsics/negative/acle_sve_prfb.c
@@ -10,7 +10,7 @@
 
 void test_svprfb_1(svbool_t pg, const void *base)
 {
-  // expected-error@+1 {{argument value -1 is outside the valid range [0, 13]}}
+  // expected-error-re@+1 {{argument value {{.*}} is outside the valid range [0, 13]}}
   return svprfb(pg, base, -1);
 }
 
@@ -22,6 +22,12 @@
 
 void test_svprfb_vnum_1(svbool_t pg, const void *base)
 {
-  // expected-error@+1 {{argument value -1 is outside the valid range [0, 13]}}
+  // expected-error-re@+1 {{argument value {{.*}} is outside the valid range [0, 13]}}
   return svprfb_vnum(pg, base, 0, -1);
 }
+
+void test_svprfb_svpattern(svbool_t pg, const void *base)
+{
+  // expected-warning@+1 {{implicit conversion from enumeration type 'enum svpattern' to different enumeration type 'enum svprfop'}}
+  return svprfb(pg, base, SV_VL1);
+}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to