[llvm-commits] [llvm] r108134 - /llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp

Gabor Greif ggreif at gmail.com
Mon Jul 12 04:19:24 PDT 2010


Author: ggreif
Date: Mon Jul 12 06:19:24 2010
New Revision: 108134

URL: http://llvm.org/viewvc/llvm-project?rev=108134&view=rev
Log:
cache dereferenced iterators

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

Modified: llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp?rev=108134&r1=108133&r2=108134&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/StructRetPromotion.cpp Mon Jul 12 06:19:24 2010
@@ -171,16 +171,16 @@
     // Check FirstArg's users.
     for (Value::use_iterator ArgI = FirstArg->use_begin(), 
            ArgE = FirstArg->use_end(); ArgI != ArgE; ++ArgI) {
-
+      User *U = *ArgI;
       // If FirstArg user is a CallInst that does not correspond to current
       // call site then this function F is not suitable for sret promotion.
-      if (CallInst *CI = dyn_cast<CallInst>(ArgI)) {
+      if (CallInst *CI = dyn_cast<CallInst>(U)) {
         if (CI != Call)
           return false;
       }
       // If FirstArg user is a GEP whose all users are not LoadInst then
       // this function F is not suitable for sret promotion.
-      else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(ArgI)) {
+      else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(U)) {
         // TODO : Use dom info and insert PHINodes to collect get results
         // from multiple call sites for this GEP.
         if (GEP->getParent() != Call->getParent())





More information about the llvm-commits mailing list