[PATCH] D13755: Pass to compute dynamic instruction count

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 20:49:58 PDT 2015


*nod* It might make sense to see what it'll look like or how long it takes
to just have it as a utility and recompute. If it's fast enough it might
not be worth dealing with the pass manager and invalidation. I'll let
Chandler speak to that ultimately though. Was just curious :)

-eric

On Thu, Oct 15, 2015 at 11:33 AM Easwaran Raman <eraman at google.com> wrote:

> 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).
>
> On Thu, Oct 15, 2015 at 12:12 AM, Eric Christopher <echristo at gmail.com>
> wrote:
>
>> Drive by question:
>>
>> Why a pass and not a utility?
>>
>> (Admittedly not read the code, just the description)
>>
>> Thanks!
>>
>> -eric
>>
>> On Wed, Oct 14, 2015 at 4:01 PM Easwaran Raman via llvm-commits <
>> llvm-commits at lists.llvm.org> wrote:
>>
>>> eraman created this revision.
>>> eraman added reviewers: chandlerc, hfinkel.
>>> eraman added a subscriber: llvm-commits.
>>> eraman set the repository for this revision to rL LLVM.
>>>
>>> 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).
>>>
>>> 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.
>>>
>>> Repository:
>>>   rL LLVM
>>>
>>> http://reviews.llvm.org/D13755
>>>
>>> Files:
>>>   include/llvm/Analysis/BlockFrequencyInfo.h
>>>   include/llvm/Analysis/BranchProbabilityInfo.h
>>>   include/llvm/Analysis/DynamicInstructionCount.h
>>>   include/llvm/Analysis/InlineCost.h
>>>   lib/Analysis/BlockFrequencyInfo.cpp
>>>   lib/Analysis/BranchProbabilityInfo.cpp
>>>   lib/Analysis/CMakeLists.txt
>>>   lib/Analysis/DynamicInstructionCount.cpp
>>>   lib/Analysis/InlineCost.cpp
>>>   lib/Passes/PassBuilder.cpp
>>>   lib/Passes/PassRegistry.def
>>>   test/Analysis/DynamicInstructionCount/basic.ll
>>>
>>> _______________________________________________
>>> llvm-commits mailing list
>>> llvm-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151016/40710f02/attachment.html>


More information about the llvm-commits mailing list