[PATCH] D21405: [PGO] IRPGO pre-cleanup pass changes

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 21:19:04 PDT 2016


chandlerc added a subscriber: chandlerc.
chandlerc added a comment.

In https://reviews.llvm.org/D21405#459364, @silvas wrote:

> In https://reviews.llvm.org/D21405#459242, @mehdi_amini wrote:
>
> > I really don't like the fact that the PGO pipeline will be different from the non-PGO pipeline (other than what is required for instrumentations). I wonder what other people will think of that.
>
>
> This was one of my initial concerns too: http://lists.llvm.org/pipermail/llvm-dev/2015-August/089058.html
>  Jake and I (actually mostly Jake) did some basic measurements related to this and did not find any significant difference.
>
> Rong also did some measurements related to this in the initial RFC thread: http://lists.llvm.org/pipermail/llvm-dev/2015-August/089425.html
>
> I agree though: generally speaking, we should avoid running too many passes before instrumentation precisely because they cause divergence between the PGO and non-PGO pipelines. Thankfully Jake and I found that on our games only pre-inlining was needed (running other optimizations before instrumentation did not help significantly for our test cases beyond the benefit of just pre-inlining).


I'm glad this is just pre-inlining, I strongly agree that we should not diverge here.

I actually continue to disagree with pre-inlining. I have said this repeatedly in the past, and I'm not sure where we reached consensus that pre-inlining was the right design, and where the discussion of the tradeoffs took place. The closest I could find was the thread you linked to Sean, but I don't actually see a lot of discussion of alternatives there, nor do I see much real discussion of the inliner at all outside of the fact that yes, it does work.

I would be much more in favor of a design which instead of changing the pipeline to optimize differently (and thus having PGO vs. normal divergence) either:

- Teaches the instrumentation pass to do the necessary (possibly interprocedural) analysis to instrument only in places it will be cheap, or
- Teach the existing pipeline to actually optimize and transform the instrumentation code to remove the overhead as necessary.

This way we have a single optimization pipeline that we turn profile info on and off of ,rather than twe pipelines.


Repository:
  rL LLVM

https://reviews.llvm.org/D21405





More information about the llvm-commits mailing list