[LLVMdev] RFC - Profile Guided Optimization in LLVM

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Jun 12 15:10:21 PDT 2013


On Jun 12, 2013, at 3:05 PM, Chandler Carruth <chandlerc at google.com> wrote:

> 
> On Wed, Jun 12, 2013 at 2:55 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
> That sounds plausible to me. It seems like we might need a way of representing call graph profiling in addition to the existing branch probabilities?
> 
> Agreed. An important consideration here is WPO vs. LTO vs. TU-at-a-time call graphs.
>  
> FWIW, the greedy register allocator’s live range splitting algorithm is designed to consume profile information so it can push spill code into cold blocks. The primary interface is SpillPlacement::getBlockFrequency() which currently returns an estimate based on loop depth only.
> 
> It doesn't use MachineBlockFrequency? If it does, it will get a lot more than loop depth: __builtin_expect, cold function attribute, and static branch heuristics. If it doesn't it should, and then it will immediately benefit from this.

It predates the block frequency interface. It just needs to be hooked up, patches welcome. It would also be nice to remove the floating point computations from the spill placement code.

Thanks,
/jakob





More information about the llvm-dev mailing list