[all-commits] [llvm/llvm-project] 7b4846: Bypass setup for complete local DeclContext lookups

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


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

  Changed paths:
    M clang/lib/AST/DeclBase.cpp
    M clang/unittests/AST/DeclTest.cpp
    M clang/unittests/AST/ExternalASTSourceTest.cpp

  Log Message:
  -----------
  Bypass setup for complete local DeclContext lookups

Query an existing complete local lookup map directly. Preserve the full
primary-context and external-source path whenever lazy or external
storage can affect the result. An external source can load later
redeclarations even without current external-storage flags, so exclude
it from the shortcut. Verify that a cached map still belongs to the
current primary context after namespace relinking. Add regression tests
for both transitions.

The following measurements predate the additional guards above.
CTMark O0 (3 samples, CPU 6): 29.439800 s -> 29.268133 s (-0.583%).

Impact on significant TUs in MLIR build time:
- `mlir/lib/RegisterAllDialects.cpp`: 1.3266% fewer retired
  instructions.
- `mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp`: 0.4887% fewer retired
  instructions.

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