[llvm-dev] AutoFDO sample profiles v. SelectInst,

Sanjay Patel via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 17 10:06:27 PDT 2016


On Wed, Aug 17, 2016 at 10:12 AM, Xinliang David Li <xinliangli at gmail.com>
wrote:

>
>
> On Wed, Aug 17, 2016 at 8:19 AM, Sanjay Patel <spatel at rotateright.com>
> wrote:
>
>>
>> On Fri, Aug 12, 2016 at 12:15 PM, Xinliang David Li via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>
>>> +dehao.
>>>
>>> There are two potential problems:
>>>
>>> 1) the branch gets eliminated in the binary that is being profiled, so
>>> there is no profile data
>>>
>>
>> This seems like a fundamental problem for PGO. Maybe it is also
>> responsible for this bug: https://llvm.org/bugs/show_bug.cgi?id=27359 ?
>>
>> Should we limit select optimizations in IR for a PGO-training build? Or
>> should there be a 'select smasher' pass later in the pipeline that turns
>> selects into branches for a PGO-training build? (I don't have a good
>> understanding of PGO, so I'm just throwing out ideas...maybe a better
>> question is: how do other compilers handle this?)
>>
>>
> For instrumentation based PGO (IR-based), this is a known problem. I have
> a solution for it and will send out patches soon. Before that, there will
> be more changes in LLVM to make sure profile data associated with
> selectInst is well preserved.
>

Sounds great. Let me know if I can help without getting in your way. If
there's more like https://reviews.llvm.org/D23590 , I can try to fix them
up in parallel.

On a related note, I want to ask about profile-guided inlining. It does not
seem to exist after https://reviews.llvm.org/D16381 was reverted. Is there
a plan to bring it back independently of the new pass manager?

Profile-guided inlining was the original motivation for the test case in
https://llvm.org/bugs/show_bug.cgi?id=28964 . But I think we'll miss this
case if we fix SimplifyCFG to produce a 'select' before fixing IR-based PGO
(and making inlining work again)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160817/40d29e17/attachment-0001.html>


More information about the llvm-dev mailing list