Skip to content

Commit

Permalink
Initialize BasicAA's AliasCache to set it to use fewer buckets by
Browse files Browse the repository at this point in the history
default, since it usually has very few elements. This speeds up
alias queries in many cases, because AliasCache.clear() doesn't
have to visit as many buckets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132862 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Dan Gohman committed Jun 10, 2011
1 parent a1f21e6 commit 9a09ca3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Analysis/BasicAliasAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,13 @@ namespace {
/// BasicAliasAnalysis - This is the primary alias analysis implementation.
struct BasicAliasAnalysis : public ImmutablePass, public AliasAnalysis {
static char ID; // Class identification, replacement for typeinfo
BasicAliasAnalysis() : ImmutablePass(ID) {
BasicAliasAnalysis() : ImmutablePass(ID),
// AliasCache rarely has more than 1 or 2 elements,
// so start it off fairly small so that clear()
// doesn't have to tromp through 64 (the default)
// elements on each alias query. This really wants
// something like a SmallDenseMap.
AliasCache(8) {
initializeBasicAliasAnalysisPass(*PassRegistry::getPassRegistry());
}

Expand Down

0 comments on commit 9a09ca3

Please sign in to comment.