[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-11 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD closed https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-10 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-09 Thread Yueh-Ting Chen via cfe-commits

eopXD wrote:

@jrtc27 Anymore comments before merging this?

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-09 Thread Alexey Bataev via cfe-commits

https://github.com/alexey-bataev approved this pull request.

LG

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-09 Thread via cfe-commits

llvmbot wrote:

@llvm/pr-subscribers-clang


Changes

Using ValueDecl will cause error for OpenMP. Decl should do the work.
--
Full diff: https://github.com/llvm/llvm-project/pull/65778.diff

4 Files Affected:

- (modified) clang/include/clang/Sema/Sema.h (+1-1) 
- (modified) clang/lib/Sema/SemaChecking.cpp (+1-1) 
- (modified) clang/lib/Sema/SemaDecl.cpp (+1-1) 
- (added) clang/test/SemaOpenMP/riscv-vector-with-openmp.c (+12) 



diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 4fd0e6bd5982a71..5c7207062741b52 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -13726,7 +13726,7 @@ class Sema final {
   bool CheckRISCVLMUL(CallExpr *TheCall, unsigned ArgNum);
   bool CheckRISCVBuiltinFunctionCall(const TargetInfo , unsigned BuiltinID,
  CallExpr *TheCall);
-  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D);
+  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D);
   bool CheckLoongArchBuiltinFunctionCall(const TargetInfo ,
  unsigned BuiltinID, CallExpr 
*TheCall);
   bool CheckWebAssemblyBuiltinFunctionCall(const TargetInfo ,
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 3932d9cd07d9864..3b4ac613da76aa8 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5514,7 +5514,7 @@ bool Sema::CheckWebAssemblyBuiltinFunctionCall(const 
TargetInfo ,
   return false;
 }
 
-void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
+void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D) {
   const TargetInfo  = Context.getTargetInfo();
   // (ELEN, LMUL) pairs of (8, mf8), (16, mf4), (32, mf2), (64, m1) requires at
   // least zve64x
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d6e090ee496eb30..37060f668b7acf3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8866,7 +8866,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
   }
 
   if (T->isRVVType())
-checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
+checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
 }
 
 /// Perform semantic checking on a newly-created variable
diff --git a/clang/test/SemaOpenMP/riscv-vector-with-openmp.c 
b/clang/test/SemaOpenMP/riscv-vector-with-openmp.c
new file mode 100644
index 000..5dae3eb9ce0b0a2
--- /dev/null
+++ b/clang/test/SemaOpenMP/riscv-vector-with-openmp.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v -fsyntax-only \
+// RUN: -verify -fopenmp %s
+// REQUIRES: riscv-registered-target
+
+// expected-no-diagnostics
+
+void foo() {
+  #pragma omp parallel
+  {
+__rvv_int32m1_t i32m1;
+  }
+}




https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-09 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD resolved 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-09 Thread via cfe-commits

https://github.com/llvmbot labeled 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-09 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-09 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD resolved 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-09 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD updated 
https://github.com/llvm/llvm-project/pull/65778:

>From 91e607dd38475ceae604c794e40bd1721aa7dae4 Mon Sep 17 00:00:00 2001
From: eopXD 
Date: Fri, 8 Sep 2023 09:59:25 -0700
Subject: [PATCH] [Clang][RISCV] Use Decl for checkRVVTypeSupport

Using ValueDecl will cause error for OpenMP. Decl should do the work.
---
 clang/include/clang/Sema/Sema.h  |  2 +-
 clang/lib/Sema/SemaChecking.cpp  |  2 +-
 clang/lib/Sema/SemaDecl.cpp  |  2 +-
 clang/test/SemaOpenMP/riscv-vector-with-openmp.c | 12 
 4 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 clang/test/SemaOpenMP/riscv-vector-with-openmp.c

diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 4fd0e6bd5982a71..5c7207062741b52 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -13726,7 +13726,7 @@ class Sema final {
   bool CheckRISCVLMUL(CallExpr *TheCall, unsigned ArgNum);
   bool CheckRISCVBuiltinFunctionCall(const TargetInfo , unsigned BuiltinID,
  CallExpr *TheCall);
-  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D);
+  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D);
   bool CheckLoongArchBuiltinFunctionCall(const TargetInfo ,
  unsigned BuiltinID, CallExpr 
*TheCall);
   bool CheckWebAssemblyBuiltinFunctionCall(const TargetInfo ,
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 3932d9cd07d9864..3b4ac613da76aa8 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5514,7 +5514,7 @@ bool Sema::CheckWebAssemblyBuiltinFunctionCall(const 
TargetInfo ,
   return false;
 }
 
-void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
+void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D) {
   const TargetInfo  = Context.getTargetInfo();
   // (ELEN, LMUL) pairs of (8, mf8), (16, mf4), (32, mf2), (64, m1) requires at
   // least zve64x
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d6e090ee496eb30..37060f668b7acf3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8866,7 +8866,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
   }
 
   if (T->isRVVType())
-checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
+checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
 }
 
 /// Perform semantic checking on a newly-created variable
diff --git a/clang/test/SemaOpenMP/riscv-vector-with-openmp.c 
b/clang/test/SemaOpenMP/riscv-vector-with-openmp.c
new file mode 100644
index 000..5dae3eb9ce0b0a2
--- /dev/null
+++ b/clang/test/SemaOpenMP/riscv-vector-with-openmp.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v -fsyntax-only \
+// RUN: -verify -fopenmp %s
+// REQUIRES: riscv-registered-target
+
+// expected-no-diagnostics
+
+void foo() {
+  #pragma omp parallel
+  {
+__rvv_int32m1_t i32m1;
+  }
+}

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Jessica Clarke via cfe-commits


@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v -fopenmp %s

jrtc27 wrote:

Commenting here rather than the commit: What happened to -fsyntax-only -verify?

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Alexey Bataev via cfe-commits


@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v -fopenmp %s

alexey-bataev wrote:

Could you move the test to OpenMP directory?

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD resolved 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD resolved 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD resolved 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD updated 
https://github.com/llvm/llvm-project/pull/65778:

>From 90764baf1616f4a150a10f63df0b0ea6bde0a86a Mon Sep 17 00:00:00 2001
From: eopXD 
Date: Fri, 8 Sep 2023 09:59:25 -0700
Subject: [PATCH] [Clang][RISCV] Use Decl for checkRVVTypeSupport

Using ValueDecl will cause error for OpenMP. Decl should do the work.
---
 clang/include/clang/Sema/Sema.h|  2 +-
 clang/lib/Sema/SemaChecking.cpp|  2 +-
 clang/lib/Sema/SemaDecl.cpp|  2 +-
 clang/test/Sema/riscv-vector-with-openmp.c | 11 +++
 4 files changed, 14 insertions(+), 3 deletions(-)
 create mode 100644 clang/test/Sema/riscv-vector-with-openmp.c

diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 4fd0e6bd5982a71..5c7207062741b52 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -13726,7 +13726,7 @@ class Sema final {
   bool CheckRISCVLMUL(CallExpr *TheCall, unsigned ArgNum);
   bool CheckRISCVBuiltinFunctionCall(const TargetInfo , unsigned BuiltinID,
  CallExpr *TheCall);
-  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D);
+  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D);
   bool CheckLoongArchBuiltinFunctionCall(const TargetInfo ,
  unsigned BuiltinID, CallExpr 
*TheCall);
   bool CheckWebAssemblyBuiltinFunctionCall(const TargetInfo ,
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 3932d9cd07d9864..3b4ac613da76aa8 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5514,7 +5514,7 @@ bool Sema::CheckWebAssemblyBuiltinFunctionCall(const 
TargetInfo ,
   return false;
 }
 
-void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
+void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D) {
   const TargetInfo  = Context.getTargetInfo();
   // (ELEN, LMUL) pairs of (8, mf8), (16, mf4), (32, mf2), (64, m1) requires at
   // least zve64x
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d6e090ee496eb30..37060f668b7acf3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8866,7 +8866,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
   }
 
   if (T->isRVVType())
-checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
+checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
 }
 
 /// Perform semantic checking on a newly-created variable
diff --git a/clang/test/Sema/riscv-vector-with-openmp.c 
b/clang/test/Sema/riscv-vector-with-openmp.c
new file mode 100644
index 000..699650f6b1ff27f
--- /dev/null
+++ b/clang/test/Sema/riscv-vector-with-openmp.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v -fopenmp %s
+// REQUIRES: riscv-registered-target
+
+// expected-no-diagnostics
+
+void foo() {
+  #pragma omp parallel
+  {
+__rvv_int32m1_t i32m1;
+  }
+}

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Jessica Clarke via cfe-commits

https://github.com/jrtc27 review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD updated 
https://github.com/llvm/llvm-project/pull/65778:

>From 8226aecca0e5ebcf17465122cd2df6cfd1b5e5c9 Mon Sep 17 00:00:00 2001
From: eopXD 
Date: Fri, 8 Sep 2023 09:59:25 -0700
Subject: [PATCH] [Clang][RISCV] Use Decl for checkRVVTypeSupport

