[llvm] [llvm-profgen] Fix bogus trace check (PR #225569)

Kunal Pathak via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 19:56:35 PDT 2026


================
@@ -272,24 +272,6 @@ struct UnwindState {
     initFrameTrie(Sample->CallStack);
   }
 
-  bool validateInitialState() {
-    uint64_t LBRLeaf = LBRStack[LBRIndex].Target;
-    uint64_t LeafAddr = CurrentLeafFrame->Address;
-    assert((LBRLeaf != ExternalAddr || LBRLeaf == LeafAddr) &&
-           "External leading LBR should match the leaf frame.");
-
-    // When we take a stack sample, ideally the sampling distance between the
-    // leaf IP of stack and the last LBR target shouldn't be very large.
-    // Use a heuristic size (0x100) to filter out broken records.
-    if (LeafAddr < LBRLeaf || LeafAddr - LBRLeaf >= 0x100) {
----------------
kunalspathak wrote:

Have we measured the impact of this fix on profiles like x86 LBR that had zero skid (perhaps because of this reporting)?

https://github.com/llvm/llvm-project/pull/225569


More information about the llvm-commits mailing list