From a0c54f3adad934ecc668ddc52ec785804da63b1f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 5 May 2007 18:36:36 +0000 Subject: [PATCH] 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 --- lib/Transforms/Scalar/LoopUnroll.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp index e4be2d249aa..bdf8f4d9b7c 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::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(InVal)) InVal = LastValueMap[InVal]; - (*SI)->removeIncomingValue(LatchBlock, false); + PN->removeIncomingValue(LatchBlock, false); if (InVal) - (*SI)->addIncoming(InVal, cast(LastValueMap[LatchBlock])); - if ((*SI)->getNumIncomingValues() == 0) { + PN->addIncoming(InVal, cast(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(); } } } -- 2.34.1