[LLVMdev] FYI: Planning to remove ProfileInfo and related passes from LLVM

Alastair Murray alastairmurray42 at gmail.com
Sun Jul 15 08:32:04 PDT 2012


Hi Chandler,

I'm a GSoC student working on profiling support (mentor CC'ed).  I'm no 
stranger to the issues with the current system: my original proposal was 
written without knowledge of the limitations.  This is why this list 
hasn't heard much from me yet.

I would like to continue working on profiling support but I'm not 
attached to ProfileInfo and wouldn't be distraught if it gets removed. 
I'd rather work on a useful solution than a dead one and nothing I've 
done so far couldn't be ported to a different interface.  I know some 
people are definitely interested in profiling support.

My reason for doing this GSoC project was to gain experience with LLVM 
and that aim doesn't disappear after one summer's worth of work.  My 
personal plan was to keep on working on profiling support beyond the end 
date, long-term (though not full time).  I do compiler research, but not 
currently with LLVM -- so this is a genuine desire and plan.

Perhaps the best way to proceed is to remove ProfileInfo etc and then I 
can work on re-adding/re-writing it with support for BranchProbability 
and BlockFrequency.  Then I can maintain what I add.  (As an unknown 
figure offering to maintain the existing code seems a bit hollow.)

Naturally, any changes to my GSoC plans need discussion with my mentor.

A few specifics below.

On 15/07/12 20:07, Chandler Carruth wrote:
> Hello folks,
>
> I'd like to remove all of the old and defunct profile info passes from
> LLVM. These have been almost entirely supplanted by the
> BranchProbability and BlockFrequency systems, which are actually on by
> default, and in use in optimization passes.
>
> The old system is not on, and hasn't been touched in years except to do
> minor build fixes and updates.
>
> As far as I'm aware, the only thing the old system supported which the
> new one does not is loading profile data. However, it didn't support
> doing anything useful with that data once loaded,

There is also the llvm-prof tool, but yes: there is only one 
optimization pass that uses profiling data and it is not on by default. 
  The hindrance to using ProfileInfo in other passes is that almost no 
passes preserve it and it can not be recalculated (just estimated by 
ProfileEstimate).

As far as I can tell BranchProbability and BlockFrequency would also be 
invalidated by any CFG altering passes.  Preserving ProfileInfo was my 
primary long-term (post-GSoC) task, preserving BranchProbability and 
BlockFrequency instead should be no harder.


> and has seen
> essentially zero testing on mainline over the past two years, so I think
> its time to let go of this pile of code.

I've written a TEST.profile.Makefile for test-suite to test profiling. 
As long as the instrumentation and loading passes are carefully placed 
the existing profiling support works (i.e. profiling data can be 
generated and then loaded).


> I'm planning to nuke it right away and I can resurrect it if someone
> actually steps forward with a use case (and an offer to maintain and
> support it, preferably integrating it w/ the above two systems).
> -Chandler


Regards,
Alastair.





More information about the llvm-dev mailing list