diff options
author | Gabor Greif <ggreif@gmail.com> | 2010-07-09 14:29:14 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2010-07-09 14:29:14 +0000 |
commit | a29742df5f349771d1a2fa61602f7bad8a7840d3 (patch) | |
tree | 2d2dd98579da39fdbb714e78ee5e1dfeeb89e3b6 /lib/Transforms/Utils/LCSSA.cpp | |
parent | 5891ac8be82b77d1b7059b0a52cbdf6ba6f52eb0 (diff) |
cache result of operator*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r-- | lib/Transforms/Utils/LCSSA.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index df6e603c0b..e90c30bba7 100644 --- a/lib/Transforms/Utils/LCSSA.cpp +++ b/lib/Transforms/Utils/LCSSA.cpp @@ -190,14 +190,15 @@ bool LCSSA::ProcessInstruction(Instruction *Inst, for (Value::use_iterator UI = Inst->use_begin(), E = Inst->use_end(); UI != E; ++UI) { - BasicBlock *UserBB = cast<Instruction>(*UI)->getParent(); - if (PHINode *PN = dyn_cast<PHINode>(*UI)) + User *U = *UI; + BasicBlock *UserBB = cast<Instruction>(U)->getParent(); + if (PHINode *PN = dyn_cast<PHINode>(U)) UserBB = PN->getIncomingBlock(UI); if (InstBB != UserBB && !inLoop(UserBB)) UsesToRewrite.push_back(&UI.getUse()); } - + // If there are no uses outside the loop, exit with no change. if (UsesToRewrite.empty()) return false; |