[all-commits] [llvm/llvm-project] 85681d: [ORC] Simplify intra-graph dependence tracking in ...

Lang Hames via All-commits all-commits at lists.llvm.org
Sat Sep 21 16:52:34 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85681d48343d503e95d57bad742b254354e59414
      https://github.com/llvm/llvm-project/commit/85681d48343d503e95d57bad742b254354e59414
  Author: Lang Hames <lhames at gmail.com>
  Date:   2024-09-22 (Sun, 22 Sep 2024)

  Changed paths:
    M llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp

  Log Message:
  -----------
  [ORC] Simplify intra-graph dependence tracking in ObjectLinkingLayer.

ObjectLinkingLayer::registerDependencies used to propagate external symbol
dependencies (dependencies on symbols outside the current graph) to all nodes.
Since ebe8733a11e, which merged addDependencies into notifyEmitted, the
notifyEmitted function will propagate intra-graph dependencies, so
registerDependencies no longer needs to do this.

This patch updates ObjectLinkingLayer::registerDependencies to just propagate
named dependencies (on both internal and external symbols) through anonymous
blocks, leaving the rest of the work to ExecutionSession::notifyEmitted.
It also choses a key symbol to use for blocks containing multiple symbols. The
result is both easier to read and faster.


  Commit: 255870d7b5c474b1ea0b61f165d11930ada2e2ef
      https://github.com/llvm/llvm-project/commit/255870d7b5c474b1ea0b61f165d11930ada2e2ef
  Author: Lang Hames <lhames at gmail.com>
  Date:   2024-09-22 (Sun, 22 Sep 2024)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h
    M llvm/lib/ExecutionEngine/JITLink/DWARFRecordSectionSplitter.cpp
    M llvm/lib/ExecutionEngine/JITLink/JITLink.cpp
    M llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp
    M llvm/test/ExecutionEngine/JITLink/AArch64/ELF_ehframe.s
    M llvm/test/ExecutionEngine/JITLink/AArch64/MachO_ehframe.s
    M llvm/test/ExecutionEngine/JITLink/LoongArch/ELF_loongarch64_ehframe.s
    M llvm/test/ExecutionEngine/JITLink/RISCV/ELF_ehframe.s
    M llvm/test/ExecutionEngine/JITLink/ppc64/ELF_ppc64_ehframe.s
    M llvm/unittests/ExecutionEngine/JITLink/LinkGraphTests.cpp

  Log Message:
  -----------
  [JITLink] Update splitBlock to support splitting into multiple blocks.

LinkGraph::splitBlock used to take a single split-point to split a Block into
two. In the common case where a block needs to be split repeatedly (e.g. in
eh-frame and compact-unwind sections), iterative calls to splitBlock could
lead to poor performance as symbols and edges are repeatedly shuffled to new
blocks.

This commit updates LinkGraph::splitBlock to take a sequence of split offsets,
allowing a block to be split into an arbitrary number of new blocks. Internally,
Symbols and Edges only need to be moved once (directly to whichever new block
they will be associated with), leading to better performance.

On some large MachO object files in an out of tree project this change improved
the performance of splitBlock by several orders of magnitude.

rdar://135820493


Compare: https://github.com/llvm/llvm-project/compare/1833d418a041...255870d7b5c4

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