[PGO] Change profile use cc1 option to handle IR level profiles
authorRong Xu <xur@google.com>
Wed, 2 Mar 2016 20:59:36 +0000 (20:59 +0000)
committerRong Xu <xur@google.com>
Wed, 2 Mar 2016 20:59:36 +0000 (20:59 +0000)
commit9c6f1538cc0f70fe43d47cf818ad797c82b61d5f
treeb86604baa3284b38067401726b173344be8ceb75
parent783fb1f6426f32e5bb7731d57cd517a90fa7bccd
[PGO] Change profile use cc1 option to handle IR level profiles

This patch changes cc1 option for PGO profile use from
-fprofile-instr-use=<path> to -fprofile-instrument-use-path=<path>.
-fprofile-instr-use=<path> is now a driver only option.

In addition to decouple the cc1 option from the driver level option, this patch
also enables IR level profile use. cc1 option handling now reads the profile
header and sets CodeGenOpt ProfileUse (valid values are {None, Clang, LLVM}
-- this is a common enum for -fprofile-instrument={}, for the profile
instrumentation), and invoke the pipeline to enable the respective PGO use pass.

Reviewers: silvas, davidxl

Differential Revision: http://reviews.llvm.org/D17737

llvm-svn: 262515
24 files changed:
clang/include/clang/Driver/CC1Options.td
clang/include/clang/Driver/Options.td
clang/include/clang/Frontend/CodeGenOptions.def
clang/include/clang/Frontend/CodeGenOptions.h
clang/lib/CodeGen/BackendUtil.cpp
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/Driver/Tools.cpp
clang/lib/Frontend/CMakeLists.txt
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGen/Inputs/pgotestclang.profraw [new file with mode: 0644]
clang/test/CodeGen/Inputs/pgotestir.profraw [new file with mode: 0644]
clang/test/CodeGen/pgo-instrumentation.c
clang/test/Driver/clang_f_opts.c
clang/test/Profile/c-captured.c
clang/test/Profile/c-counter-overflows.c
clang/test/Profile/c-general.c
clang/test/Profile/c-outdated-data.c
clang/test/Profile/c-unprofiled-blocks.c
clang/test/Profile/c-unprofiled.c
clang/test/Profile/cxx-lambda.cpp
clang/test/Profile/cxx-rangefor.cpp
clang/test/Profile/cxx-templates.cpp
clang/test/Profile/objc-general.m
clang/test/Profile/profile-does-not-exist.c