<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><hr id="zwchr"><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Robert via llvm-dev Cox" <llvm-dev@lists.llvm.org><br><b>To: </b>llvm-dev@lists.llvm.org<br><b>Sent: </b>Thursday, October 22, 2015 1:25:05 PM<br><b>Subject: </b>[llvm-dev] RFC: Inlining report<br><br>


<style><!--

@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}

p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>

<div class="WordSection1">
<p class="MsoNormal"><b>RFC: Inlining Report </b></p>
<p class="MsoNormal"><b><span style="color: rgb(31, 73, 125);"> </span></b></p>
<p class="MsoNormal"><b>Motivation </b></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="color: black;">Making good inlining choices while optimizing an application is often key to achieving optimal performance.  While the compiler’s default inlining heuristics sometimes provide great out-of-box results, optimal
 performance is sometimes achieved only after varying the settings of certain compiler options related to inlining or adding “always_inline” or “noinline” attributes to certain functions.
</span></p>
<p class="MsoNormal"><span style="color: black;"> </span></p>
<p class="MsoNormal"><span style="color: black;">Before we can determine how we need change the compiler’s inlining choices to get better performance for an application, we need to have a clear picture of the compiler’s inlining choices and what motivated them. 
 Many compilers like LLVM and GCC provide <b>informational notes </b>when a function is inlined, but  these notes provide only a “blow by blow” description of what the compiler did, rather than a high level illustration of the result. This high level picture
 can be provided by an <b>inlining report. </b></span></p>
<p class="MsoNormal"><span style="color: black;"> </span></p>
<p class="MsoNormal"><span id="DWT3129" style="color: black;">Over the years, I’ve worked with several compilers that provide inlining reports, and I can attest that the customers using those compilers have found them to be invaluable tool in investigating and improving their
 applications’ performance.  In addition,  the inlining report can be used by compiler developers to visualize and improve the compiler’s default heuristics and option values.
</span></p></div></blockquote>I agree, these can be extremely useful. Generically speaking, I would very much like to see Clang/LLVM grow the ability to provide optimization reports (including those where source lines are annotated with information on what was vectorized, eliminated, etc.).<br><br>A few comments:<br><br>1. Inlining is iterative. Thus, I assume that your report might include information from multiple inlining passes. Is that correct?<br><br>2. Inlining costs are target specific (because it uses TTI costs), so it would be useful for the report to include the target architecture (as well as information on the LLVM version, name of the input file, etc.)<br><br>3. And this is the big one: Where should the infrastructure for this live?<br><br>One of my goals when defining the 'informational note' infrastructure in LLVM, was to construct it such that the information was not just presentable to humans, but also so that it could be programmatically consumed. This is why we designed it with a class hierarchy: so that the "messages" could be more than just messages. The rationale was that there is information, necessary for presenting useful feedback to humans, that only the frontend has. For C++ codes, for example, you need to do symbol demangling. The frontend is probably the best place to do that. The frontend also knows the proper place to write output files. In addition, specifically for inlining information, the frontend knows where functions are defined without the need for debug information.<br><br>My preference, therefore, is to make sure that the inliner generates sufficiently-detailed messages using a proper class hierarchy and sufficient information. Then, in Clang, we can collect those messages, demangle function names and add source-location information, and produce a report.<br><br>Thoughts?<br><br>Thanks again,<br>Hal<br><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div class="WordSection1"><p class="MsoNormal"><span style="color: black;"></span></p>
<p class="MsoNormal"><span style="color: black;"> </span></p>
<p class="MsoNormal"><span style="color: black;">For these reasons, I’d like to contribute code to LLVM to generate an inlining report as part of the inliner.</span></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><b>Description </b></p>
<p class="MsoNormal"><span style="color: black;"> </span></p>
<p class="MsoNormal"><span style="color: black;">The inlining report I am proposing contains the following information:</span></p>
<p class="MsoNormal"><span style="color: black;"> </span></p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;"><span style="color: black;">(1)</span><span style="font-size: 7pt; font-family: "Times New Roman","serif"; color: black;">   
</span><span style="color: black;">The values of the principle threshold options which affect how much inlining is done under various circumstances</span></p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;"><span style="color: black;">(2)</span><span style="font-size: 7pt; font-family: "Times New Roman","serif"; color: black;">   
</span><span style="color: black;">Whether each function is compiled or has been eliminated by dead static function elimination.</span></p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;"><span style="color: black;">(3)</span><span style="font-size: 7pt; font-family: "Times New Roman","serif"; color: black;">   
</span><span style="color: black;">For each function, the call sites that were and were not inlined.  Since inlining a call site can expose other call sites for inlining, the inlining report also reports on whether these exposed call sites have been inlined or
 not.  This information is presented in hierarchical manner.</span></p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;"><span style="color: black;">(4)</span><span style="font-size: 7pt; font-family: "Times New Roman","serif"; color: black;">   
