[clang] [Clang][RVV][SVE] Cache getScalableVectorType lookups (PR #160108)
Shaoce SUN via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 25 09:14:53 PDT 2025
================
@@ -4567,6 +4567,11 @@ QualType ASTContext::getWebAssemblyExternrefType() const {
/// type.
QualType ASTContext::getScalableVectorType(QualType EltTy, unsigned NumElts,
unsigned NumFields) const {
+ auto K = llvm::ScalableVecTyKey{
+ reinterpret_cast<uintptr_t>(EltTy.getAsOpaquePtr()), NumElts, NumFields};
----------------
sunshaoce wrote:
Thanks for your comments and the example. I think using `OpaquePtr` is safe, since `DenseMapInfo<clang::QualType>` in `clang/include/clang/AST/TypeOrdering.h` also uses `OpaquePtr`. I initially chose `OpaquePtr` because it is more lightweight. I’ve now submitted a commit that uses `QualType` directly instead. Which approach do you think is better?
https://github.com/llvm/llvm-project/pull/160108
More information about the cfe-commits
mailing list