[PATCH] D131824: Split EH code by default

Archit Saxena via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 12 20:05:30 PDT 2022


iamarchit123 created this revision.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
iamarchit123 updated this revision to Diff 452363.
iamarchit123 added a comment.
iamarchit123 edited the summary of this revision.
iamarchit123 added reviewers: hoy, modimo.
iamarchit123 removed subscribers: hiraditya, pengfei.
Herald added a subscriber: wenlei.
iamarchit123 removed a subscriber: wenlei.
iamarchit123 published this revision for review.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Split all EH code


The current machine function splitter is reliant on profile data to do profile summary analysis to split blocks into cold section. This may sometimes limit the usage of machine function splitter especially in cases where we could do some form of static analysis to split out cold blocks if profile data is absent or profile data which may be faulty (Consider Sample PGO).

Of all code that could statically be marked cold Exception handling blocks are one of them (In fact BFI framework also tends to mark them as cold), and the most in size contribution. In my experiments I found out Exception handling pads and all code reachable from there account for up to 6-8% of the .text section on modern production binaries. This patch introduces a flag to split out all Exception handling blocks and blocks only reachable from Exceptional Handling pad to cold section. This flag has shown to give a performance win of up to 0.1% in terms of average cycles and instructions executed on internal facebook search service.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131824

Files:
  llvm/lib/CodeGen/MachineFunctionSplitter.cpp
  llvm/test/CodeGen/X86/machine-function-splitter.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131824.452363.patch
Type: text/x-patch
Size: 9448 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220813/05cc7a37/attachment.bin>


More information about the llvm-commits mailing list