[llvm-commits] [llvm] r129319 - /llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Chris Lattner
sabre at nondot.org
Mon Apr 11 16:24:57 PDT 2011
Author: lattner
Date: Mon Apr 11 18:24:57 2011
New Revision: 129319
URL: http://llvm.org/viewvc/llvm-project?rev=129319&view=rev
Log:
comment cleanup, use moveBefore instead of removeFromParent+insertBefore.
Modified:
llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp?rev=129319&r1=129318&r2=129319&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SimplifyCFG.cpp Mon Apr 11 18:24:57 2011
@@ -1401,10 +1401,9 @@
return true;
}
-/// FoldBranchToCommonDest - If this basic block is ONLY a setcc and a branch,
-/// and if a predecessor branches to us and one of our successors, fold the
-/// setcc into the predecessor and use logical operations to pick the right
-/// destination.
+/// FoldBranchToCommonDest - If this basic block is simple enough, and if a
+/// predecessor branches to us and one of our successors, fold the block into
+/// the predecessor and use logical operations to pick the right destination.
bool llvm::FoldBranchToCommonDest(BranchInst *BI) {
BasicBlock *BB = BI->getParent();
Instruction *Cond = dyn_cast<Instruction>(BI->getCondition());
@@ -1588,11 +1587,8 @@
// Move dbg value intrinsics in PredBlock.
for (SmallVector<DbgInfoIntrinsic *, 8>::iterator DBI = DbgValues.begin(),
- DBE = DbgValues.end(); DBI != DBE; ++DBI) {
- DbgInfoIntrinsic *DB = *DBI;
- DB->removeFromParent();
- DB->insertBefore(PBI);
- }
+ DBE = DbgValues.end(); DBI != DBE; ++DBI)
+ (*DBI)->moveBefore(PBI);
return true;
}
return false;
More information about the llvm-commits
mailing list