[llvm-commits] [llvm] r45875 - /llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp

Chris Lattner sabre at nondot.org
Fri Jan 11 10:55:10 PST 2008


Author: lattner
Date: Fri Jan 11 12:55:10 2008
New Revision: 45875

URL: http://llvm.org/viewvc/llvm-project?rev=45875&view=rev
Log:
replace a loop with a constant time check.

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

Modified: llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp?rev=45875&r1=45874&r2=45875&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/ArgumentPromotion.cpp Fri Jan 11 12:55:10 2008
@@ -125,9 +125,8 @@
 
     // Ensure that this call site is CALLING the function, not passing it as
     // an argument.
-    for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end();
-         AI != E; ++AI)
-      if (*AI == F) return false;   // Passing the function address in!
+    if (UI.getOperandNo() != 0) 
+      return false;
   }
 
   // Check to see which arguments are promotable.  If an argument is not





More information about the llvm-commits mailing list