[CSSPGO] Set PseudoProbeInserter as a default pass.
authorHongtao Yu <hoy@fb.com>
Wed, 22 Sep 2021 00:16:45 +0000 (17:16 -0700)
committerHongtao Yu <hoy@fb.com>
Wed, 22 Sep 2021 16:09:48 +0000 (09:09 -0700)
commitd9b511d8e8c43f79e0e277be287656693dd6563f
tree12a58e44ca7f5b30ab50a7392bca674a97664db7
parent173dd896db976d1e975a2a5d844fc09238884277
[CSSPGO] Set PseudoProbeInserter as a default pass.

Currenlty PseudoProbeInserter is a pass conditioned on a target switch. It works well with a single clang invocation. It doesn't work so well when the backend is called separately (i.e, through the linker or llc), where user has always to pass -pseudo-probe-for-profiling explictly. I'm making the pass a default pass that requires no command line arg to trigger, but will be actually run depending on whether the CU comes with `llvm.pseudo_probe_desc` metadata.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D110209
19 files changed:
clang/lib/CodeGen/BackendUtil.cpp
lld/ELF/Config.h
lld/ELF/Driver.cpp
lld/ELF/LTO.cpp
lld/ELF/Options.td
lld/test/ELF/lto/pseudo-probe-lto.ll
llvm/include/llvm/CodeGen/CommandFlags.h
llvm/include/llvm/Target/TargetOptions.h
llvm/lib/CodeGen/CommandFlags.cpp
llvm/lib/CodeGen/PseudoProbeInserter.cpp
llvm/lib/CodeGen/TargetPassConfig.cpp
llvm/lib/Target/X86/X86TargetMachine.cpp
llvm/test/CodeGen/X86/O0-pipeline.ll
llvm/test/CodeGen/X86/opt-pipeline.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-dangle.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-emit-inline.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-emit.ll
llvm/test/Transforms/SampleProfile/pseudo-probe-instsched.ll
llvm/test/tools/llvm-profgen/truncated-pseudoprobe.test