diff --git a/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp --- a/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/PseudoProbePrinter.cpp @@ -45,8 +45,8 @@ uint64_t Discriminator = 0; // For now only block probes have FS discriminators. See // MIRFSDiscriminator.cpp for more details. - if (DebugLoc && - !DILocation::isPseudoProbeDiscriminator(DebugLoc->getDiscriminator())) + if (EnableFSDiscriminator && DebugLoc && + (Type == (uint64_t)PseudoProbeType::Block)) Discriminator = DebugLoc->getDiscriminator(); SmallVector InlineStack(llvm::reverse(ReversedInlineStack)); Asm->OutStreamer->emitPseudoProbe(Guid, Index, Type, Attr, Discriminator,