summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-01-30 01:24:31 +0000
committerMatthias Braun <matze@braunis.de>2016-01-30 01:24:31 +0000
commitb30f2f51410449a6d476fed5c486a4ef8fd5f912 (patch)
treeaf58fd7a768c6b601eaf890020aa3e2b4a3130b6 /llvm/lib/Analysis
parentdaa812d518b1f49feddeb08fcc9c5e563b0bf11e (diff)
downloadbcm5719-llvm-b30f2f51410449a6d476fed5c486a4ef8fd5f912.tar.gz
bcm5719-llvm-b30f2f51410449a6d476fed5c486a4ef8fd5f912.zip
Avoid overly large SmallPtrSet/SmallSet
These sets perform linear searching in small mode so it is never a good idea to use SmallSize/N bigger than 32. llvm-svn: 259283
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/CFG.cpp2
-rw-r--r--llvm/lib/Analysis/GlobalsModRef.cpp4
-rw-r--r--llvm/lib/Analysis/MemoryDependenceAnalysis.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/CFG.cpp b/llvm/lib/Analysis/CFG.cpp
index 0dfd57d3cb6..a319be8092f 100644
--- a/llvm/lib/Analysis/CFG.cpp
+++ b/llvm/lib/Analysis/CFG.cpp
@@ -138,7 +138,7 @@ bool llvm::isPotentiallyReachableFromMany(
// Limit the number of blocks we visit. The goal is to avoid run-away compile
// times on large CFGs without hampering sensible code. Arbitrarily chosen.
unsigned Limit = 32;
- SmallSet<const BasicBlock*, 64> Visited;
+ SmallPtrSet<const BasicBlock*, 32> Visited;
do {
BasicBlock *BB = Worklist.pop_back_val();
if (!Visited.insert(BB).second)
diff --git a/llvm/lib/Analysis/GlobalsModRef.cpp b/llvm/lib/Analysis/GlobalsModRef.cpp
index db3d5f781d8..8338dcc9c1d 100644
--- a/llvm/lib/Analysis/GlobalsModRef.cpp
+++ b/llvm/lib/Analysis/GlobalsModRef.cpp
@@ -269,7 +269,7 @@ GlobalsAAResult::getFunctionInfo(const Function *F) {
/// (really, their address passed to something nontrivial), record this fact,
/// and record the functions that they are used directly in.
void GlobalsAAResult::AnalyzeGlobals(Module &M) {
- SmallPtrSet<Function *, 64> TrackedFunctions;
+ SmallPtrSet<Function *, 32> TrackedFunctions;
for (Function &F : M)
if (F.hasLocalLinkage())
if (!AnalyzeUsesOfPointer(&F)) {
@@ -281,7 +281,7 @@ void GlobalsAAResult::AnalyzeGlobals(Module &M) {
++NumNonAddrTakenFunctions;
}
- SmallPtrSet<Function *, 64> Readers, Writers;
+ SmallPtrSet<Function *, 16> Readers, Writers;
for (GlobalVariable &GV : M.globals())
if (GV.hasLocalLinkage()) {
if (!AnalyzeUsesOfPointer(&GV, &Readers,
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 6918360536a..9492801bba2 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -854,7 +854,7 @@ MemoryDependenceAnalysis::getNonLocalCallDependency(CallSite QueryCS) {
// isReadonlyCall - If this is a read-only call, we can be more aggressive.
bool isReadonlyCall = AA->onlyReadsMemory(QueryCS);
- SmallPtrSet<BasicBlock*, 64> Visited;
+ SmallPtrSet<BasicBlock*, 32> Visited;
unsigned NumSortedEntries = Cache.size();
DEBUG(AssertSorted(Cache));
OpenPOWER on IntegriCloud