[all-commits] [llvm/llvm-project] 950487: [Pseudo Probe] Do not instrument EH blocks.

Hongtao Yu via All-commits all-commits at lists.llvm.org
Mon Jan 30 13:27:14 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 950487bddf1922c87559339a24cf5a77ad59c363
      https://github.com/llvm/llvm-project/commit/950487bddf1922c87559339a24cf5a77ad59c363
  Author: Hongtao Yu <hoy at fb.com>
  Date:   2023-01-30 (Mon, 30 Jan 2023)

  Changed paths:
    A llvm/include/llvm/Analysis/EHUtils.h
    M llvm/include/llvm/CodeGen/MachineBasicBlock.h
    M llvm/include/llvm/CodeGen/MachineSSAContext.h
    M llvm/lib/CodeGen/MachineFunctionSplitter.cpp
    M llvm/lib/Transforms/IPO/SampleProfileProbe.cpp
    A llvm/test/Transforms/SampleProfile/pseudo-probe-eh.ll

  Log Message:
  -----------
  [Pseudo Probe] Do not instrument EH blocks.

This change avoids inserting probes to EH blocks. Pseudo probe can prevent block merging when probes in the blocks look different. This has a chained effect to passes incurring exponential IR growth (such as jump threading) and as a consequence the compilation may time out.  Not inserting probes to EH blocks could mitigate the issue. Another benefit is that both IR size and binary size are smaller. Since EH blocks are usually cold, the change should have minimal impact to profile quality.

Testing:

Out of two internal large benchmarks, no perf impact seen. 1% size savings to both the `text` and the `pseudo_probe` section.

Reviewed By: wenlei

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




More information about the All-commits mailing list