[RISCV] Validate the SEW and LMUL operands to __builtin_rvv_vsetvli(max)
authorCraig Topper <craig.topper@sifive.com>
Mon, 10 May 2021 18:30:45 +0000 (11:30 -0700)
committerCraig Topper <craig.topper@sifive.com>
Mon, 10 May 2021 19:11:13 +0000 (12:11 -0700)
commit18f3a14e1328c813fa5dbacc9bb931d22f0669cd
tree6bd08f72de03fe3f572e25d74890128626b7142f
parentdc75499998352ffbbe0d1da196631ddb73ad47f3
[RISCV] Validate the SEW and LMUL operands to __builtin_rvv_vsetvli(max)

These are required to be constants, this patch makes sure they
are in the accepted range of values.

These are usually created by wrappers in the riscv_vector.h header
which should always be correct. This patch protects against a user
using the builtin directly.

Reviewed By: khchen

Differential Revision: https://reviews.llvm.org/D102086
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/RISCV/rvv_errors.c [new file with mode: 0644]