[LLVMdev] Static Profiling Algorithms in LLVM

Andrei Alvares logytech at gmail.com
Tue Nov 2 09:43:59 PDT 2010


Hello Kapil,

  I have implemented a static profiler for LLVM as a google summer of
code project in 2009. I wrote it for the 2.4 branch, but the
implementation never made into the tree. I have recently ported it to
LLVM 2.8, but I haven't tested it. You can take a look at the code
from: http://homepages.dcc.ufmg.br/~rimsa/tools/stprof-llvm.patch

  The implementation is based on Wu's [1994] paper and provides a
branch predictor that calculates probabilities. The implementation
also covers an intraprocedural and interprocedural frequency
calculator for edges and functions.

  Reference:
Youfeng Wu and James R. Larus. Static branch frequency and program
profile analysis. In MICRO 27: Proceedings of the 27th annual
international symposium on Microarchitecture. IEEE, 1994.

  Regards,
    Andrei

On Tue, Nov 2, 2010 at 10:46 AM, Andrew Lenharth <andrewl at lenharth.org> wrote:
> On Tue, Nov 2, 2010 at 12:28 AM, kapil anand <kapilanand2 at gmail.com> wrote:
>> Hi all,
>>
>> Does LLVM infrastructure contain implementation of any static profiling
>> algorithm apart from "Spill-Weight" calculation present in Live Intervals
>> class? The future work page does suggest implementation of some "static
>> profiling" algorithms to make an educated guesses about the relative
>> execution frequencies of various parts of the code.
>
> If you look at old releases, there was a profiling library and
> transforms, including infrastructure to do any of the profiling with
> random sampling.  Those were unmaintained and removed not that long
> ago.  What you could profile was somewhat limited.
>
> Andrew
>
>
>> Thanks
>>
>> --Kapil
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list