Skip to content

Conversation

tbaederr
Copy link
Contributor

isRVVType() is suprisingly expensive, so do the checks only if the target has rvv types.

isRVVType() is suprisingly expensive, so do the checks only if the
target has rvv types.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Sep 28, 2023
@llvmbot
Copy link
Member

llvmbot commented Sep 28, 2023

@llvm/pr-subscribers-clang

Changes

isRVVType() is suprisingly expensive, so do the checks only if the target has rvv types.


Full diff: https://github.com/llvm/llvm-project/pull/67669.diff

1 Files Affected:

  • (modified) clang/lib/Sema/Sema.cpp (+1-1)
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index a401017d4c1c0b8..2d175c9b9a791dd 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -2050,7 +2050,7 @@ void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {
         targetDiag(D->getLocation(), diag::note_defined_here, FD) << D;
     }
 
-    if (Ty->isRVVType())
+    if (TI.hasRISCVVTypes() && Ty->isRVVType())
       checkRVVTypeSupport(Ty, Loc, D);
 
     // Don't allow SVE types in functions without a SVE target.

@tbaederr tbaederr changed the title [clang][Sema] Only check RVV types is we have them [clang][Sema] Only check RVV types if we have them Sep 28, 2023
@tbaederr
Copy link
Contributor Author

tbaederr commented Oct 6, 2023

Ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants