[CSSPGO] Allow the use of debug-info-for-profiling and pseudo-probe-for-profiling...
authorHongtao Yu <hoy@fb.com>
Wed, 11 Aug 2021 01:19:21 +0000 (18:19 -0700)
committerHongtao Yu <hoy@fb.com>
Thu, 12 Aug 2021 15:52:49 +0000 (08:52 -0700)
commitccb5b9bbfb5cef1aa2982481894f30c8f81d5253
treeef962ad284966272c60a1bb7b84b4e65430c73a4
parentcd44cc86e34ebd29410c3452e44e241e281a7288
[CSSPGO] Allow the use of debug-info-for-profiling and pseudo-probe-for-profiling together

Previoulsy debug-info-for-profiling and pseudo-probe-for-profiling are mutual exclusive because they compete the dwarf discrimnator for callsites on the IR. This changes allows to use the two switches together. The side effect is that callsite discriminators will be taken by pseudo probe, while discriminators for other instructions are still available for AutoFDO use. This is less than ideal, however, it still allows us a chance to smoothly transition from AutoFDO to CSSPGO, by collecting both profiles from a CSSPGO binary.

Reviewed By: wenlei, wmi

Differential Revision: https://reviews.llvm.org/D107876
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/CodeGenCXX/fdebug-info-for-profiling.cpp
clang/test/Driver/pseudo-probe.c
llvm/include/llvm/Passes/PassBuilder.h
llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll [new file with mode: 0644]
llvm/tools/opt/NewPMDriver.cpp