Add -fauto-profile option to Clang driver

Chandler Carruth chandlerc at google.com
Tue Oct 22 15:25:08 PDT 2013


On Tue, Oct 22, 2013 at 2:53 PM, Kaelyn Uhrain <rikka at google.com> wrote:

> My $0.02 having just read the recent discussion: particularly if/when
> -fprofile-use=filename is smart enough to detect the type of profile,
> instead of having -f*-profile options like -fsample-profile, perhaps
> -fprofile-type=<kind> (e.g. -fprofile-type=sample, -fprofile-type=gcc,
> etc--or -fprofile-kind=<kind> instead of -fprofile-type) where the type
> defaults to GCC style... or later to whatever -fprofile-use= guesses the
> file's format to be. It also gives pretty good symmetry to
> -fprofile-generate= and -fprofile-use=


Well, note that it is unlikely we'll ever default to the GCC style as that
would imply reading GCC's profiles...

I'm not completely opposed to this, but I'll point out two reasons why I'm
not completely happy about this:

- I would personally prefer the intent to be explicit. The more I think
about it the less I like one flag activating N different kinds of PGO based
on the file type. It makes it too easy to typo a filename and get different
(unexpected) behavior.

- I dislike having flag A which changes flag B's behavior where possible to
avoid. It makes it much harder to manipulate things through append-based
build systems' flag management.

But I wouldn't hold it up if this is the approach favored by the rest of
folks discussing this. Just my 2 cents.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131022/74ce771a/attachment.html>


More information about the cfe-commits mailing list