summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
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/Transforms/Utils
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/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp2
-rw-r--r--llvm/lib/Transforms/Utils/SplitModule.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index fd9c7f6f886..b5eba29dcf2 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1465,7 +1465,7 @@ void llvm::removeUnwindEdge(BasicBlock *BB) {
/// if they are in a dead cycle. Return true if a change was made, false
/// otherwise.
bool llvm::removeUnreachableBlocks(Function &F, LazyValueInfo *LVI) {
- SmallPtrSet<BasicBlock*, 128> Reachable;
+ SmallPtrSet<BasicBlock*, 16> Reachable;
bool Changed = markAliveBlocks(F, Reachable);
// If there are unreachable blocks in the CFG...
diff --git a/llvm/lib/Transforms/Utils/SplitModule.cpp b/llvm/lib/Transforms/Utils/SplitModule.cpp
index dcb2307bfa9..993d3e58db4 100644
--- a/llvm/lib/Transforms/Utils/SplitModule.cpp
+++ b/llvm/lib/Transforms/Utils/SplitModule.cpp
@@ -138,7 +138,7 @@ static void findPartitions(Module *M, ClusterIDMapType &ClusterIDMap,
typedef std::pair<unsigned, ClusterMapType::iterator> SortType;
SmallVector<SortType, 64> Sets;
- SmallPtrSet<const GlobalValue *, 64> Visited;
+ SmallPtrSet<const GlobalValue *, 32> Visited;
// To guarantee determinism, we have to sort SCC according to size.
// When size is the same, use leader's name.
OpenPOWER on IntegriCloud