<div dir="ltr"><div class="gmail_extra">One aspect of this that I have not seen discussed is that middle-end instrumentation enables PGO optimizations to front-ends other than Clang.</div><div class="gmail_extra"><br></div><div class="gmail_extra">While I agree that FE instrumentation could be improved, it still requires every FE to implement essentially the same common functionality.  Having PGO instrumentation generated in the middle-end, allows us every FE to automatically take advantage of PGO.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Additionally, some of the overhead imposed by FE instrumentation is not really all that easy to get rid of.  You end up duplicating functionality that is more naturally implemented in the middle end.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I see the two approaches as supplementary, rather than complementary.  One does not negate the other.  Some of the optimizations we'd do in the FE, may hurt coverage.  Instead, by instrumenting in the middle end, you can focus exclusively on performance (coverage be damned).</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Diego.</div></div>