cache result of operator*
authorGabor Greif <ggreif@gmail.com>
Fri, 9 Jul 2010 14:29:14 +0000 (14:29 +0000)
committerGabor Greif <ggreif@gmail.com>
Fri, 9 Jul 2010 14:29:14 +0000 (14:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107968 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/LCSSA.cpp

index df6e603c0ba271b02f85daedcd3f14ebe7d4969b..e90c30bba78e28072738fb767e0acca6ca4810ef 100644 (file)
@@ -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;