diff options
author | Dan Gohman <gohman@apple.com> | 2009-06-26 00:26:03 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-06-26 00:26:03 +0000 |
commit | 30d670f51fb44e3679d5d368f5226ea10267050e (patch) | |
tree | 5dc695557ffdd5413dc59c7ffc5264e8c15f5403 | |
parent | b604b2c470aed22a5c583c05b783e61883433a84 (diff) | |
download | external_llvm-30d670f51fb44e3679d5d368f5226ea10267050e.zip external_llvm-30d670f51fb44e3679d5d368f5226ea10267050e.tar.gz external_llvm-30d670f51fb44e3679d5d368f5226ea10267050e.tar.bz2 |
Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74240 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/LoopRotation.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/LoopRotation.cpp b/lib/Transforms/Scalar/LoopRotation.cpp index ae9ab95..ff40e48 100644 --- a/lib/Transforms/Scalar/LoopRotation.cpp +++ b/lib/Transforms/Scalar/LoopRotation.cpp @@ -371,12 +371,8 @@ bool LoopRotate::rotateLoop(Loop *Lp, LPPassManager &LPM) { /// PHINode may not have an entry for the original pre-header. void LoopRotate::updateExitBlock() { - for (BasicBlock::iterator I = Exit->begin(), E = Exit->end(); - I != E; ++I) { - - PHINode *PN = dyn_cast<PHINode>(I); - if (!PN) - break; + for (BasicBlock::iterator I = Exit->begin(); + PHINode *PN = dyn_cast<PHINode>(I); ++I) { // There is already one incoming value from original pre-header block. if (PN->getBasicBlockIndex(OrigPreHeader) != -1) @@ -384,7 +380,7 @@ void LoopRotate::updateExitBlock() { const RenameData *ILoopHeaderInfo; Value *V = PN->getIncomingValueForBlock(OrigHeader); - if (isa<Instruction>(V) && + if (isa<Instruction>(V) && (ILoopHeaderInfo = findReplacementData(cast<Instruction>(V)))) { assert(ILoopHeaderInfo->PreHeader && "Missing New Preheader Instruction"); PN->addIncoming(ILoopHeaderInfo->PreHeader, OrigPreHeader); |