</span><span style="color: black;">For each call site, we include the principle reason the call site was or was not inlined, together with any cost vs . threshold computation that was done.
</span></p>
<p class="MsoNormal"><span style="color: black;"> </span></p>
<p class="MsoNormal"><b>High Level Design </b></p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal">The inline report is created if the option –inline-report=X is passed on command line with a positive integer value of X.  If X is 0, or this option is not specified, the Inliner does not create or perform any operations on the inline report,
 and there is no compile time overhead. </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Three main classes are used to implement the inline report:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b><i>class InlineReportCallSite </i></b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">This class contains the inlining report information specific to a particular CallSite CS, including:
</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(1)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>A bool indicating whether or not the CallSite was or was not inlined 
</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(2)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>An inlining reason  indicating why the CallSite was or was not inlined 
</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(3)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>The inlining cost, outer inlining cost, and threshold values used in calculating the profitability of inlining
</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(4)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>A vector of InlineReportCallSite*, each of which points to an InlineReportCallSite for a CallSite exposed when CS was inlined.  </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b><i>class InlineReportFunction </i></b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">This class contains the inlining report information specific to a particular Function F in the call graph, including:
</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(1)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>A bool indicating whether the function has been dead static eliminated. 
</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(2)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>A vector of call InlineReportCallSite*, each of which points to an InlineReportCallSite for a CallSite that appeared in F before any inlining was applied.
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b><i>class InlineReport </i></b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The main class which summarizes the high level information in the inline report, including:
</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(1)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>The values of the inlining threshold options</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(2)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>The “level” of the inlining report, which is a bit vector of feature options.  For example, whether to print external functions and intrinsics, whether to print the inlining reasons, etc.
</p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(3)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>A map MF from each Function* to InlineReportFunction* </p>
<p class="MsoListParagraph" style="margin-left: 0.75in; text-indent: -0.25in;">(4)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>A map MCS from each CallSite* to InlineReportCallSite* </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">In addition, the class InlineCost (from InlineCost.h) is augmented to include the primary reason a call site was inlined.  
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The class Inliner has been augmented with an InlineReport, which is created when an Inliner is constructed. The InlineReport is updated using calls to the member functions of these three classes in Inliner::runOnSCC() and the functions
 called by it.  </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Before any inlining is done in a particular call to runOnSCC(), the map MF is updated so that each Function (caller or callee) that will be examined for inlining has a corresponding InlineReportFunction in the map.  (The map MCS is also
 updated in a similar way, but only when a Function is actually inlined.) </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The Inliner determines if a CallSite should be inlined by first calling Inliner::ShouldInline().   This calls getInlineCost() which returns an InlineCost, which now includes the reason the call site should or should not be inlined.  This
 reason, as well and costs and threshold from the InlineCost are stored in the InlineReportCallSite for the CallSite. 
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Then Inliner calls the static function InlineCallPossible(). If the inlining was not performed, the reason for not inlining is recorded in the InlineReportCallSite corresponding to the CallSite.  If the inlining was performed, the corresponding
 InlineReportCallSite is marked as inlined, and it is populated with the InlineReportCallSites corresponding to the newly exposed CallSites that were created during the inlining. 
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The InlineReport is printed during the call to Inliner::doFinalization().
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Since the compiler can run any number of optimizations between two successive calls to runOnSCC(), the Instructions corresponding to CallSites can be deleted by the optimizations.  Callbacks are used to mark the corresponding InlineReportCallSites
 as deleted when this happens. </p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><b><span style="color: black;">Example </span></b></p>
<p class="MsoNormal"><span style="color: black;"> </span></p>
<p class="MsoNormal"><span style="color: black;">Here is an example of abbreviated inlining report that is generated in my locally modified copy of the LLVM sources.  I generated this by compiling the file bzip2.c from the spec 2006 benchmark 401.bzip.  (For
 the sake of brevity, I didn’t include all of the report</span>.  Omitted parts are indicated by …. in the report.)
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>---- Begin Inlining Report ----</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>Option Values:</b></p>
<p class="MsoNormal"><b>  inline-threshold: 225</b></p>
<p class="MsoNormal"><b>  inlinehint-threshold: 325</b></p>
<p class="MsoNormal"><b>  inlinecold-threshold: 225</b></p>
<p class="MsoNormal"><b>  inlineoptsize-threshold: 15</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>COMPILE FUNC: fopen_output_safely</b></p>
<p class="MsoNormal"><b>   -> EXTERN: open</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fdopen</b></p>
<p class="MsoNormal"><b>   -> EXTERN: close</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>DEAD STATIC FUNC: setExit</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>DEAD STATIC FUNC: copyFileName</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>DEAD STATIC FUNC: showFileNames</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>DEAD STATIC FUNC: stat</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>….</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>COMPILE FUNC: cleanUpAndFail</b></p>
<p class="MsoNormal"><b>   -> llvm.lifetime.start</b></p>
<p class="MsoNormal"><b>      [[Callee is intrinsic]]</b></p>
<p class="MsoNormal"><b>   -> INLINE: stat (35<=487)</b></p>
<p class="MsoNormal"><b>      <<Callee is single basic block>></b></p>
<p class="MsoNormal"><b>      -> EXTERN: __xstat</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fclose</b></p>
<p class="MsoNormal"><b>   -> EXTERN: remove</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> INLINE: setExit (15<=225)</b></p>
<p class="MsoNormal"><b>      <<Inlining is profitable>></b></p>
<p class="MsoNormal"><b>   -> EXTERN: exit</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>….</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>COMPILE FUNC: outOfMemory</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> INLINE: showFileNames (70<=225)</b></p>
<p class="MsoNormal"><b>      <<Inlining is profitable>></b></p>
<p class="MsoNormal"><b>      -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> cleanUpAndFail</b></p>
<p class="MsoNormal"><b>      [[Callee is noreturn]]</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>….</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>COMPILE FUNC: snocString</b></p>
<p class="MsoNormal"><b>   -> INLINE: mkCell (-14920<=225)</b></p>
<p class="MsoNormal"><b>      <<Callee has single callsite and local linkage>></b></p>
<p class="MsoNormal"><b>      -> INLINE: myMalloc (70<=225)</b></p>
<p class="MsoNormal"><b>         <<Inlining is profitable>></b></p>
<p class="MsoNormal"><b>         -> EXTERN: malloc</b></p>
<p class="MsoNormal"><b>         -> outOfMemory</b></p>
<p class="MsoNormal"><b>            [[Callee is noreturn]]</b></p>
<p class="MsoNormal"><b>   -> EXTERN: strlen</b></p>
<p class="MsoNormal"><b>   -> INLINE: myMalloc (-14925<=225)</b></p>
<p class="MsoNormal"><b>      <<Callee has single callsite and local linkage>></b></p>
<p class="MsoNormal"><b>      -> EXTERN: malloc</b></p>
<p class="MsoNormal"><b>      -> outOfMemory</b></p>
<p class="MsoNormal"><b>         [[Callee is noreturn]]</b></p>
<p class="MsoNormal"><b>   -> EXTERN: strcpy</b></p>
<p class="MsoNormal"><b>   -> snocString</b></p>
<p class="MsoNormal"><b>      [[Callee is never inline]]</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>…..</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b>---- End Inlining Report ------</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal">Here is an explanation of some of the features:</p>
<p class="MsoNormal"> </p>
<p class="MsoListParagraph" style="text-indent: -0.25in;">(1)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>Option values</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">Option Values:</span></b></p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">  inline-threshold: 225</span></b></p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">  inlinehint-threshold: 325</span></b></p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">  inlinecold-threshold: 225</span></b></p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">  inlineoptsize-threshold: 15</span></b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal">The report begins with a list of the most relevant option values to inlining.
</p>
<p class="MsoNormal"> </p>
<p class="MsoListParagraph" style="text-indent: -0.25in;">(2)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>Compiled and dead functions</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">COMPILE FUNC: fopen_output_safely</span></b></p>
<p class="MsoNormal"><b>   -> EXTERN: open</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fdopen</b></p>
<p class="MsoNormal"><b>   -> EXTERN: close</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">DEAD STATIC FUNC: setExit</span></b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal">Functions in the file are identified as either being compiled or eliminated by dead static function elimination.</p>
<p class="MsoNormal"> </p>
<p class="MsoListParagraph" style="text-indent: -0.25in;">(3)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>External function calls </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>COMPILE FUNC: fopen_output_safely</b></p>
<p class="MsoNormal"><b>   <span style="background: none repeat scroll 0% 0% yellow;">-> EXTERN: open</span></b></p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">   -> EXTERN: fdopen</span></b></p>
<p class="MsoNormal"><b><span style="background: none repeat scroll 0% 0% yellow;">   -> EXTERN: close</span></b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Calls to externally defined functions are indicated by the word EXTERN.  These lines can optionally be omitted.
</p>
<p class="MsoNormal"> </p>
<p class="MsoListParagraph" style="text-indent: -0.25in;">(4)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>Inlining and nesting  </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>COMPILE FUNC: snocString</b></p>
<p class="MsoNormal"><b>   <span style="background: none repeat scroll 0% 0% yellow;">-> INLINE: mkCell (-14920<=225)</span></b></p>
<p class="MsoNormal"><b>      <<Callee has single callsite and local linkage>></b></p>
<p class="MsoNormal"><b>      <span style="background: none repeat scroll 0% 0% yellow;">
-> INLINE: myMalloc (70<=225)</span></b></p>
<p class="MsoNormal"><b>         <<Inlining is profitable>></b></p>
<p class="MsoNormal"><b>         -> EXTERN: malloc</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal">Inlined functions are marked INLINE. The inlining of a function within other inlined functions is shown clearly in the report using indentation.
</p>
<p class="MsoNormal"> </p>
<p class="MsoListParagraph" style="text-indent: -0.25in;">(5)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>Reasons functions were and were not inlined</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>COMPILE FUNC: cleanUpAndFail</b></p>
<p class="MsoNormal"><b>   -> llvm.lifetime.start</b></p>
<p class="MsoNormal"><b>      <span style="background: none repeat scroll 0% 0% yellow;">
[[Callee is intrinsic]]</span></b></p>
<p class="MsoNormal"><b>   -> INLINE: stat <span style="background: none repeat scroll 0% 0% yellow;">
(35<=487)</span></b></p>
<p class="MsoNormal"><b>      <span style="background: none repeat scroll 0% 0% yellow;">
<<Callee is single basic block>></span></b></p>
<p class="MsoNormal"><b>      -> EXTERN: __xstat</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fclose</b></p>
<p class="MsoNormal"><b>   -> EXTERN: remove</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> INLINE: setExit <span style="background: none repeat scroll 0% 0% yellow;">
(15<=225)</span></b></p>
<p class="MsoNormal"><b>      <span style="background: none repeat scroll 0% 0% yellow;">
<<Inlining is profitable>></span></b></p>
<p class="MsoNormal"><b>   -> EXTERN: exit</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal">….</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>COMPILE FUNC: outOfMemory</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> INLINE: showFileNames <span style="background: none repeat scroll 0% 0% yellow;">
(70<=225)</span></b></p>
<p class="MsoNormal"><b>      <span style="background: none repeat scroll 0% 0% yellow;">
<<Inlining is profitable>></span></b></p>
<p class="MsoNormal"><b>      -> EXTERN: fprintf</b></p>
<p class="MsoNormal"><b>   -> cleanUpAndFail</b></p>
<p class="MsoNormal"><b>      <span style="background: none repeat scroll 0% 0% yellow;">
[[Callee is noreturn]]</span></b></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The principal reason a function was or was not inlined can be optionally displayed in the report.  The reason a function was inlined is indicated in double angle brackets << >>.  The reason a function was not inlined is indicated in double
 square brackets [[ ]].   When a comparison of the cost and threshold was used to determine if the function should be inlined, the comparison done is given.   (Since intrinsics are never inlined, information about them can be suppressed in the report.) The
 reasons for or for not inlining can optionally be displayed on the same line as the function considered for inlining for easy analysis using grep, awk, etc.
</p>
<p class="MsoNormal"> </p>
<p class="MsoListParagraph" style="text-indent: -0.25in;">(6)<span style="font-size: 7pt; font-family: "Times New Roman","serif";">   
</span>Line and column info </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>COMPILE FUNC: outOfMemory</b></p>
<p class="MsoNormal"><b>   -> EXTERN: fprintf   <span style="background: none repeat scroll 0% 0% yellow;">bzip2.c(1016,4)</span></b></p>
<p class="MsoNormal"><b>   -> showFileNames   <span style="background: none repeat scroll 0% 0% yellow;">bzip2.c(1019,4)</span> [[Callee is never inline]]</b></p>
<p class="MsoNormal"><b>   -> cleanUpAndFail   <span style="background: none repeat scroll 0% 0% yellow;">bzip2.c(1020,4)</span> [[Callee is never inline]]</b></p>
<p class="MsoNormal"><b> </b></p>
<p class="MsoNormal">Optionally, file, line, and column info can be provided for call sites if source position information is present (using –g or
</p>
<p class="MsoNormal">–gline-tables-only). </p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal">I would appreciate any comments you have on whether you support the inclusion of an inline report in LLVM, the form and features I have outlined above, and your thoughts on the high level design.
</p>
<p class="MsoNormal"><span style="color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal">Thank you in advance for your comments,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Robert Cox</p>
<p class="MsoNormal"><a href="mailto:robert.cox@intel.com" target="_blank"><span style="color: windowtext; text-decoration: none;">robert.cox@intel.com</span></a>
</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
</div>
<br>_______________________________________________<br>LLVM Developers mailing list<br>llvm-dev@lists.llvm.org<br>http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br></blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Assistant Computational Scientist<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>