diff options
author | Chris Lattner <sabre@nondot.org> | 2009-10-10 06:22:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-10-10 06:22:45 +0000 |
commit | 2d7f1d24bf32418de4ff817284eb5222726c2c62 (patch) | |
tree | 2a64ffd684c815d3edb2862b945aad3a4110f61f /lib/Transforms/Utils/LCSSA.cpp | |
parent | bcea859fc1dd1af9ac66ec93ea04ce9a19c8451c (diff) |
random tidying
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r-- | lib/Transforms/Utils/LCSSA.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index 48e6a17a06..af54add385 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -197,9 +197,8 @@ void LCSSA::ProcessInstruction(Instruction *Instr, for (Value::use_iterator UI = Instr->use_begin(), E = Instr->use_end(); UI != E;) { BasicBlock *UserBB = cast<Instruction>(*UI)->getParent(); - if (PHINode *P = dyn_cast<PHINode>(*UI)) { + if (PHINode *P = dyn_cast<PHINode>(*UI)) UserBB = P->getIncomingBlock(UI); - } // If the user is in the loop, don't rewrite it! if (UserBB == Instr->getParent() || inLoop(UserBB)) { @@ -231,12 +230,11 @@ void LCSSA::getLoopValuesUsedOutsideLoop(Loop *L, for (Loop::block_iterator BB = L->block_begin(), BE = L->block_end(); BB != BE; ++BB) { for (BasicBlock::iterator I = (*BB)->begin(), E = (*BB)->end(); I != E; ++I) - for (Value::use_iterator UI = I->use_begin(), UE = I->use_end(); UI != UE; - ++UI) { + for (Value::use_iterator UI = I->use_begin(), UE = I->use_end(); + UI != UE; ++UI) { BasicBlock *UserBB = cast<Instruction>(*UI)->getParent(); - if (PHINode* p = dyn_cast<PHINode>(*UI)) { + if (PHINode *p = dyn_cast<PHINode>(*UI)) UserBB = p->getIncomingBlock(UI); - } if (*BB != UserBB && !inLoop(UserBB)) { AffectedValues.insert(I); @@ -288,7 +286,7 @@ Value *LCSSA::GetValueForBlock(DomTreeNode *BB, Instruction *OrigInst, Phis.insert(std::make_pair(BB, PN)); // Fill in the incoming values for the block. - for (BasicBlock** PI = PredCache.GetPreds(BBN); *PI; ++PI) + for (BasicBlock **PI = PredCache.GetPreds(BBN); *PI; ++PI) PN->addIncoming(GetValueForBlock(DT->getNode(*PI), OrigInst, Phis), *PI); return PN; } |