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

Heejin Ahn via All-commits all-commits at lists.llvm.org
Wed Jan 29 12:57:23 PST 2020


  Branch: refs/heads/release/10.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 32723d572077e9a3776553a2067563974e85e7c8
      https://github.com/llvm/llvm-project/commit/32723d572077e9a3776553a2067563974e85e7c8
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-01-29 (Wed, 29 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).

(cherry picked from commit ce2207abaf9a925b35f15ef92aaff6b301ba6d22)


  Commit: 32056b4eb87258884074f7f635bccd40fc44852c
      https://github.com/llvm/llvm-project/commit/32056b4eb87258884074f7f635bccd40fc44852c
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

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

  Log Message:
  -----------
  [ORC] Fix a missing move in ce2207abaf9.

This should fix the build failure at
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/32524
and others.

(cherry picked from commit e0a6093a744d16c90eafa62d7143ce41806b2466)


  Commit: 46f6f03839e302364111f4532b9a098e9a0a9d21
      https://github.com/llvm/llvm-project/commit/46f6f03839e302364111f4532b9a098e9a0a9d21
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/KaleidoscopeJIT.h
    M llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/KaleidoscopeJIT.h
    M llvm/examples/SpeculativeJIT/SpeculativeJIT.cpp

  Log Message:
  -----------
  [ORC] Update examples to incorporate changes in ce2207abaf9.

This should fix the builders that were failing due to broken JIT examples
after ce2207abaf9.

(cherry picked from commit 98e55477558a823b1045b54d5a09681a3c0b819a)


  Commit: 011adfcbbdbe945222ef7bc8b1a9799aac2cbea3
      https://github.com/llvm/llvm-project/commit/011adfcbbdbe945222ef7bc8b1a9799aac2cbea3
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M clang/examples/clang-interpreter/main.cpp

  Log Message:
  -----------
  Update clang-interpreter example to incorporate changes in ce2207abaf9.

(cherry picked from commit b54aa053d3aeeab0cdaecb6286419138b7da5ef4)


  Commit: 92edb295392dea9c7f545f180065292459ebe4e9
      https://github.com/llvm/llvm-project/commit/92edb295392dea9c7f545f180065292459ebe4e9
  Author: Lang Hames <lhames at gmail.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M llvm/examples/LLJITExamples/LLJITWithObjectCache/LLJITWithObjectCache.cpp

  Log Message:
  -----------
  [ORC] Fix the LLJITWithObjectCache example to address changes in ce2207abaf9.

(cherry picked from commit 97d000da2e6025600c4709d611e853eb1d5d407c)


  Commit: d18ccb8b3310867c179f22704b6397e83981fff7
      https://github.com/llvm/llvm-project/commit/d18ccb8b3310867c179f22704b6397e83981fff7
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2020-01-29 (Wed, 29 Jan 2020)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp
    R llvm/test/CodeGen/WebAssembly/lower-em-exceptions-lpad-only.ll
    A llvm/test/CodeGen/WebAssembly/lower-em-exceptions-resume-only.ll

  Log Message:
  -----------
  [WebAssembly] Fix resume-only case in Emscripten EH

Summary:
D72308 incorrectly assumed `resume` cannot exist without a `landingpad`,
which is not true. This sets `Changed` to true whenever we make changes
to a function, including creating a call to `__resumeException` within a
function without a landing pad.

Reviewers: tlively

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

(cherry picked from commit 580d7838dd08e13dac6caf4ab3142c9381bc7ad0)


Compare: https://github.com/llvm/llvm-project/compare/f7f0fd4a21d5...d18ccb8b3310


More information about the All-commits mailing list