[all-commits] [llvm/llvm-project] f04bee: [Clang] Prototype explicit ASTContext threading th...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Fri Sep 11 15:30:12 PDT 2026


  Branch: refs/heads/users/mamini/clang-speed-context-threading
  Home:   https://github.com/llvm/llvm-project
  Commit: f04bee1dc28a9ce82c6050ceb1f0831406e44380
      https://github.com/llvm/llvm-project/commit/f04bee1dc28a9ce82c6050ceb1f0831406e44380
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-09-11 (Fri, 11 Sep 2026)

  Changed paths:
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/DeclCXX.h
    M clang/include/clang/AST/DeclTemplate.h
    M clang/lib/AST/CXXInheritance.cpp
    M clang/lib/AST/Decl.cpp
    M clang/lib/AST/DeclCXX.cpp
    M clang/lib/AST/DeclTemplate.cpp
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaLookup.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp

  Log Message:
  -----------
  [Clang] Prototype explicit ASTContext threading through hot queries

Pass the owning AST context through selected declaration, constructor,
override, inheritance, template lookup, and CodeGen query chains.
Retain fallback APIs for callers without an available context, and reuse
the context locally within addedMember without adding AST storage.

This is an experimental alternative to the inline ASTContext lookup
change, based on its relationship-cache parent. Some overloads duplicate
implementation bodies and need consolidation before a production proposal.

Five paired runs on each MLIR source file reduced retired instructions by
1.59% on RegisterAllDialects.cpp and 0.86% on NVVMDialect.cpp. Median wall
time improved by 0.88% and 0.45%, respectively. This recovers about 72% and
58% of the inline variant instruction reduction, not its full performance.

Validation: Clang and AllClangUnitTests rebuilt; 46 focused unit tests and
3,076 Sema regression tests passed. Representative objects match the parent
and inline variants after removing only the compiler identification section.

Assisted-by: Codex



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list