Skip to content
  1. Nov 12, 2019
    • Florian Hahn's avatar
      [Examples] Add IRTransformations directory to examples. · 7d0b1d77
      Florian Hahn authored
      This patch adds a new IRTransformations directory to llvm/examples/. This is
      intended to serve as a new home for example transformations/analysis
      code used by various tutorials.
      
      If LLVM_BUILD_EXAMPLES is enabled, the ExamplesIRTransforms library is
      linked into the opt binary and the example passes become available.
      
      To start off with, it contains the CFG simplifications used in the IR
      part of the 'Getting Started With LLVM: Basics' tutorial at the US LLVM
      Developers Meeting 2019.
      
      Reviewers: paquette, jfb, meikeb, lhames, kbarton
      
      Reviewed By: paquette
      
      Differential Revision: https://reviews.llvm.org/D69416
      7d0b1d77
  2. Oct 30, 2019
    • Chris Bieneman's avatar
      Break out OrcError and RPC · a34680a3
      Chris Bieneman authored
      Summary:
      When createing an ORC remote JIT target the current library split forces the target process to link large portions of LLVM (Core, Execution Engine, JITLink, Object, MC, Passes, RuntimeDyld, Support, Target, and TransformUtils). This occurs because the ORC RPC interfaces rely on the static globals the ORC Error types require, which starts a cycle of pulling in more and more.
      
      This patch breaks the ORC RPC Error implementations out into an "OrcError" library which only depends on LLVM Support. It also pulls the ORC RPC headers into their own subdirectory.
      
      With this patch code can include the Orc/RPC/*.h headers and will only incur link dependencies on LLVMOrcError and LLVMSupport.
      
      Reviewers: lhames
      
      Reviewed By: lhames
      
      Subscribers: mgorny, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68732
      a34680a3
  3. Oct 22, 2019
  4. Oct 18, 2019
    • Lang Hames's avatar
      [examples] Fix some comments in the LLJITWithJITLink example · bb7dd55f
      Lang Hames authored
      llvm-svn: 375269
      bb7dd55f
    • Lang Hames's avatar
      [examples] Add an example of how to use JITLink and small-code-model with LLJIT. · 1ac3f80a
      Lang Hames authored
      JITLink is LLVM's newer jit-linker. It is an alternative to (and hopefully
      eventually a replacement for) LLVM's older jit-linker, RuntimeDyld. Unlike
      RuntimeDyld which requries JIT'd code to be complied with the large code
      model, JITlink can link code compiled with the small code model, which is
      the native code model for a number of targets (including all supported MachO
      targets).
      
      This example shows how to:
      
      -- Create a JITLink InProcessMemoryManager
      -- Set the code model to small
      -- Use a JITLink backed ObjectLinkingLayer as the linking layer for LLJIT
         (rather than the default RTDyldObjectLinkingLayer).
      
      Note: This example will only work on platforms supported by JITLink. As of
      this commit that's MachO/x86-64 and MachO/arm64.
      
      llvm-svn: 375266
      1ac3f80a
  5. Sep 13, 2019
  6. Aug 27, 2019
    • Praveen Velliengiri's avatar
      [ORCv2] - New Speculate Query Implementation · 3b1b56d3
      Praveen Velliengiri authored
      Summary:
      This patch introduces, SequenceBBQuery - new heuristic to find likely next callable functions it tries to find the blocks with calls in order of execution sequence of Blocks.
      
      It still uses BlockFrequencyAnalysis to find high frequency blocks. For a handful of hottest blocks (plan to customize), the algorithm traverse and discovered the caller blocks along the way to Entry Basic Block and Exit Basic Block. It uses Block Hint, to stop traversing the already visited blocks in both direction. It implicitly assumes that once the block is visited during discovering entry or exit nodes, revisiting them again does not add much. It also branch probability info (cached result) to traverse only hot edges (planned to customize) from hot blocks. Without BPI, the algorithm mostly return's all the blocks in the CFG with calls.
      
      It also changes the heuristic queries, so they don't maintain states. Hence it is safe to call from multiple threads.
      
      It also implements, new instrumentation to avoid jumping into JIT on every call to the function with the help _orc_speculate.decision.block and _orc_speculate.block.
      
      "Speculator Registration Mechanism is also changed" - kudos to @lhames
      
      Open to review, mostly looking to change implementation of SequeceBBQuery heuristics with good data structure choices.
      
      Reviewers: lhames, dblaikie
      
      Reviewed By: lhames
      
      Subscribers: mgorny, hiraditya, mgrang, llvm-commits, lhames
      
      Tags: #speculative_compilation_in_orc, #llvm
      
      Differential Revision: https://reviews.llvm.org/D66399
      
      llvm-svn: 370092
      3b1b56d3
  7. Aug 18, 2019
  8. Aug 15, 2019
  9. Aug 14, 2019
  10. Aug 13, 2019
  11. Aug 05, 2019
  12. Aug 03, 2019
    • Praveen Velliengiri's avatar
      Speculative Compilation · f5c40cb9
      Praveen Velliengiri authored
      
      
      [ORC] Remove Speculator Variants for Different Program Representations
      
      [ORC] Block Freq Analysis
      
      Speculative Compilation with Naive Block Frequency
      
      Add Applications to OrcSpeculation
      
      ORC v2 with Block Freq Query & Example
      
      Deleted BenchMark Programs
      
      Signed-off-by: default avatarpreejackie <praveenvelliengiri@gmail.com>
      
      ORCv2 comments resolved
      
      [ORCV2] NFC
      
      ORCv2 NFC
      
      [ORCv2] Speculative compilation - CFGWalkQuery
      
      ORCv2 Adapting IRSpeculationLayer to new locking scheme
      
      llvm-svn: 367756
      f5c40cb9
  13. Aug 02, 2019
    • Lang Hames's avatar
      [ORC] Change the locking scheme for ThreadSafeModule. · 809e9d1e
      Lang Hames authored
      ThreadSafeModule/ThreadSafeContext are used to manage lifetimes and locking
      for LLVMContexts in ORCv2. Prior to this patch contexts were locked as soon
      as an associated Module was emitted (to be compiled and linked), and were not
      unlocked until the emit call returned. This could lead to deadlocks if
      interdependent modules that shared contexts were compiled on different threads:
      when, during emission of the first module, the dependence was discovered the
      second module (which would provide the required symbol) could not be emitted as
      the thread emitting the first module still held the lock.
      
      This patch eliminates this possibility by moving to a finer-grained locking
      scheme. Each client holds the module lock only while they are actively operating
      on it. To make this finer grained locking simpler/safer to implement this patch
      removes the explicit lock method, 'getContextLock', from ThreadSafeModule and
      replaces it with a new method, 'withModuleDo', that implicitly locks the context,
      calls a user-supplied function object to operate on the Module, then implicitly
      unlocks the context before returning the result.
      
      ThreadSafeModule TSM = getModule(...);
      size_t NumFunctions = TSM.withModuleDo(
          [](Module &M) { // <- context locked before entry to lambda.
            return M.size();
          });
      
      Existing ORCv2 layers that operate on ThreadSafeModules are updated to use the
      new method.
      
      This method is used to introduce Module locking into each of the existing
      layers.
      
      llvm-svn: 367686
      809e9d1e
  14. Jul 17, 2019
  15. Jul 10, 2019
    • Lang Hames's avatar
      [ORC] Add custom IR compiler configuration to LLJITBuilder to enable obj caches. · 843f198a
      Lang Hames authored
      LLJITBuilder now has a setCompileFunctionCreator method which can be used to
      construct a CompileFunction for the LLJIT instance being created. The motivating
      use-case for this is supporting ObjectCaches, which can now be set up at
      compile-function construction time. To demonstrate this an example project,
      LLJITWithObjectCache, is included.
      
      llvm-svn: 365671
      843f198a
  16. May 22, 2019
  17. Apr 20, 2019
  18. Feb 21, 2019
  19. Feb 01, 2019
    • James Y Knight's avatar
      Fix compilation of examples after 13680223 / r352827 · 473e3420
      James Y Knight authored
      Who knew...they're not built by default or as part of the tests.
      
      llvm-svn: 352830
      473e3420
    • James Y Knight's avatar
      [opaque pointer types] Add a FunctionCallee wrapper type, and use it. · 13680223
      James Y Knight authored
      Recommit r352791 after tweaking DerivedTypes.h slightly, so that gcc
      doesn't choke on it, hopefully.
      
      Original Message:
      The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
      and is a useful convenience to enable code to continue passing the
      result of getOrInsertFunction() through to EmitCall, even once pointer
      types lose their pointee-type.
      
      Then:
      - update the CallInst/InvokeInst instruction creation functions to
        take a Callee,
      - modify getOrInsertFunction to return FunctionCallee, and
      - update all callers appropriately.
      
      One area of particular note is the change to the sanitizer
      code. Previously, they had been casting the result of
      `getOrInsertFunction` to a `Function*` via
      `checkSanitizerInterfaceFunction`, and storing that. That would report
      an error if someone had already inserted a function declaraction with
      a mismatching signature.
      
      However, in general, LLVM allows for such mismatches, as
      `getOrInsertFunction` will automatically insert a bitcast if
      needed. As part of this cleanup, cause the sanitizer code to do the
      same. (It will call its functions using the expected signature,
      however they may have been declared.)
      
      Finally, in a small number of locations, callers of
      `getOrInsertFunction` actually were expecting/requiring that a brand
      new function was being created. In such cases, I've switched them to
      Function::Create instead.
      
      Differential Revision: https://reviews.llvm.org/D57315
      
      llvm-svn: 352827
      13680223
  20. Jan 31, 2019
    • James Y Knight's avatar
      Revert "[opaque pointer types] Add a FunctionCallee wrapper type, and use it." · fadf2506
      James Y Knight authored
      This reverts commit f47d6b38 (r352791).
      
      Seems to run into compilation failures with GCC (but not clang, where
      I tested it). Reverting while I investigate.
      
      llvm-svn: 352800
      fadf2506
    • James Y Knight's avatar
      [opaque pointer types] Add a FunctionCallee wrapper type, and use it. · f47d6b38
      James Y Knight authored
      The FunctionCallee type is effectively a {FunctionType*,Value*} pair,
      and is a useful convenience to enable code to continue passing the
      result of getOrInsertFunction() through to EmitCall, even once pointer
      types lose their pointee-type.
      
      Then:
      - update the CallInst/InvokeInst instruction creation functions to
        take a Callee,
      - modify getOrInsertFunction to return FunctionCallee, and
      - update all callers appropriately.
      
      One area of particular note is the change to the sanitizer
      code. Previously, they had been casting the result of
      `getOrInsertFunction` to a `Function*` via
      `checkSanitizerInterfaceFunction`, and storing that. That would report
      an error if someone had already inserted a function declaraction with
      a mismatching signature.
      
      However, in general, LLVM allows for such mismatches, as
      `getOrInsertFunction` will automatically insert a bitcast if
      needed. As part of this cleanup, cause the sanitizer code to do the
      same. (It will call its functions using the expected signature,
      however they may have been declared.)
      
      Finally, in a small number of locations, callers of
      `getOrInsertFunction` actually were expecting/requiring that a brand
      new function was being created. In such cases, I've switched them to
      Function::Create instead.
      
      Differential Revision: https://reviews.llvm.org/D57315
      
      llvm-svn: 352791
      f47d6b38
  21. Jan 27, 2019
  22. Jan 19, 2019
    • Chandler Carruth's avatar
      Update the file headers across all of the LLVM projects in the monorepo · 2946cd70
      Chandler Carruth authored
      to reflect the new license.
      
      We understand that people may be surprised that we're moving the header
      entirely to discuss the new license. We checked this carefully with the
      Foundation's lawyer and we believe this is the correct approach.
      
      Essentially, all code in the project is now made available by the LLVM
      project under our new license, so you will see that the license headers
      include that license only. Some of our contributors have contributed
      code under our old license, and accordingly, we have retained a copy of
      our old license notice in the top-level files in each project and
      repository.
      
      llvm-svn: 351636
      2946cd70
  23. Jan 03, 2019
  24. Nov 19, 2018
  25. Nov 13, 2018
  26. Oct 18, 2018
  27. Oct 17, 2018
  28. Oct 16, 2018
    • Lang Hames's avatar
      [ORC] Rename ORC layers to make the "new" ORC layers the default. · 079df9ab
      Lang Hames authored
      This commit adds a 'Legacy' prefix to old ORC layers and utilities, and removes
      the '2' suffix from the new ORC layers. If you wish to continue using the old
      ORC layers you will need to add a 'Legacy' prefix to your classes. If you were
      already using the new ORC layers you will need to drop the '2' suffix.
      
      The legacy layers will remain in-tree until the new layers reach feature
      parity with them. This will involve adding support for removing code from the
      new layers, and ensuring that performance is comperable.
      
      llvm-svn: 344572
      079df9ab
  29. Sep 26, 2018
  30. May 30, 2018
    • Lang Hames's avatar
      [ORC] Update JITCompileCallbackManager to support multi-threaded code. · bd0cb787
      Lang Hames authored
      Previously JITCompileCallbackManager only supported single threaded code. This
      patch embeds a VSO (see include/llvm/ExecutionEngine/Orc/Core.h) in the callback
      manager. The VSO ensures that the compile callback is only executed once and that
      the resulting address cached for use by subsequent re-entries.
      
      llvm-svn: 333490
      bd0cb787
  31. May 29, 2018
  32. May 22, 2018
  33. May 17, 2018
    • Lang Hames's avatar
      [ORC] Rewrite the VSO symbol table yet again. Update related utilities. · d261e125
      Lang Hames authored
      VSOs now track dependencies for materializing symbols. Each symbol must have its
      dependencies registered with the VSO prior to finalization. Usually this will
      involve registering the dependencies returned in
      AsynchronousSymbolQuery::ResolutionResults for queries made while linking the
      symbols being materialized.
      
      Queries against symbols are notified that a symbol is ready once it and all of
      its transitive dependencies are finalized, allowing compilation work to be
      broken up and moved between threads without queries returning until their
      symbols fully safe to access / execute.
      
      Related utilities (VSO, MaterializationUnit, MaterializationResponsibility) are
      updated to support dependence tracking and more explicitly track responsibility
      for symbols from the point of definition until they are finalized.
      
      llvm-svn: 332541
      d261e125
Loading