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
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 2d07407..42b9099 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2450,23 +2450,22 @@
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;
}