diff options
author | Owen Anderson <resistor@mac.com> | 2010-09-09 20:32:23 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-09-09 20:32:23 +0000 |
commit | f9a26b89f8815651048ed5518d99b484ac7c2ba0 (patch) | |
tree | 796d42a0dd32f512e44d2c5ea66174a3a5df7ff5 /include/llvm/Analysis/CodeMetrics.h | |
parent | ce07b5458d87d5f5ad306a1d86785537e9a3ce0c (diff) |
What the loop unroller cares about, rather than just not unrolling loops with calls, is
not unrolling loops that contain calls that would be better off getting inlined. This mostly
comes up when an interleaved devirtualization pass has devirtualized a call which the inliner
will inline on a future pass. Thus, rather than blocking all loops containing calls, add
a metric for "inline candidate calls" and block loops containing those instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113535 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/CodeMetrics.h')
-rw-r--r-- | include/llvm/Analysis/CodeMetrics.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/llvm/Analysis/CodeMetrics.h b/include/llvm/Analysis/CodeMetrics.h index 6ae68f36d7..1a67409ad1 100644 --- a/include/llvm/Analysis/CodeMetrics.h +++ b/include/llvm/Analysis/CodeMetrics.h @@ -45,6 +45,11 @@ namespace llvm { /// NumCalls - Keep track of the number of calls to 'big' functions. unsigned NumCalls; + + /// NumInlineCandidates - Keep track of the number of calls to internal + /// functions with only a single caller. These are likely targets for + /// future inlining, likely exposed by interleaved devirtualization. + unsigned NumInlineCandidates; /// NumVectorInsts - Keep track of how many instructions produce vector /// values. The inliner is being more aggressive with inlining vector @@ -56,7 +61,8 @@ namespace llvm { CodeMetrics() : callsSetJmp(false), isRecursive(false), containsIndirectBr(false), usesDynamicAlloca(false), - NumInsts(0), NumBlocks(0), NumCalls(0), NumVectorInsts(0), + NumInsts(0), NumBlocks(0), NumCalls(0), + NumInlineCandidates(0), NumVectorInsts(0), NumRets(0) {} /// analyzeBasicBlock - Add information about the specified basic block |