Add GCC-compatible flags -fprofile-generate and -fprofile-use

Diego Novillo dnovillo at google.com
Wed Jul 8 15:46:11 PDT 2015


On Tue, Jul 7, 2015 at 1:32 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Tue, Jul 7, 2015 at 11:35 AM, Diego Novillo <dnovillo at google.com> wrote:
>>
>> ping?
>
> +  Without any other arguments, ``-fprofile-generate`` behaves identically
> to
> +  ``-fprofile-instr-generate``. When given a directory name, it generates
> the
> +  profile file ``default.profraw`` in the directory named ``dirname``. If
> +  ``dirname`` does not exist, it will be created. The environment variable
>
> Maybe "it will be created at runtime." to clarify that we won't create a
> directory as a side-effect of the compile.

Done.

> Is it possible to transform -fprofile-instr-generate into
> -fprofile-instr-generate=default.profraw and remove frontend support for the
> non-= form? (If so, I'm happy with that being a follow-up patch.)

It is, but it requires checking the name of the given file. If the
name is blank or the same as the default name, we need to refrain from
emitting an additional function call in the generated code.  Justin
was not too keen on doing that check and I haven't really come up with
a better alternative.

>
> I think it'd be slightly better for -fprofile-generate= to override
> -fprofile-instr-generate= and vice versa (last on the command line wins)
> rather than making them conflict.

Sure. I'll change that.

Diego.



More information about the cfe-commits mailing list