[llvm-commits] [llvm] r108143 - /llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp

Gabor Greif ggreif at gmail.com
Mon Jul 12 07:12:11 PDT 2010


Author: ggreif
Date: Mon Jul 12 09:12:11 2010
New Revision: 108143

URL: http://llvm.org/viewvc/llvm-project?rev=108143&view=rev
Log:
cache results of operator*

Modified:
    llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp

Modified: llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp?rev=108143&r1=108142&r2=108143&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LowerSetJmp.cpp Mon Jul 12 09:12:11 2010
@@ -406,12 +406,14 @@
     // 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





More information about the llvm-commits mailing list