summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorStepan Dyatkovskiy <stpworld@narod.ru>2012-07-03 13:46:45 +0000
committerStepan Dyatkovskiy <stpworld@narod.ru>2012-07-03 13:46:45 +0000
commit8b0c97e0ddc683c109bb1fea88e447e0fd77eb09 (patch)
tree62703a1a99bb569b88c2d7973032a2d6be43a1f0 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parent438ba5f0bda1fdbdd40ba7920b8c8cd8e178815b (diff)
downloadbcm5719-llvm-8b0c97e0ddc683c109bb1fea88e447e0fd77eb09.tar.gz
bcm5719-llvm-8b0c97e0ddc683c109bb1fea88e447e0fd77eb09.zip
Part of r159527. Splitted into series of patches and gone with fixed PR13256:
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: 159659
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 42b9099cdc3..2d074079ccf 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -2450,22 +2450,23 @@ size_t SelectionDAGBuilder::Clusterify(CaseVector& Cases,
size_t numCmps = 0;
for (Clusterifier::RangeIterator i = TheClusterifier.begin(),
e = TheClusterifier.end(); i != e; ++i, ++numCmps) {
- Clusterifier::Cluster &C = *i;
+ const Clusterifier::RangeEx &R = i->first;
+ MachineBasicBlock *MBB = i->second;
unsigned W = 0;
if (BPI) {
- W = BPI->getEdgeWeight(SI.getParent(), C.second->getBasicBlock());
+ W = BPI->getEdgeWeight(SI.getParent(), MBB->getBasicBlock());
if (!W)
W = 16;
- W *= C.first.Weight;
- BPI->setEdgeWeight(SI.getParent(), C.second->getBasicBlock(), W);
+ W *= R.Weight;
+ BPI->setEdgeWeight(SI.getParent(), MBB->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(C.first.getLow().toConstantInt(),
- C.first.getHigh().toConstantInt(), C.second, W));
+ Cases.push_back(Case(R.getLow().toConstantInt(),
+ R.getHigh().toConstantInt(), MBB, W));
- if (C.first.getLow() != C.first.getHigh())
+ if (R.getLow() != R.getHigh())
// A range counts double, since it requires two compares.
++numCmps;
}
OpenPOWER on IntegriCloud