[CodeGen] Use pred_empty (NFC)

This commit is contained in:
Kazu Hirata 2020-11-22 22:16:12 -08:00
parent df73b8c174
commit 85d6af393c
2 changed files with 4 additions and 4 deletions

View File

@ -559,7 +559,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
for (SmallVectorImpl<BasicBlock*>::iterator
II = Successors.begin(), IE = Successors.end(); II != IE; ++II)
if (pred_begin(*II) == pred_end(*II))
if (pred_empty(*II))
WorkList.insert(*II);
}
@ -573,7 +573,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
for (SmallVectorImpl<BasicBlock*>::iterator
II = Successors.begin(), IE = Successors.end(); II != IE; ++II)
if (pred_begin(*II) == pred_end(*II))
if (pred_empty(*II))
WorkList.insert(*II);
}
@ -2300,7 +2300,7 @@ bool CodeGenPrepare::dupRetToEnableTailCallOpts(BasicBlock *BB, bool &ModifiedDT
}
// If we eliminated all predecessors of the block, delete the block now.
if (Changed && !BB->hasAddressTaken() && pred_begin(BB) == pred_end(BB))
if (Changed && !BB->hasAddressTaken() && pred_empty(BB))
BB->eraseFromParent();
return Changed;

View File

@ -169,7 +169,7 @@ static void eraseDeadBBsAndChildren(const Container &BBs, DomTreeUpdater *DTU) {
SmallVector<BasicBlock *, 8> WL(BBs.begin(), BBs.end());
while (!WL.empty()) {
auto *BB = WL.pop_back_val();
if (pred_begin(BB) != pred_end(BB))
if (!pred_empty(BB))
continue;
WL.append(succ_begin(BB), succ_end(BB));
DeleteDeadBlock(BB, DTU);