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

lib/Transforms/IPO/LowerSetJmp.cpp

index 53128366af6057c24dbaa55af0e3e06b3476e0fd..76cfef8335c989e62ffadee825d2eac0e8c89b23 100644 (file)
@@ -406,12 +406,14 @@ void LowerSetJmp::TransformSetJmpCall(CallInst* Inst)
     // Loop over all of the uses of instruction.  If any of them are after the
     // call, "spill" the value to the stack.
     for (Value::use_iterator UI = II->use_begin(), E = II->use_end();
-         UI != E; ++UI)
-      if (cast<Instruction>(*UI)->getParent() != ABlock ||
-          InstrsAfterCall.count(cast<Instruction>(*UI))) {
+         UI != E; ++UI) {
+      User *U = *UI;
+      if (cast<Instruction>(U)->getParent() != ABlock ||
+          InstrsAfterCall.count(cast<Instruction>(U))) {
         DemoteRegToStack(*II);
         break;
       }
+    }
   InstrsAfterCall.clear();
 
   // Change the setjmp call into a branch statement. We'll remove the