diff options
author | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-07-02 13:02:18 +0000 |
---|---|---|
committer | Stepan Dyatkovskiy <stpworld@narod.ru> | 2012-07-02 13:02:18 +0000 |
commit | 8b9ecca42d2bc2c9d3741d3a15a2fb306b821ab1 (patch) | |
tree | 63a0392527015694b32b2c3cb5416d915b55d2f6 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | |
parent | a5a29f970eea116b38064453d21066127473171c (diff) | |
download | bcm5719-llvm-8b9ecca42d2bc2c9d3741d3a15a2fb306b821ab1.tar.gz bcm5719-llvm-8b9ecca42d2bc2c9d3741d3a15a2fb306b821ab1.zip |
IntRange:
- Changed isSingleNumber method behaviour. Now this flag is calculated on demand.
IntegersSubsetMapping
- Optimized diff operation.
- Replaced type of Items field from std::list with std::map.
- Added new methods:
bool isOverlapped(self &RHS)
void add(self& RHS, SuccessorClass *S)
void detachCase(self& NewMapping, SuccessorClass *Succ)
void removeCase(SuccessorClass *Succ)
SuccessorClass *findSuccessor(const IntTy& Val)
const IntTy* getCaseSingleNumber(SuccessorClass *Succ)
IntegersSubsetTest
- DiffTest: Added checks for successors.
SimplifyCFG
Updated SwitchInst usage (now it is case-ragnes compatible) for
- SimplifyEqualityComparisonWithOnlyPredecessor
- FoldValueComparisonIntoPredecessors
llvm-svn: 159527
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 957d00ac32b..72e57696ded 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; } |