summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-11-18 06:52:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-11-18 06:52:18 +0000
commit55512f9b251df3023f0cbf858f28835992f18165 (patch)
treecdcec29f83c4076239f450e68ba736557bef2b58 /llvm/lib
parent2d16145acfb67c7498cf43a7a3fd04b543a2a767 (diff)
downloadbcm5719-llvm-55512f9b251df3023f0cbf858f28835992f18165.tar.gz
bcm5719-llvm-55512f9b251df3023f0cbf858f28835992f18165.zip
Default SetVector to use a DenseSet.
We use to have an odd difference among MapVector and SetVector. The map used a DenseMop, but the set used a SmallSet, which in turn uses a std::set. I have changed SetVector to use a DenseSet. If you were depending on the old behaviour you can pass an explicit set type or use SmallSetVector. The common cases for needing to do it are: * Optimizing for small sets. * Sets for types not supported by DenseSet. llvm-svn: 253439
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/AliasAnalysisEvaluator.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
index b1dca1d9375..c2a95cc31ea 100644
--- a/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
@@ -145,7 +145,7 @@ bool AAEval::runOnFunction(Function &F) {
AliasAnalysis &AA = getAnalysis<AAResultsWrapperPass>().getAAResults();
SetVector<Value *> Pointers;
- SetVector<CallSite> CallSites;
+ SmallSetVector<CallSite, 16> CallSites;
SetVector<Value *> Loads;
SetVector<Value *> Stores;
@@ -284,8 +284,7 @@ bool AAEval::runOnFunction(Function &F) {
}
// Mod/ref alias analysis: compare all pairs of calls and values
- for (SetVector<CallSite>::iterator C = CallSites.begin(),
- Ce = CallSites.end(); C != Ce; ++C) {
+ for (auto C = CallSites.begin(), Ce = CallSites.end(); C != Ce; ++C) {
Instruction *I = C->getInstruction();
for (SetVector<Value *>::iterator V = Pointers.begin(), Ve = Pointers.end();
@@ -316,9 +315,8 @@ bool AAEval::runOnFunction(Function &F) {
}
// Mod/ref alias analysis: compare all pairs of calls
- for (SetVector<CallSite>::iterator C = CallSites.begin(),
- Ce = CallSites.end(); C != Ce; ++C) {
- for (SetVector<CallSite>::iterator D = CallSites.begin(); D != Ce; ++D) {
+ for (auto C = CallSites.begin(), Ce = CallSites.end(); C != Ce; ++C) {
+ for (auto D = CallSites.begin(); D != Ce; ++D) {
if (D == C)
continue;
switch (AA.getModRefInfo(*C, *D)) {
OpenPOWER on IntegriCloud