[PseudoProbe] Remove unnecessary asserts about non-zero discriminator.
authorHongtao Yu <hoy@fb.com>
Fri, 14 Jul 2023 00:22:57 +0000 (17:22 -0700)
committerHongtao Yu <hoy@fb.com>
Mon, 17 Jul 2023 16:43:10 +0000 (09:43 -0700)
Despite previous efforts in fixing accidentally setting deduplication factor and avoiding enforcing a callsite debug loc for pseudo probes, I'm still seeing an IR probe having a non-zero discriminator. This time it is due to the merge of two probes with irreconsilable debug locations and the merged probe ends up getting the original callsite locs. Therefore I'm removing the assert about IR probe should always have a zero discriminator. This safe since
- Probe discriminators are only emitted in FS-AFDO mode; and
- The first FS discriminator assigning pass always clears non-discriminators left over from IR passes.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D155252

llvm/lib/IR/PseudoProbe.cpp

index b3dc5ae..df5f78c 100644 (file)
@@ -64,8 +64,6 @@ std::optional<PseudoProbe> extractProbe(const Instruction &Inst) {
     Probe.Discriminator = 0;
     if (const DebugLoc &DLoc = Inst.getDebugLoc())
       Probe.Discriminator = DLoc->getDiscriminator();
-    assert(Probe.Discriminator == 0 &&
-           "Unexpected non-zero FS-discriminator for IR pseudo probes");
     return Probe;
   }