Add -fauto-profile option to Clang driver

Justin Bogner mail at
Mon Oct 28 11:13:56 PDT 2013

Bob Wilson <bob.wilson at> writes:
> On Oct 28, 2013, at 7:23 AM, Diego Novillo <dnovillo at> wrote:
>> Ping?  Bob, Chandler, does this sound reasonable to you?  I'm thinking
>> of changing the current patch to use -fprofile-sample-use=...
>> This partially keeps the symmetry with -fprofile-generate /
>> -fprofile-use and avoids the autodetection logic that Chandler
>> dislikes.
> I don't have a strong opinion on this.  Justin, how does this line up
> with what you were considering for our profiling options?

Using -fprofile-sample-use= seems simplest for now. We'll probably need
to figure out exactly what to do with -fprofile-use= and
-fprofile-generate= in the near future, as the current state is actually
fairly strange:

- profile-use and profile-use= are ignored
- profile-generate= isn't accepted
- profile-generate causes libprofile_rt to be linked in, but does 
  nothing else

In GCC, -fprofile-generate implies -fprofile-arcs, which we currently
use to turn on the GCOVProfilerPass, and the =path versions of these
options take a directory, whereas both Diego's and Bob's profiling
approaches deal with a file.

More information about the cfe-commits mailing list