[all-commits] [llvm/llvm-project] e170d9: Split EH code by default

modiking via All-commits all-commits at lists.llvm.org
Wed Aug 17 12:42:54 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e170d955fe5717bfcf231b009b62e4f9d25b0354
      https://github.com/llvm/llvm-project/commit/e170d955fe5717bfcf231b009b62e4f9d25b0354
  Author: Archit Saxena <archsaxe at fb.com>
  Date:   2022-08-17 (Wed, 17 Aug 2022)

  Changed paths:
    M llvm/lib/CodeGen/MachineFunctionSplitter.cpp
    M llvm/test/CodeGen/X86/machine-function-splitter.ll

  Log Message:
  -----------
  Split EH code by default

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.

Reviewed By: snehasish

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




More information about the All-commits mailing list