summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2016-02-29 18:54:59 +0000
committerRong Xu <xur@google.com>2016-02-29 18:54:59 +0000
commit522b5cb3753f39ceb021ab2511c54d7163940b06 (patch)
treefb80b468c405b0bef10c6f659a7a1cc1ed567dec /clang/lib/CodeGen/BackendUtil.cpp
parent73cd686ce144730f876870658d1ed75d3ffcc7ae (diff)
downloadbcm5719-llvm-522b5cb3753f39ceb021ab2511c54d7163940b06.tar.gz
bcm5719-llvm-522b5cb3753f39ceb021ab2511c54d7163940b06.zip
[PGO] clang cc1 option change to enable IR level instrumentation
This patch expands cc1 option -fprofile-instrument= with a new value: -fprofile-instrument=llvm which enables IR level PGO instrumentation. Reviewers: davidxl, silvas Differential Revision: http://reviews.llvm.org/D17622 llvm-svn: 262239
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index f5afc68eddc..8af9c30dca7 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -437,6 +437,12 @@ void EmitAssemblyHelper::CreatePasses(FunctionInfoIndex *FunctionIndex) {
Options.InstrProfileOutput = CodeGenOpts.InstrProfileOutput;
MPM->add(createInstrProfilingPass(Options));
}
+ if (CodeGenOpts.hasProfileIRInstr()) {
+ if (!CodeGenOpts.InstrProfileOutput.empty())
+ PMBuilder.PGOInstrGen = CodeGenOpts.InstrProfileOutput;
+ else
+ PMBuilder.PGOInstrGen = "default.profraw";
+ }
if (!CodeGenOpts.SampleProfileFile.empty())
MPM->add(createSampleProfileLoaderPass(CodeGenOpts.SampleProfileFile));
OpenPOWER on IntegriCloud