comment cleanup, use moveBefore instead of removeFromParent+insertBefore.

llvm-svn: 129319
This commit is contained in:
Chris Lattner 2011-04-11 23:24:57 +00:00
parent 408c228367
commit 7d4cdae564
1 changed files with 5 additions and 9 deletions

View File

@ -1401,10 +1401,9 @@ static bool SimplifyCondBranchToTwoReturns(BranchInst *BI) {
return true; return true;
} }
/// FoldBranchToCommonDest - If this basic block is ONLY a setcc and a branch, /// FoldBranchToCommonDest - If this basic block is simple enough, and if a
/// and if a predecessor branches to us and one of our successors, fold the /// predecessor branches to us and one of our successors, fold the block into
/// setcc into the predecessor and use logical operations to pick the right /// the predecessor and use logical operations to pick the right destination.
/// destination.
bool llvm::FoldBranchToCommonDest(BranchInst *BI) { bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
BasicBlock *BB = BI->getParent(); BasicBlock *BB = BI->getParent();
Instruction *Cond = dyn_cast<Instruction>(BI->getCondition()); Instruction *Cond = dyn_cast<Instruction>(BI->getCondition());
@ -1588,11 +1587,8 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
// Move dbg value intrinsics in PredBlock. // Move dbg value intrinsics in PredBlock.
for (SmallVector<DbgInfoIntrinsic *, 8>::iterator DBI = DbgValues.begin(), for (SmallVector<DbgInfoIntrinsic *, 8>::iterator DBI = DbgValues.begin(),
DBE = DbgValues.end(); DBI != DBE; ++DBI) { DBE = DbgValues.end(); DBI != DBE; ++DBI)
DbgInfoIntrinsic *DB = *DBI; (*DBI)->moveBefore(PBI);
DB->removeFromParent();
DB->insertBefore(PBI);
}
return true; return true;
} }
return false; return false;