Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ static cl::opt<unsigned>
cl::desc("The number of blocks to scan during memory "
"dependency analysis (default = 200)"));

static cl::opt<unsigned> CacheGlobalLimit(
"cache-global-limit", cl::Hidden, cl::init(10000),
cl::desc("The max number of entries allowed in a cache (default = 10000)"));

// Limit on the number of memdep results to process.
static const unsigned int NumResultsLimit = 100;

Expand Down Expand Up @@ -1142,6 +1146,11 @@ bool MemoryDependenceResults::getNonLocalPointerDepFromBB(
return true;
}

// If the size of this cache has surpassed the global limit, stop here.
if (Cache->size() > CacheGlobalLimit) {
return false;
}

// Otherwise, either this is a new block, a block with an invalid cache
// pointer or one that we're about to invalidate by putting more info into
// it than its valid cache info. If empty and not explicitly indicated as
Expand Down