[all-commits] [llvm/llvm-project] 1aa71f: [ORC][ORC_RT] Integrate ORC platforms with LLJIT a...

Peter S. Housel via All-commits all-commits at lists.llvm.org
Thu Jun 9 22:48:59 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1aa71f8679e439db651c06e8e68ef21e6deffa93
      https://github.com/llvm/llvm-project/commit/1aa71f8679e439db651c06e8e68ef21e6deffa93
  Author: Peter S. Housel <housel at acm.org>
  Date:   2022-06-09 (Thu, 09 Jun 2022)

  Changed paths:
    M compiler-rt/lib/orc/CMakeLists.txt
    A compiler-rt/lib/orc/dlfcn_wrapper.cpp
    A compiler-rt/test/orc/TestCases/Darwin/x86-64/lljit-ehframe.cpp
    A compiler-rt/test/orc/TestCases/Darwin/x86-64/lljit-initialize-deinitialize.ll
    A compiler-rt/test/orc/TestCases/FreeBSD/x86-64/lljit-ehframe.cpp
    A compiler-rt/test/orc/TestCases/FreeBSD/x86-64/lljit-initialize-deinitialize.ll
    A compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-ehframe.cpp
    A compiler-rt/test/orc/TestCases/Linux/x86-64/lljit-initialize-deinitialize.ll
    M compiler-rt/test/orc/lit.cfg.py
    M llvm/include/llvm/ExecutionEngine/Orc/JITTargetMachineBuilder.h
    M llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
    M llvm/lib/ExecutionEngine/Orc/JITTargetMachineBuilder.cpp
    M llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp
    M llvm/tools/lli/lli.cpp

  Log Message:
  -----------
  [ORC][ORC_RT] Integrate ORC platforms with LLJIT and lli

This change enables integrating orc::LLJIT with the ORCv2
platforms (MachOPlatform and ELFNixPlatform) and the compiler-rt orc
runtime. Changes include:

- Adding SPS wrapper functions for the orc runtime's dlfcn emulation
  functions, allowing initialization and deinitialization to be invoked
  by LLJIT.

- Changing the LLJIT code generation default to add UseInitArray so
  that .init_array constructors are generated for ELF platforms.

- Integrating the ORCv2 Platforms into lli, and adding a
  PlatformSupport implementation to the LLJIT instance used by lli which
  implements initialization and deinitialization by calling the new
  wrapper functions in the runtime.

Reviewed By: lhames

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


  Commit: 2be5abb7e9a1f837c550745900f0fb155b440122
      https://github.com/llvm/llvm-project/commit/2be5abb7e9a1f837c550745900f0fb155b440122
  Author: Peter S. Housel <housel at acm.org>
  Date:   2022-06-09 (Thu, 09 Jun 2022)

  Changed paths:
    M compiler-rt/lib/orc/elfnix_platform.cpp
    M compiler-rt/lib/orc/elfnix_platform.h
    A compiler-rt/test/orc/TestCases/FreeBSD/x86-64/priority-static-initializer.S
    A compiler-rt/test/orc/TestCases/Linux/x86-64/priority-static-initializer.S
    M llvm/lib/ExecutionEngine/Orc/ELFNixPlatform.cpp
    M llvm/lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp

  Log Message:
  -----------
  [ORC][ORC_RT] Handle ELF .init_array with non-default priority

ELF-based platforms currently support defining multiple static
initializer table sections with differing priorities, for example
.init_array.0 or .init_array.100; the default .init_array corresponds
to a priority of 65535. When building a shared library or executable,
the system linker normally sorts these sections and combines them into
a single .init_array section. This change adds the capability to
recognize ELF static initializers with priorities other than the
default, and to properly sort them by priority, to Orc and the Orc
runtime.

Reviewed By: lhames

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


Compare: https://github.com/llvm/llvm-project/compare/87c426832907...2be5abb7e9a1


More information about the All-commits mailing list