[llvm] 40508e3 - [PseudoProbe] Remove unnecessary asserts about non-zero discriminator.

Hongtao Yu via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 17 09:43:21 PDT 2023


Author: Hongtao Yu
Date: 2023-07-17T09:43:10-07:00
New Revision: 40508e3ed978c9dc3024c3968701d62da624d248

URL: https://github.com/llvm/llvm-project/commit/40508e3ed978c9dc3024c3968701d62da624d248
DIFF: https://github.com/llvm/llvm-project/commit/40508e3ed978c9dc3024c3968701d62da624d248.diff

LOG: [PseudoProbe] Remove unnecessary asserts about non-zero discriminator.

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

Added: 
    

Modified: 
    llvm/lib/IR/PseudoProbe.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/PseudoProbe.cpp b/llvm/lib/IR/PseudoProbe.cpp
index b3dc5ae32023fa..df5f78c5118225 100644
--- a/llvm/lib/IR/PseudoProbe.cpp
+++ b/llvm/lib/IR/PseudoProbe.cpp
@@ -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;
   }
 


        


More information about the llvm-commits mailing list