summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LowerSwitch.cpp
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-07-04 05:53:05 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-07-04 05:53:05 +0000
commit7ff588f986d33557ead98bfd57d1a733844806d8 (patch)
tree82a4396cfd1fe7cd3170db0e1e24949df3528d7f /llvm/lib/Transforms/Utils/LowerSwitch.cpp
parent686eec102c09d9633a659bbc30554f2d9cfb7b54 (diff)
downloadbcm5719-llvm-7ff588f986d33557ead98bfd57d1a733844806d8.tar.gz
bcm5719-llvm-7ff588f986d33557ead98bfd57d1a733844806d8.zip
Reverted r156659, due to probable performance regressions, DenseMap should be used here:
IntegersSubsetMapping - Replaced type of Items field from std::list with std::map. In neares future I'll test it with DenseMap and do the correspond replacement if possible. llvm-svn: 159703
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerSwitch.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LowerSwitch.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerSwitch.cpp b/llvm/lib/Transforms/Utils/LowerSwitch.cpp
index d2bd9d02846..1547439b5c6 100644
--- a/llvm/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/llvm/lib/Transforms/Utils/LowerSwitch.cpp
@@ -238,14 +238,13 @@ unsigned LowerSwitch::Clusterify(CaseVector& Cases, SwitchInst *SI) {
size_t numCmps = 0;
for (IntegersSubsetToBB::RangeIterator i = TheClusterifier.begin(),
e = TheClusterifier.end(); i != e; ++i, ++numCmps) {
- const IntegersSubsetToBB::RangeTy &R = i->first;
- BasicBlock *S = i->second;
+ IntegersSubsetToBB::Cluster &C = *i;
// FIXME: Currently work with ConstantInt based numbers.
// Changing it to APInt based is a pretty heavy for this commit.
- Cases.push_back(CaseRange(R.getLow().toConstantInt(),
- R.getHigh().toConstantInt(), S));
- if (R.isSingleNumber())
+ Cases.push_back(CaseRange(C.first.getLow().toConstantInt(),
+ C.first.getHigh().toConstantInt(), C.second));
+ if (C.first.isSingleNumber())
// A range counts double, since it requires two compares.
++numCmps;
}
OpenPOWER on IntegriCloud