[PATCH] D97482: [CSSPGO] Deduplicating dangling pseudo probes.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 25 09:06:51 PST 2021


hoy created this revision.
Herald added subscribers: dexonsmith, wenlei, hiraditya.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Same dangling probes are redundant since they all have the same semantic that is to rely on the counts inference tool to get reasonable count for the same original block. Therefore, there's no need to keep multiple copies of them. I've seen jump threading created tons of redundant dangling probes that slowed down the compiler dramatically. Other optimization passes can also result in redundant probes though without an observed impact so far.

This change removes block-wise redundant dangling probes specifically introduced by jump threading. To support removing redundant dangling probes caused by all other passes, a final function-wise deduplication is also added.

An 18% size win of the .pseudo_probe section was seen for SPEC2017. No performance difference was observed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97482

Files:
  llvm/include/llvm/IR/PseudoProbe.h
  llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
  llvm/lib/CodeGen/PseudoProbeInserter.cpp
  llvm/lib/IR/PseudoProbe.cpp
  llvm/lib/Transforms/Scalar/JumpThreading.cpp
  llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
  llvm/test/Transforms/SampleProfile/pseudo-probe-dedup.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97482.326419.patch
Type: text/x-patch
Size: 8829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210225/9cd66d47/attachment.bin>


More information about the llvm-commits mailing list