[FS-AFDO] Clean up non-zero discriminator for pseudo probes at the first FS discrimin...
authorHongtao Yu <hoy@fb.com>
Wed, 17 May 2023 00:26:43 +0000 (17:26 -0700)
committerHongtao Yu <hoy@fb.com>
Wed, 17 May 2023 04:35:17 +0000 (21:35 -0700)
commitd4d6b9a142f0017b4d5668155fbbe045c838b8a6
tree464026e10a5594b339d82b72ca089281e9e5323d
parent456eb4b5bffe42d109c09b8706d4eeda8baa1f9a
[FS-AFDO] Clean up non-zero discriminator for pseudo probes at the first FS discriminator pass.

The dwarf discriminator field for pseudo probes is not supposed to be used until the first FS discriminator pass. Unfortunately there are always corner cases that accidientally set this field. For example, the inliner could set this field for an inlined instruction if the instruction does not come with any debug information. While fixing all such spots is possible, but for future-proff I'd like to enforce a general cleanup before assigning probes any FS discriminator.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D150741
llvm/include/llvm/CodeGen/MIRFSDiscriminator.h
llvm/lib/CodeGen/MIRFSDiscriminator.cpp
llvm/test/CodeGen/X86/fsafdo_probe.ll