forked from OSchip/llvm-project
[CSSPGO] Enable pseudo probe instrumentation in O0 mode.
Pseudo probe instrumentation was missing from O0 build. It is needed in cases where some source files are built in O0 while the others are built in optimize mode. Reviewed By: wenlei, wlei, wmi Differential Revision: https://reviews.llvm.org/D109531
This commit is contained in:
parent
962acf0a27
commit
299b5d420d
|
@ -1,3 +1,4 @@
|
|||
// RUN: %clang_cc1 -O0 -fno-legacy-pass-manager -fpseudo-probe-for-profiling -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
|
||||
// RUN: %clang_cc1 -O2 -fno-legacy-pass-manager -fpseudo-probe-for-profiling -debug-info-kind=limited -emit-llvm -o - %s | FileCheck %s
|
||||
|
||||
// Check the generation of pseudoprobe intrinsic call
|
||||
|
|
|
@ -1924,6 +1924,13 @@ ModulePassManager PassBuilder::buildO0DefaultPipeline(OptimizationLevel Level,
|
|||
|
||||
ModulePassManager MPM;
|
||||
|
||||
// Perform pseudo probe instrumentation in O0 mode. This is for the
|
||||
// consistency between different build modes. For example, a LTO build can be
|
||||
// mixed with an O0 prelink and an O2 postlink. Loading a sample profile in
|
||||
// the postlink will require pseudo probe instrumentation in the prelink.
|
||||
if (PGOOpt && PGOOpt->PseudoProbeForProfiling)
|
||||
MPM.addPass(SampleProfileProbePass(TM));
|
||||
|
||||
if (PGOOpt && (PGOOpt->Action == PGOOptions::IRInstr ||
|
||||
PGOOpt->Action == PGOOptions::IRUse))
|
||||
addPGOInstrPassesForO0(
|
||||
|
|
Loading…
Reference in New Issue