replace a loop with a constant time check.

llvm-svn: 45875
This commit is contained in:
Chris Lattner 2008-01-11 18:55:10 +00:00
parent 669e7054ca
commit e736e55d3c
1 changed files with 2 additions and 3 deletions

View File

@ -125,9 +125,8 @@ bool ArgPromotion::PromoteArguments(CallGraphNode *CGN) {
// 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