Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][Sema] Only check RVV types if we have them #67669

Merged
merged 1 commit into from
Oct 6, 2023

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
Collaborator

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

@tbaederr tbaederr merged commit 3717147 into llvm:main Oct 6, 2023
5 checks passed
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.

None yet

3 participants