[LLVMdev] Profile Based Branch Weight Metadata

Manman Ren mren at apple.com
Thu Aug 9 10:53:11 PDT 2012


Hi Alastair,

Your patch looks great. I am new on this part of llvm. Why do we want to get rid of ProfileInfo? Is there any email thread related to this?
I understand that we want to setBranchWeightMetadata from the profiling data generated by -insert-edge-profiling.
I thought the existing loader can parse the profiling data and map the data to the IR, and only the setting of metadata is missing.

Thanks,
Manman

On Aug 3, 2012, at 12:28 PM, Alastair Murray wrote:

> Hi all,
> 
> Attached is a draft patch to use profiling data to set branch weight metadata.
> 
> I'm not formally submitting this as a patch yet as it does not make much sense to add it before ProfileInfo etc. is removed.  I am, however, interested in making sure this is the correct approach to be taking, or any other feedback.  (Also, there are a few TODO notes in there which would not be in the actual submission.)
> 
> It works with profiling data produced by -insert-edge-profiling (but not -insert-optimal-edge-profiling).  The loading of the data, the mapping of the data to the IR and the setting of metadata are each handled separately so changes to the profiling insertion code is not an issue. For example: -insert-edge-profiling inserts counters that have no relation to branch probabilities.
> 
> The patch was initially based on the ProfileInfoLoader code, though has been stripped down and rewritten quite significantly.  For review purposes it can be treated as new code.
> 
> The key function is probably setBranchWeightMetadata(...) near the end of the patch.
> 
> Regards,
> Alastair.
> <profile_branch_weight_metadata.patch>_______________________________________________
> 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