aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2023-12-11 12:16:59 -0800
committerCraig Topper <craig.topper@sifive.com>2023-12-11 12:21:09 -0800
commit13662211c32cb9034b67d7fe0fb73fdebd15471e (patch)
tree6c6f64929c744384ab0dd4736f38709a9162d4fb /clang/lib/Sema/SemaChecking.cpp
parent7ec399485218e24e80ad403b0abcf84c93fcd51e (diff)
downloadllvm-13662211c32cb9034b67d7fe0fb73fdebd15471e.zip
llvm-13662211c32cb9034b67d7fe0fb73fdebd15471e.tar.gz
llvm-13662211c32cb9034b67d7fe0fb73fdebd15471e.tar.bz2
[RISCV] Simplify checking whether SEW=64 multiply builtins require V. NFC
We only need to check the result type. Use getBuiltinVectorTypeInfo to lookup the element size.
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 08c03d7..4c51877 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -5213,12 +5213,10 @@ bool Sema::CheckRISCVBuiltinFunctionCall(const TargetInfo &TI,
case RISCVVector::BI__builtin_rvv_vsmul_vx_tum:
case RISCVVector::BI__builtin_rvv_vsmul_vv_tumu:
case RISCVVector::BI__builtin_rvv_vsmul_vx_tumu: {
- bool RequireV = false;
- for (unsigned ArgNum = 0; ArgNum < TheCall->getNumArgs(); ++ArgNum)
- RequireV |= TheCall->getArg(ArgNum)->getType()->isRVVType(
- /* Bitwidth */ 64, /* IsFloat */ false);
+ ASTContext::BuiltinVectorTypeInfo Info = Context.getBuiltinVectorTypeInfo(
+ TheCall->getType()->castAs<BuiltinType>());
- if (RequireV && !TI.hasFeature("v"))
+ if (Context.getTypeSize(Info.ElementType) == 64 && !TI.hasFeature("v"))
return Diag(TheCall->getBeginLoc(),
diag::err_riscv_builtin_requires_extension)
<< /* IsExtension */ false << TheCall->getSourceRange() << "v";