[clang] [Clang][RVV][SVE] Cache getScalableVectorType lookups (PR #160108)

Paul Walker via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 26 04:34:12 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};
----------------
paulwalker-arm wrote:

It was `clang/include/clang/AST/TypeOrdering.h` only using `OpaquePtr` for hashing but then `isEqual` using a direct comparison that first made me wonder. Perhaps it's not a problem, but the current version makes me more comfortable and it'll be easier enough to change if my paranoia proves unfounded.

https://github.com/llvm/llvm-project/pull/160108


More information about the cfe-commits mailing list