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

Alastair Murray alastairmurray42 at gmail.com
Mon Jul 16 06:25:45 PDT 2012


On 16/07/12 07:33, Chandler Carruth wrote:
> Can you start a thread with what your specific goals are?

This is to follow.


> I'd like to hear an explicit OK from you and your mentor before I remove
> anything, as I don't want to get in the way of any immediate progress or
> work you're doing as part of GSoC.

This is an explicit OK for you to remove ProfileInfo and related code. 
My mentor and I agree that it is better to work on code that will be 
sticking around.

The existing EdgeProfiling.cpp and the runtime code may be worth saving 
(these require ProfilingUtils.* and ProfileInfoTypes.h respectively).

Without a profile loader they aren't useful (even llvm-prof is based on 
ProfileInfoLoader), but as they count edge frequency it intuitively 
seems like the profiling data they generate could be used by a rewritten 
BranchProbability profile loader.

One note, if I plan on submitting patches to restore rewritten parts is 
destroying `svn blame` history a problem?


> The missing pieces are:
> 1) Ensuring that passes such as SimplifyCFG preserve as much branch
> weight metadata as possible. This is already an issue for metadata that
> comes from __builtin_expect() source code annotations, so it is
> something you can write tests for today and observe problems.
> 2) A pass to load profile data and attach metadata to branch
> instructions based on it.
> 3) Ensuring that #2 works with the profiles produced by an instrumented
> binary.
>
> It's important to note that #2 is easy. It's #1 and #3 that are really
> hard. When I have talked to others about #3, there has been the feeling
> that we would probably want to write a custom instrumentation pass that
> would add instrumentation to the right LLVM IR formations, in order to
> make sure that when it is read back in, the profile data matches up with
> the IR correctly, and is available early enough in the optimization
> passes to be used.

I understand that #1 is hard, but #3 isn't so clear to me.  The current 
ProfileInfo based -insert-edge-profiling and -profile-loader passes can 
already do this.  The instrumentation and loading passes have to occur 
at exactly the same point of their respective pass pipelines, but that 
is unavoidable.


Regards,
Alastair.



More information about the llvm-dev mailing list