From a29742df5f349771d1a2fa61602f7bad8a7840d3 Mon Sep 17 00:00:00 2001 From: Gabor Greif Date: Fri, 9 Jul 2010 14:29:14 +0000 Subject: [PATCH] cache result of operator* git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107968 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LCSSA.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Transforms/Utils/LCSSA.cpp b/lib/Transforms/Utils/LCSSA.cpp index df6e603c0ba..e90c30bba78 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(*UI)->getParent(); - if (PHINode *PN = dyn_cast(*UI)) + User *U = *UI; + BasicBlock *UserBB = cast(U)->getParent(); + if (PHINode *PN = dyn_cast(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;