diff options
author | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-07-04 05:53:05 +0000 |
---|---|---|
committer | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-07-04 05:53:05 +0000 |
commit | 66d79cefcb742bdbfef8823ac8491a7ebc4af5a7 (patch) | |
tree | c099a0c9d2d12596b78b44759783e3c4ac6521eb /lib/Transforms/Utils/LowerSwitch.cpp | |
parent | caba263c8e28474e3d6feb307af8fc4445645962 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159703 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LowerSwitch.cpp')
-rw-r--r-- | lib/Transforms/Utils/LowerSwitch.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp index d2bd9d0284..1547439b5c 100644 --- a/lib/Transforms/Utils/LowerSwitch.cpp +++ b/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; } |