diff options
author | Chris Lattner <sabre@nondot.org> | 2007-05-05 18:36:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-05-05 18:36:36 +0000 |
commit | a0c54f3adad934ecc668ddc52ec785804da63b1f (patch) | |
tree | bb9b0077a4474eaf49f77c235640a5aa26972ac7 /lib/Transforms/Scalar/LoopUnroll.cpp | |
parent | 01dfdcd84b604063d739b92ee12c119cc18d799f (diff) | |
download | external_llvm-a0c54f3adad934ecc668ddc52ec785804da63b1f.zip external_llvm-a0c54f3adad934ecc668ddc52ec785804da63b1f.tar.gz external_llvm-a0c54f3adad934ecc668ddc52ec785804da63b1f.tar.bz2 |
make a temporary for *SI, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36782 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnroll.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopUnroll.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp index e4be2d2..bdf8f4d 100644 --- a/lib/Transforms/Scalar/LoopUnroll.cpp +++ b/lib/Transforms/Scalar/LoopUnroll.cpp @@ -302,17 +302,18 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) { for (SmallPtrSet<PHINode*,8>::iterator SI = Users.begin(), SE = Users.end(); SI != SE; ++SI) { - Value* InVal = (*SI)->getIncomingValueForBlock(LatchBlock); + PHINode *PN = *SI; + Value* InVal = PN->getIncomingValueForBlock(LatchBlock); if (isa<Instruction>(InVal)) InVal = LastValueMap[InVal]; - (*SI)->removeIncomingValue(LatchBlock, false); + PN->removeIncomingValue(LatchBlock, false); if (InVal) - (*SI)->addIncoming(InVal, cast<BasicBlock>(LastValueMap[LatchBlock])); - if ((*SI)->getNumIncomingValues() == 0) { + PN->addIncoming(InVal, cast<BasicBlock>(LastValueMap[LatchBlock])); + if (PN->getNumIncomingValues() == 0) { // Remove this phi node. // If anyone is using this PHI, make them use a dummy value instead... - (*SI)->replaceAllUsesWith(UndefValue::get((*SI)->getType())); - (*SI)->eraseFromParent(); + PN->replaceAllUsesWith(UndefValue::get(PN->getType())); + PN->eraseFromParent(); } } } |