[all-commits] [llvm/llvm-project] 9016f2: [CodeLayout] Size-aware machine block placement (#...

spupyrev via All-commits all-commits at lists.llvm.org
Wed Oct 2 10:48:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9016f27c4253ac5c6282c30f0fe08ddd58522cdd
      https://github.com/llvm/llvm-project/commit/9016f27c4253ac5c6282c30f0fe08ddd58522cdd
  Author: spupyrev <spupyrev at users.noreply.github.com>
  Date:   2024-10-02 (Wed, 02 Oct 2024)

  Changed paths:
    M llvm/lib/CodeGen/MachineBlockPlacement.cpp
    A llvm/test/CodeGen/X86/code_placement_ext_tsp_size.ll

  Log Message:
  -----------
  [CodeLayout] Size-aware machine block placement (#109711)

This is an implementation of a new "size-aware" machine block placement.
The
idea is to reorder blocks so that the number of fall-through jumps is
maximized.
Observe that profile data is ignored for the optimization, and it is
applied only
for instances with hasOptSize()=true.
This strategy has two benefits:
(i) it eliminates jump instructions, which results in smaller text size;
(ii) we avoid using profile data while reordering blocks, which yields
more
"uniform" functions, thus helping ICF and machine outliner/merger.

For large (mobile) apps, the size benefits of (i) and (ii) are roughly
the same,
combined providing up to 0.5% uncompressed and up to 1% compressed
savings size
on top of the current solution.

The optimization is turned off by default.



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