replace a loop with a constant time check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45875 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-01-11 18:55:10 +00:00
parent 6e8410abf1
commit f1577014dd

View File

@ -125,9 +125,8 @@ bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
// Ensure that this call site is CALLING the function, not passing it as // Ensure that this call site is CALLING the function, not passing it as
// an argument. // an argument.
for (CallSite::arg_iterator AI = CS.arg_begin(), E = CS.arg_end(); if (UI.getOperandNo() != 0)
AI != E; ++AI) return false;
if (*AI == F) return false; // Passing the function address in!
} }
// Check to see which arguments are promotable. If an argument is not // Check to see which arguments are promotable. If an argument is not