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 | 7ff588f986d33557ead98bfd57d1a733844806d8 (patch) | |
tree | 82a4396cfd1fe7cd3170db0e1e24949df3528d7f /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | 686eec102c09d9633a659bbc30554f2d9cfb7b54 (diff) | |
download | bcm5719-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/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 2d074079ccf..42b9099cdc3 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/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; } |