[all-commits] [llvm/llvm-project] ce2207: [ORC] Add support for emulated TLS to ORCv2.

lhames via All-commits all-commits at lists.llvm.org
Tue Jan 21 19:55:43 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ce2207abaf9a925b35f15ef92aaff6b301ba6d22
      https://github.com/llvm/llvm-project/commit/ce2207abaf9a925b35f15ef92aaff6b301ba6d22
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-01-21 (Tue, 21 Jan 2020)

  Changed paths:
    M llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h
    M llvm/include/llvm/ExecutionEngine/Orc/IRCompileLayer.h
    M llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
    M llvm/include/llvm/ExecutionEngine/Orc/Layer.h
    M llvm/include/llvm/ExecutionEngine/Orc/Speculation.h
    M llvm/lib/ExecutionEngine/Orc/CompileOnDemandLayer.cpp
    M llvm/lib/ExecutionEngine/Orc/CompileUtils.cpp
    M llvm/lib/ExecutionEngine/Orc/IRCompileLayer.cpp
    M llvm/lib/ExecutionEngine/Orc/IRTransformLayer.cpp
    M llvm/lib/ExecutionEngine/Orc/LLJIT.cpp
    M llvm/lib/ExecutionEngine/Orc/Layer.cpp
    A llvm/test/ExecutionEngine/OrcLazy/emulated-tls.ll
    M llvm/tools/lli/lli.cpp
    M llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp
    M llvm/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp
    M llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
    M llvm/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
    M llvm/unittests/ExecutionEngine/Orc/RemoteObjectLayerTest.cpp

  Log Message:
  -----------
  [ORC] Add support for emulated TLS to ORCv2.

This commit adds a ManglingOptions struct to IRMaterializationUnit, and replaces
IRCompileLayer::CompileFunction with a new IRCompileLayer::IRCompiler class. The
ManglingOptions struct defines the emulated-TLS state (via a bool member,
EmulatedTLS, which is true if emulated-TLS is enabled and false otherwise). The
IRCompileLayer::IRCompiler class wraps an IRCompiler (the same way that the
CompileFunction typedef used to), but adds a method to return the
IRCompileLayer::ManglingOptions that the compiler will use.

These changes allow us to correctly determine the symbols that will be produced
when a thread local global variable defined at the IR level is compiled with or
without emulated TLS. This is required for ORCv2, where MaterializationUnits
must declare their interface up-front.

Most ORCv2 clients should not require any changes. Clients writing custom IR
compilers will need to wrap their compiler in an IRCompileLayer::IRCompiler,
rather than an IRCompileLayer::CompileFunction, however this should be a
straightforward change (see modifications to CompileUtils.* in this patch for an
example).




More information about the All-commits mailing list