[PATCH] D15829: [PGO] Clang Option that enables IR level PGO instrumentation

Xinliang David Li via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 28 15:01:27 PST 2016


On Thu, Jan 28, 2016 at 2:34 PM, Rong Xu <xur at google.com> wrote:
> The previous patch was not good as it failed 58 tests that use
> -fprofile-instr-generate as a cc1 option.
>
> I can see two methods to solve this:
> (1) we change all the 58 tests to use -fprofile-instrument=Clang option.

My vote is on (1) -- get rid of -fprofile-instr-generate as cc1 option
as it is now a subset of what -fprofile-instrument=<...> does.

Changing test cases are mechanical.

David

> (2) Fall back to my previous patch: keep -fprofile-instr-generate as
> the CC1 options and check it in Frontend/CompilerInvocation.cpp. (i.e.
> The redundant else branch Sean was referring to).  We have to do it
> here because we cannot assume driver will append
> -fprofile-instrument=Clang in the case the user uses
> -fprofile-instr-generate as the cc1 option.


>
>
>
> On Thu, Jan 28, 2016 at 12:04 PM, Rong Xu <xur at google.com> wrote:
>> xur updated this revision to Diff 46303.
>> xur added a comment.
>>
>> Integrated most recently comments/suggestions from David and Sean.
>>
>> Thanks,
>>
>> -Rong
>>
>>
>> http://reviews.llvm.org/D15829
>>
>> Files:
>>   include/clang/Basic/DiagnosticDriverKinds.td
>>   include/clang/Driver/CC1Options.td
>>   include/clang/Driver/Options.td
>>   include/clang/Frontend/CodeGenOptions.def
>>   include/clang/Frontend/CodeGenOptions.h
>>   lib/CodeGen/BackendUtil.cpp
>>   lib/CodeGen/CGStmt.cpp
>>   lib/CodeGen/CodeGenFunction.cpp
>>   lib/CodeGen/CodeGenFunction.h
>>   lib/CodeGen/CodeGenModule.cpp
>>   lib/CodeGen/CodeGenPGO.cpp
>>   lib/Driver/Tools.cpp
>>   lib/Frontend/CompilerInvocation.cpp
>>   test/CodeGen/Inputs/pgotest.profraw
>>   test/CodeGen/pgo-instrumentation.c
>>


More information about the cfe-commits mailing list