Using ValueDecl will cause error for OpenMP. Decl should do the work.
---
 clang/include/clang/Sema/Sema.h|  2 +-
 clang/lib/Sema/SemaChecking.cpp|  2 +-
 clang/lib/Sema/SemaDecl.cpp|  2 +-
 clang/test/Sema/riscv-vector-with-openmp.c | 11 +++
 4 files changed, 14 insertions(+), 3 deletions(-)
 create mode 100644 clang/test/Sema/riscv-vector-with-openmp.c

diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 4fd0e6bd5982a71..5c7207062741b52 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -13726,7 +13726,7 @@ class Sema final {
   bool CheckRISCVLMUL(CallExpr *TheCall, unsigned ArgNum);
   bool CheckRISCVBuiltinFunctionCall(const TargetInfo , unsigned BuiltinID,
  CallExpr *TheCall);
-  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D);
+  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D);
   bool CheckLoongArchBuiltinFunctionCall(const TargetInfo ,
  unsigned BuiltinID, CallExpr 
*TheCall);
   bool CheckWebAssemblyBuiltinFunctionCall(const TargetInfo ,
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 3932d9cd07d9864..3b4ac613da76aa8 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5514,7 +5514,7 @@ bool Sema::CheckWebAssemblyBuiltinFunctionCall(const 
TargetInfo ,
   return false;
 }
 
-void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
+void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D) {
   const TargetInfo  = Context.getTargetInfo();
   // (ELEN, LMUL) pairs of (8, mf8), (16, mf4), (32, mf2), (64, m1) requires at
   // least zve64x
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d6e090ee496eb30..37060f668b7acf3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8866,7 +8866,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
   }
 
   if (T->isRVVType())
-checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
+checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
 }
 
 /// Perform semantic checking on a newly-created variable
diff --git a/clang/test/Sema/riscv-vector-with-openmp.c 
b/clang/test/Sema/riscv-vector-with-openmp.c
new file mode 100644
index 000..5858fb99ed82d46
--- /dev/null
+++ b/clang/test/Sema/riscv-vector-with-openmp.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
+// RUN:   -disable-O0-optnone -o - -fsyntax-only -fopenmp %s -verify 
+// REQUIRES: riscv-registered-target
+// expected-no-diagnostics
+
+void foo() {
+  #pragma omp parallel
+  {
+__rvv_int32m1_t i32m1;
+  }
+}

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Jessica Clarke via cfe-commits


@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
+// RUN:   -disable-O0-optnone -o - -fsyntax-only -fopenmp %s -verify 
+// REQUIRES: riscv-registered-target
+// expected-no-diagnostics

jrtc27 wrote:

```suggestion

// expected-no-diagnostics

```

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Jessica Clarke via cfe-commits

https://github.com/jrtc27 requested changes to this pull request.


https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Jessica Clarke via cfe-commits


@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
+// RUN:   -disable-O0-optnone -o - -fsyntax-only -fopenmp %s -verify 

jrtc27 wrote:

-disable-O0-optnone is pointless unless you're generating code *and* piping it 
to opt, but you're doing neither. Similarly -o - is pointless with 
-fsyntax-only -verify given you're not producing output (except from -verify 
itself directly to stdio).

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Jessica Clarke via cfe-commits

https://github.com/jrtc27 edited https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Jessica Clarke via cfe-commits


@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
+// RUN:   -disable-O0-optnone -o - -fsyntax-only -fopenmp %s -verify 
+// REQUIRES: riscv-registered-target
+// expected-no-diagnostics
+#include 

jrtc27 wrote:

This is shipped by Clang not the system

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Alexey Bataev via cfe-commits


@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
+// RUN:   -disable-O0-optnone -o - -fsyntax-only -fopenmp %s -verify 
+// REQUIRES: riscv-registered-target
+// expected-no-diagnostics
+#include 

alexey-bataev wrote:

No includes of system headers are allowed here, declare the type manually.

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread via cfe-commits

https://github.com/github-actions[bot] labeled 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD updated 
https://github.com/llvm/llvm-project/pull/65778:

>From ebffa141090d5274db8a88b5450325e34316a18b Mon Sep 17 00:00:00 2001
From: eopXD 
Date: Fri, 8 Sep 2023 09:59:25 -0700
Subject: [PATCH] [Clang][RISCV] Use Decl for checkRVVTypeSupport

Using ValueDecl will cause error for OpenMP. Decl should do the work.
---
 clang/include/clang/Sema/Sema.h|  2 +-
 clang/lib/Sema/SemaChecking.cpp|  2 +-
 clang/lib/Sema/SemaDecl.cpp|  2 +-
 clang/test/Sema/riscv-vector-with-openmp.c | 12 
 4 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 clang/test/Sema/riscv-vector-with-openmp.c

diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 4fd0e6bd5982a71..5c7207062741b52 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -13726,7 +13726,7 @@ class Sema final {
   bool CheckRISCVLMUL(CallExpr *TheCall, unsigned ArgNum);
   bool CheckRISCVBuiltinFunctionCall(const TargetInfo , unsigned BuiltinID,
  CallExpr *TheCall);
-  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D);
+  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D);
   bool CheckLoongArchBuiltinFunctionCall(const TargetInfo ,
  unsigned BuiltinID, CallExpr 
*TheCall);
   bool CheckWebAssemblyBuiltinFunctionCall(const TargetInfo ,
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 3932d9cd07d9864..3b4ac613da76aa8 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5514,7 +5514,7 @@ bool Sema::CheckWebAssemblyBuiltinFunctionCall(const 
TargetInfo ,
   return false;
 }
 
-void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
+void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D) {
   const TargetInfo  = Context.getTargetInfo();
   // (ELEN, LMUL) pairs of (8, mf8), (16, mf4), (32, mf2), (64, m1) requires at
   // least zve64x
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d6e090ee496eb30..37060f668b7acf3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8866,7 +8866,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
   }
 
   if (T->isRVVType())
-checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
+checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
 }
 
 /// Perform semantic checking on a newly-created variable
diff --git a/clang/test/Sema/riscv-vector-with-openmp.c 
b/clang/test/Sema/riscv-vector-with-openmp.c
new file mode 100644
index 000..2408152f9848e36
--- /dev/null
+++ b/clang/test/Sema/riscv-vector-with-openmp.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple riscv64 -target-feature +v \
+// RUN:   -disable-O0-optnone -o - -fsyntax-only -fopenmp %s -verify 
+// REQUIRES: riscv-registered-target
+// expected-no-diagnostics
+#include 
+
+void foo() {
+  #pragma omp parallel
+  {
+vint32m1_t i32m1;
+  }
+}

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Alexey Bataev via cfe-commits

alexey-bataev wrote:

Need to add the test

https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread via cfe-commits

https://github.com/github-actions[bot] labeled 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD created 
https://github.com/llvm/llvm-project/pull/65778:

Using ValueDecl will cause error for OpenMP. Decl should do the work.

>From 559c8a27f34c983822bb00dfd45c71798c7ecb36 Mon Sep 17 00:00:00 2001
From: eopXD 
Date: Fri, 8 Sep 2023 09:59:25 -0700
Subject: [PATCH] [Clang][RISCV] Use Decl for checkRVVTypeSupport

Using ValueDecl will cause error for OpenMP. Decl should do the work.
---
 clang/include/clang/Sema/Sema.h | 2 +-
 clang/lib/Sema/SemaChecking.cpp | 2 +-
 clang/lib/Sema/SemaDecl.cpp | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 4fd0e6bd5982a71..5c7207062741b52 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -13726,7 +13726,7 @@ class Sema final {
   bool CheckRISCVLMUL(CallExpr *TheCall, unsigned ArgNum);
   bool CheckRISCVBuiltinFunctionCall(const TargetInfo , unsigned BuiltinID,
  CallExpr *TheCall);
-  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D);
+  void checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D);
   bool CheckLoongArchBuiltinFunctionCall(const TargetInfo ,
  unsigned BuiltinID, CallExpr 
*TheCall);
   bool CheckWebAssemblyBuiltinFunctionCall(const TargetInfo ,
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 3932d9cd07d9864..3b4ac613da76aa8 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5514,7 +5514,7 @@ bool Sema::CheckWebAssemblyBuiltinFunctionCall(const 
TargetInfo ,
   return false;
 }
 
-void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
+void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, Decl *D) {
   const TargetInfo  = Context.getTargetInfo();
   // (ELEN, LMUL) pairs of (8, mf8), (16, mf4), (32, mf2), (64, m1) requires at
   // least zve64x
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d6e090ee496eb30..37060f668b7acf3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8866,7 +8866,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
   }
 
   if (T->isRVVType())
-checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
+checkRVVTypeSupport(T, NewVD->getLocation(), cast(CurContext));
 }
 
 /// Perform semantic checking on a newly-created variable

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Clang][RISCV] Use Decl for checkRVVTypeSupport (PR #65778)

2023-09-08 Thread Yueh-Ting Chen via cfe-commits

https://github.com/eopXD review_requested 
https://github.com/llvm/llvm-project/pull/65778
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits