<div dir="ltr">I essentially want a map from functions to their dynamic instruction counts with the ability to update the dynamic count of a function as stuff gets inlined into it. I also want to compute this only when necessary. Implementing this as an analysis pass seems an easy way to provide this, but I see that this may be an overkill especially since inliner is the only consumer of this analysis (for now).</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 15, 2015 at 12:12 AM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Drive by question:<div><br></div><div>Why a pass and not a utility?</div><div><br></div><div>(Admittedly not read the code, just the description)</div><div><br></div><div>Thanks!</div><div><br></div><div>-eric</div></div><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Wed, Oct 14, 2015 at 4:01 PM Easwaran Raman via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">eraman created this revision.<br>
eraman added reviewers: chandlerc, hfinkel.<br>
eraman added a subscriber: llvm-commits.<br>
eraman set the repository for this revision to rL LLVM.<br>
<br>
An analysis pass in the new PM to compute estimated dynamic instruction count of a function based on the static instruction count and block frequency info. The intention is to use this in inline cost analysis to estimate speedup due to inlining (as discussed in the RFC I sent earlier).<br>
<br>
We want the static instruction counts to be closely tied to the cost model used in inline cost analysis. I have moved the CallAnalyzer interface to the header file. When used on out-of-line function, the code in CallAnalyzer that tries to simplify instructions is mostly irrelevant. In most cases, this works fine based on the fact that the initial map of known values is empty. In some cases, I need an explicit flag to distinguish whether I'm using the analyzer during inlining or not.<br>
<br>
Repository:<br>
rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D13755" rel="noreferrer" target="_blank">http://reviews.llvm.org/D13755</a><br>
<br>
Files:<br>
include/llvm/Analysis/BlockFrequencyInfo.h<br>
include/llvm/Analysis/BranchProbabilityInfo.h<br>
include/llvm/Analysis/DynamicInstructionCount.h<br>
include/llvm/Analysis/InlineCost.h<br>
lib/Analysis/BlockFrequencyInfo.cpp<br>
lib/Analysis/BranchProbabilityInfo.cpp<br>
lib/Analysis/CMakeLists.txt<br>
lib/Analysis/DynamicInstructionCount.cpp<br>
lib/Analysis/InlineCost.cpp<br>
lib/Passes/PassBuilder.cpp<br>
lib/Passes/PassRegistry.def<br>
test/Analysis/DynamicInstructionCount/basic.ll<br>
<br></div></div>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div><br></div>