[PATCH] D153510: [Clang][RISCV] Check type support for local variable declaration of RVV type

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 24 00:18:53 PDT 2023


craig.topper added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:4968
+void Sema::checkRVVTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
+  const TargetInfo &TI = Context.getTargetInfo();
+  if (Ty->isRVVType(/* Bitwidth */ 64, /* IsFloat */ false) &&
----------------
eopXD wrote:
> craig.topper wrote:
> > Do we need to diagnose the use of any RVV type without at least zve32x?
> If users will be using RVV intrinsic types, they will need to include <riscv_vector.h>, and the header is guarded by zve32x. So I think we don't need the check for at least zve32x.
> 
> ```
> $ bin/clang -march=rv64g -emit-llvm -S -o - test.c
> In file included from test.c:1:
> /scratch/eopc/upstream-llvm-project2/build/lib/clang/17/include/riscv_vector.h:18:2: error: "Vector intrinsics require the vector extension."
>    18 | #error "Vector intrinsics require the vector extension."
>       |  ^
> 1 error generated.
> ```
The `__rvv` prefixed names are still available and do crash the backend if you use them without zve32x.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153510



More information about the cfe-commits mailing list