[all-commits] [llvm/llvm-project] 8fd56e: [clang][deps] NFC: Speed up canonical context hash...
Jan Svoboda via All-commits
all-commits at lists.llvm.org
Thu Aug 3 20:37:01 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8fd56ea11256f220502fe9819b496b15582f8d1e
https://github.com/llvm/llvm-project/commit/8fd56ea11256f220502fe9819b496b15582f8d1e
Author: Jan Svoboda <jan_svoboda at apple.com>
Date: 2023-08-03 (Thu, 03 Aug 2023)
Changed paths:
M clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
Log Message:
-----------
[clang][deps] NFC: Speed up canonical context hash computation
This patch makes use of the infrastructure established in D157046 to speed up computation of the canonical context hash in the dependency scanner. This is somewhat hot code, since it's ran for all modules in the dependency graph of every TU.
I also tried an alternative approach that tried to avoid allocations as much as possible (essentially doing `HashBuilder.add(Arg.toStringRef(ArgVec))`), but that turned out to be slower than approach in this patch.
Note that this is not problematic in the same way command-line hashing used to be prior D143027. The lambda is now being called even for constant strings.
Depends on D157046.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D157052
More information about the All-commits
mailing list