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/CodeGen/SelectionDAG/SelectionDAGBuilder.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/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 2d074079cc..42b9099cdc 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -2450,23 +2450,22 @@ size_t SelectionDAGBuilder::Clusterify(CaseVector& Cases, size_t numCmps = 0; for (Clusterifier::RangeIterator i = TheClusterifier.begin(), e = TheClusterifier.end(); i != e; ++i, ++numCmps) { - const Clusterifier::RangeEx &R = i->first; - MachineBasicBlock *MBB = i->second; + Clusterifier::Cluster &C = *i; unsigned W = 0; if (BPI) { - W = BPI->getEdgeWeight(SI.getParent(), MBB->getBasicBlock()); + W = BPI->getEdgeWeight(SI.getParent(), C.second->getBasicBlock()); if (!W) W = 16; - W *= R.Weight; - BPI->setEdgeWeight(SI.getParent(), MBB->getBasicBlock(), W); + W *= C.first.Weight; + BPI->setEdgeWeight(SI.getParent(), C.second->getBasicBlock(), W); } // FIXME: Currently work with ConstantInt based numbers. // Changing it to APInt based is a pretty heavy for this commit. - Cases.push_back(Case(R.getLow().toConstantInt(), - R.getHigh().toConstantInt(), MBB, W)); + Cases.push_back(Case(C.first.getLow().toConstantInt(), + C.first.getHigh().toConstantInt(), C.second, W)); - if (R.getLow() != R.getHigh()) + if (C.first.getLow() != C.first.getHigh()) // A range counts double, since it requires two compares. ++numCmps; } |