[Sample-PGO] Emit FS discriminators only when -fdebug-info-for-profiling is set
authorRong Xu <xur@google.com>
Fri, 25 Feb 2022 17:05:06 +0000 (09:05 -0800)
committerRong Xu <xur@google.com>
Fri, 25 Feb 2022 17:41:17 +0000 (09:41 -0800)
commitccbbb4f6c716ba14d98cceff08a81777228ab4d1
tree8cccc3888072e07267017d0d89eeda80b7268937
parent0625aed2fcfb55b245d2160bb07a68878832991a
[Sample-PGO] Emit FS discriminators only when -fdebug-info-for-profiling is set

IR level addDiscriminator pass is guarded by DebugInfoForProfiling
(set by option -fdebug-info-for-profiling).
This patch syncs the logic for the MIR and IR level implementations.

Differential Revision: https://reviews.llvm.org/D120536
llvm/lib/CodeGen/MIRFSDiscriminator.cpp
llvm/test/CodeGen/X86/fsafdo_test1.ll
llvm/test/CodeGen/X86/fsafdo_test4.ll [new file with mode: 0644]