diff options
author | Chris Lattner <sabre@nondot.org> | 2010-12-14 07:23:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-12-14 07:23:10 +0000 |
commit | 9fd838d31b44108b99327ebc927ed8bed70634f9 (patch) | |
tree | daf7ce3c0e2ef7f283299714a9d79a620c6fef7a /llvm/lib/Transforms/Utils | |
parent | b42d293faa46c80a64dbee5e4ee4a7859f1629f7 (diff) | |
download | bcm5719-llvm-9fd838d31b44108b99327ebc927ed8bed70634f9.tar.gz bcm5719-llvm-9fd838d31b44108b99327ebc927ed8bed70634f9.zip |
tidy up a bit, move DEBUG down to when we commit to doing the transform so we
don't print it unless the xform happens.
llvm-svn: 121758
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 11148b5101c..5f7eb9e3801 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1161,9 +1161,6 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) { if (NumPhis > 2) return false; - DEBUG(dbgs() << "FOUND IF CONDITION! " << *IfCond << " T: " - << IfTrue->getName() << " F: " << IfFalse->getName() << "\n"); - // Loop over the PHI's seeing if we can promote them all to select // instructions. While we are at it, keep track of the instructions // that need to be moved to the dominating block. @@ -1192,8 +1189,7 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) { if (cast<BranchInst>(Pred->getTerminator())->isUnconditional()) { IfBlock1 = Pred; DomBlock = *pred_begin(Pred); - for (BasicBlock::iterator I = Pred->begin(); - !isa<TerminatorInst>(I); ++I) + for (BasicBlock::iterator I = Pred->begin(); !isa<TerminatorInst>(I); ++I) if (!AggressiveInsts.count(I) && !isa<DbgInfoIntrinsic>(I)) { // This is not an aggressive instruction that we can promote. // Because of this, we won't be able to get rid of the control @@ -1206,8 +1202,7 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) { if (cast<BranchInst>(Pred->getTerminator())->isUnconditional()) { IfBlock2 = Pred; DomBlock = *pred_begin(Pred); - for (BasicBlock::iterator I = Pred->begin(); - !isa<TerminatorInst>(I); ++I) + for (BasicBlock::iterator I = Pred->begin(); !isa<TerminatorInst>(I); ++I) if (!AggressiveInsts.count(I) && !isa<DbgInfoIntrinsic>(I)) { // This is not an aggressive instruction that we can promote. // Because of this, we won't be able to get rid of the control @@ -1215,6 +1210,9 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetData *TD) { return false; } } + + DEBUG(dbgs() << "FOUND IF CONDITION! " << *IfCond << " T: " + << IfTrue->getName() << " F: " << IfFalse->getName() << "\n"); // If we can still promote the PHI nodes after this gauntlet of tests, // do all of the PHI's now. |