[all-commits] [llvm/llvm-project] b8cc3b: [PseudoProbe] Extend to skip instrumenting probe i...

Lei Wang via All-commits all-commits at lists.llvm.org
Mon Apr 1 13:55:17 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b8cc3ba409dc850776f37e27613bf74f5a80d66a
      https://github.com/llvm/llvm-project/commit/b8cc3ba409dc850776f37e27613bf74f5a80d66a
  Author: Lei Wang <wlei at fb.com>
  Date:   2024-04-01 (Mon, 01 Apr 2024)

  Changed paths:
    M llvm/include/llvm/Analysis/EHUtils.h
    M llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h
    M llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
    M llvm/test/ThinLTO/X86/pseudo-probe-desc-import.ll
    M llvm/test/Transforms/SampleProfile/pseudo-probe-eh.ll
    A llvm/test/Transforms/SampleProfile/pseudo-probe-invoke.ll

  Log Message:
  -----------
  [PseudoProbe] Extend to skip instrumenting probe into the dests of invoke (#79919)

As before we only skip instrumenting probe of `unwind`(`KnownColdBlock`)
block, this PR extends to skip the both EH flow from `invoke`, i.e. also
skip the `normal` dest. For more contexts: when doing call-to-invoke
conversion, the block is split by the `invoke` and two extra
blocks(`normal` and `unwind`) are added. With this PR, the
instrumentation is the same as the one before the call-to-invoke
conversion.
One significant benefit is this can help mitigate the "unstable IR"
issue(https://discourse.llvm.org/t/ipo-for-linkonce-odr-functions/69404),
the two versions now are on the same probe instrumentation, expected to
be the same checksum.
To achieve the same checksum, some tweaks is needed:
-  Now it also skips incrementing the probe ID for the skipped probe.
- The checksum is also computed based on the CFG that skips the EH
edges.

We observed this fixes ~5% mismatched samples.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list