diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-01-11 18:55:10 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-01-11 18:55:10 +0000 |
| commit | e736e55d3cc56267f723b22190f7ec2b98dbf9a6 (patch) | |
| tree | b2f10effe861dd143920910901b00b5d0ed12dcd /llvm/lib/Transforms | |
| parent | 669e7054ca20e99eff7d7bd383cde5fde093baac (diff) | |
| download | bcm5719-llvm-e736e55d3cc56267f723b22190f7ec2b98dbf9a6.tar.gz bcm5719-llvm-e736e55d3cc56267f723b22190f7ec2b98dbf9a6.zip | |
replace a loop with a constant time check.
llvm-svn: 45875
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/ArgumentPromotion.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp index 91b3766fa20..071d0e92cbb 100644 --- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp +++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp @@ -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 |

