[all-commits] [llvm/llvm-project] d9a00e: [MachineOutliner] Leaf Descendants (#90275)

Xuan Zhang via All-commits all-commits at lists.llvm.org
Tue Jun 18 07:13:26 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d9a00ed3668803d11675b103fe9b6ed077ddc4c1
      https://github.com/llvm/llvm-project/commit/d9a00ed3668803d11675b103fe9b6ed077ddc4c1
  Author: Xuan Zhang <144393379+xuanzh-meta at users.noreply.github.com>
  Date:   2024-06-18 (Tue, 18 Jun 2024)

  Changed paths:
    M llvm/include/llvm/Support/SuffixTree.h
    M llvm/include/llvm/Support/SuffixTreeNode.h
    M llvm/lib/CodeGen/MachineOutliner.cpp
    M llvm/lib/Support/SuffixTree.cpp
    M llvm/lib/Support/SuffixTreeNode.cpp
    M llvm/test/CodeGen/AArch64/machine-outliner-cfi-tail-some.mir
    A llvm/test/CodeGen/AArch64/machine-outliner-leaf-descendants.ll
    M llvm/test/CodeGen/AArch64/machine-outliner-overlap.mir
    M llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.mir
    M llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-thunk.ll
    M llvm/test/CodeGen/AArch64/machine-outliner-throw2.ll
    M llvm/test/CodeGen/AArch64/machine-outliner-thunk.ll
    M llvm/test/CodeGen/AArch64/machine-outliner.mir
    M llvm/test/CodeGen/RISCV/machineoutliner-pcrel-lo.mir
    M llvm/unittests/Support/SuffixTreeTest.cpp

  Log Message:
  -----------
  [MachineOutliner] Leaf Descendants (#90275)

This PR  depends on https://github.com/llvm/llvm-project/pull/90264

In the current implementation, only leaf children of each internal node
in the suffix tree are included as candidates for outlining. But all
leaf descendants are outlining candidates, which we include in the new
implementation. This is enabled on a flag `outliner-leaf-descendants`
which is default to be true.

The reason for _enabling this on a flag_ is because machine outliner is
not the only pass that uses suffix tree.

The reason for _having this default to be true_ is because including all
leaf descendants show consistent size win.
* For Clang/LLD, it shows around 3% reduction in text segment size when
compared to the baseline `-Oz` linker binary.
 * For selected benchmark tests in LLVM test suite 
 
| run (CTMark/) | only leaf children | all leaf descendants | reduction
% |

|------------------|--------------------|----------------------|-------------|
| lencod | 349624 | 348564 | -0.2004% |
| SPASS | 219672 | 218440 | -0.4738% |
| kc | 271956 | 250068 | -0.4506% |
| sqlite3 | 223920 | 222484 | -0.5471% |
| 7zip-benchmark | 405364 | 401244 | -0.3428% |
| bullet | 139820 | 138340 | -0.8315% |
| consumer-typeset | 295684 | 286628 | -1.2295% |
| pairlocalalign | 72236 | 71936 | -0.2164% |
| tramp3d-v4 | 189572 | 183676 | -2.9668% |

This is part of an enhanced version of machine outliner -- see
[RFC](https://discourse.llvm.org/t/rfc-enhanced-machine-outliner-part-1-fulllto-part-2-thinlto-nolto-to-come/78732).



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