forked from OSchip/llvm-project
SelectionDAGBuilder::handleJTSwitchCase, simplify loop; NFC
llvm-svn: 232830
This commit is contained in:
parent
ecf380ef3b
commit
2bdc4cf35f
|
@ -2337,15 +2337,10 @@ bool SelectionDAGBuilder::handleJTSwitchCase(CaseRec &CR,
|
|||
|
||||
// Calculate weight for each unique destination in CR.
|
||||
DenseMap<MachineBasicBlock*, uint32_t> DestWeights;
|
||||
if (FuncInfo.BPI)
|
||||
for (CaseItr I = CR.Range.first, E = CR.Range.second; I != E; ++I) {
|
||||
DenseMap<MachineBasicBlock*, uint32_t>::iterator Itr =
|
||||
DestWeights.find(I->BB);
|
||||
if (Itr != DestWeights.end())
|
||||
Itr->second += I->ExtraWeight;
|
||||
else
|
||||
DestWeights[I->BB] = I->ExtraWeight;
|
||||
}
|
||||
if (FuncInfo.BPI) {
|
||||
for (CaseItr I = CR.Range.first, E = CR.Range.second; I != E; ++I)
|
||||
DestWeights[I->BB] += I->ExtraWeight;
|
||||
}
|
||||
|
||||
// Update successor info. Add one edge to each unique successor.
|
||||
BitVector SuccsHandled(CR.CaseBB->getParent()->getNumBlockIDs());
|
||||
|
|
Loading…
Reference in New Issue