Add a simple cache for constraint satisfaction results. This results in a
major speedup (cjdb measured x2 faster than gcc with this caching, compared
to being 'unbearably slow' without caching) and is conformant with gcc's
implementation.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Mechanically, this looks fine.
There's an ongoing discussion in the committee as to whether this kind of caching is permissible. But if this is necessary for acceptable performance, let's take this for now and figure out how to invalidate the cache as necessary later. Perhaps a -f flag to turn this off would be useful, so we can demonstrate and measure the performance delta.
If there were a flag to turn this on and off, I would be happy to provide numbers for a real code base so we can understand how important of an optimization this is.
clang/lib/AST/ASTConcept.cpp | ||
---|---|---|
17 | This causes a circular dependency between AST and Sema. It looks like you are including this header to get access to some classes, but you should include the direct header instead. These are the headers for the classes you are using in ConstraintSatisfaction::Profile: NamedDecl -> clang/AST/Decl.h Please update the header includes to resolve the circular dependency. |
It looks like the concept changes broke the debugger (quite spectacularly actually):
http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/3356
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/12872
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/6407/
I'm rebuilding locally to see if I can reproduce
Most likely because of https://reviews.llvm.org/D65042 rather than this change, I see you made changes to the AST importer.
This causes a circular dependency between AST and Sema. It looks like you are including this header to get access to some classes, but you should include the direct header instead. These are the headers for the classes you are using in ConstraintSatisfaction::Profile:
NamedDecl -> clang/AST/Decl.h
TemplateArgument -> clang/AST/TemplateBase.h
ArrayRef -> llvm/ADT/ArrayRef.h
FoldingSetNodeID -> llvm/ADT/FoldingSet.h
Please update the header includes to resolve the circular dependency.