Skip to content
  1. Sep 11, 2018
  2. Sep 06, 2018
    • Lang Hames's avatar
      [ORC] Make RuntimeDyldObjectLinkingLayer2 take memory managers by unique_ptr. · bf985258
      Lang Hames authored
      The existing memory manager API can not be shared between objects when linking
      concurrently (since there is no way to know which concurrent allocations were
      performed on behalf of which object, and hence which allocations would be safe
      to finalize when finalizeMemory is called). For now, we can work around this by
      requiring a new memory manager for each object.
      
      This change only affects the concurrent version of the ORC APIs.
      
      llvm-svn: 341579
      bf985258
    • Lang Hames's avatar
      [ORC] Remove the mapSectionAddress method from RuntimeDyldObjectLinkingLayer2. · a5f33c86
      Lang Hames authored
      Section address mappings can be applied using the RuntimeDyld instance passed to
      the RuntimeDyld::MemoryManager::notifyObjectLoaded method. Proving an alternate
      route via RuntimeDyldObjectLinkingLayer2 is redundant.
      
      llvm-svn: 341578
      a5f33c86
  3. Sep 02, 2018
  4. Aug 31, 2018
    • Lang Hames's avatar
      [ORC] Add utilities to RTDyldObjectLinkingLayer2 to simplify symbol flag · 6d32002e
      Lang Hames authored
      management and materialization responsibility registration.
      
      The setOverrideObjectFlagsWithResponsibilityFlags method instructs
      RTDyldObjectlinkingLayer2 to override the symbol flags produced by RuntimeDyld with
      the flags provided by the MaterializationResponsibility instance. This can be used
      to enable symbol visibility (hidden/exported) for COFF object files, which do not
      currently support the SF_Exported flag.
      
      The setAutoClaimResponsibilityForObjectSymbols method instructs
      RTDyldObjectLinkingLayer2 to claim responsibility for any symbols provided by a
      given object file that were not already in the MaterializationResponsibility
      instance. Setting this flag allows higher-level program representations (e.g.
      LLVM IR) to be added based on only a subset of the symbols they provide, without
      having to write intervening layers to scan and add the additional symbols. This
      trades diagnostic quality for convenience however: If all symbols are enumerated
      up-front then clashes can be detected and reported early. If this option is set,
      clashes for the additional symbols may not be detected until late, and detection
      may depend on the flow of control through JIT'd code.
      
      llvm-svn: 341154
      6d32002e
  5. Aug 28, 2018
    • Lang Hames's avatar
      [ORC] Replace lookupFlags in JITSymbolResolver with getResponsibilitySet. · 6cadc7c0
      Lang Hames authored
      The new method name/behavior more closely models the way it was being used.
      It also fixes an assertion that can occur when using the new ORC Core APIs,
      where flags alone don't necessarily provide enough context to decide whether
      the caller is responsible for materializing a given symbol (which was always
      the reason this API existed).
      
      The default implementation of getResponsibilitySet uses lookupFlags to determine
      responsibility as before, so existing JITSymbolResolvers should continue to
      work.
      
      llvm-svn: 340874
      6cadc7c0
    • Lang Hames's avatar
      [ORC] Add an addObjectFile method to LLJIT. · 37a66413
      Lang Hames authored
      The addObjectFile method adds the given object file to the JIT session, making
      its code available for execution.
      
      Support for the -extra-object flag is added to lli when operating in
      -jit-kind=orc-lazy mode to support testing of this feature.
      
      llvm-svn: 340870
      37a66413
  6. Aug 26, 2018
    • Lang Hames's avatar
      [ORC] Do not include non-global symbols in getObjectSymbolFlags. · 60511582
      Lang Hames authored
      Private symbols are not visible outside the object file, and so not defined by
      the object file from ORC's perspective.
      
      No test case yet. Ideally this would be a unit test parsing a checked-in binary,
      but I am not aware of any way to reference the LLVM source root from a unit
      test.
      
      llvm-svn: 340703
      60511582
  7. Aug 18, 2018
    • Lang Hames's avatar
      [ORC] Rename 'finalize' to 'emit' to avoid potential confusion. · 76e21c97
      Lang Hames authored
      An emitted symbol has had its contents written and its memory protections
      applied, but it is not automatically ready to execute.
      
      Prior to ORC supporting concurrent compilation, the term "finalized" could be
      interpreted two different (but effectively equivalent) ways: (1) The finalized
      symbol's contents have been written and its memory protections applied, and (2)
      the symbol is ready to run. Now that ORC supports concurrent compilation, sense
      (1) no longer implies sense (2). We have already introduced a new term, 'ready',
      to capture sense (2), so rename sense (1) to 'emitted' to avoid any lingering
      confusion.
      
      llvm-svn: 340115
      76e21c97
  8. Aug 17, 2018
    • Lang Hames's avatar
      [ORC] Rename VSO to JITDylib. · d5f56c59
      Lang Hames authored
      VSO was a little close to VDSO (an acronym on Linux for Virtual Dynamic Shared
      Object) for comfort. It also risks giving the impression that instances of this
      class could be shared between ExecutionSessions, which they can not.
      
      JITDylib seems moderately less confusing, while still hinting at how this
      class is intended to be used, i.e. as a JIT-compiled stand-in for a dynamic
      library (code that would have been a dynamic library if you had wanted to
      compile it ahead of time).
      
      llvm-svn: 340084
      d5f56c59
  9. Aug 06, 2018
  10. Aug 02, 2018
    • Lang Hames's avatar
      [ORC] Add a re-exports fallback definition generator. · be1066de
      Lang Hames authored
      An instance of ReexportsFallbackDefinitionGenerator can be attached to a VSO
      (via setFallbackDefinitionGenerator) to re-export symbols on demandy from a
      backing VSO.
      
      llvm-svn: 338764
      be1066de
    • Lang Hames's avatar
      [ORC] Add a 'Callable' flag to JITSymbolFlags. · bfea8cdc
      Lang Hames authored
      The callable flag can be used to indicate that a symbol is callable. If present,
      the symbol is callable. If absent, the symbol may or may not be callable (the
      client must determine this by context, for example by examining the program
      representation that will provide the symbol definition).
      
      This flag will be used in the near future to enable creation of lazy compilation
      stubs based on SymbolFlagsMap instances only (without having to provide
      additional information to determine which symbols need stubs).
      
      llvm-svn: 338649
      bfea8cdc
  11. Jul 21, 2018
  12. Jul 20, 2018
    • Reid Kleckner's avatar
      Revert r337595 "[ORC] Add new symbol lookup methods to ExecutionSessionBase in preparation for" · 7ed83591
      Reid Kleckner authored
      Breaks the build with LLVM_ENABLE_THREADS=OFF.
      
      llvm-svn: 337608
      7ed83591
    • Lang Hames's avatar
      [ORC] Add new symbol lookup methods to ExecutionSessionBase in preparation for · 732d116a
      Lang Hames authored
      deprecating SymbolResolver and AsynchronousSymbolQuery.
      
      Both lookup overloads take a VSO search order to perform the lookup. The first
      overload is non-blocking and takes OnResolved and OnReady callbacks. The second
      is blocking, takes a boolean flag to indicate whether to wait until all symbols
      are ready, and returns a SymbolMap. Both overloads take a RegisterDependencies
      function to register symbol dependencies (if any) on the query.
      
      llvm-svn: 337595
      732d116a
    • Lang Hames's avatar
      [ORC] Simplify VSO::lookupFlags to return the flags map. · d4df0f17
      Lang Hames authored
      This discards the unresolved symbols set and returns the flags map directly
      (rather than mutating it via the first argument).
      
      The unresolved symbols result made it easy to chain lookupFlags calls, but such
      chaining should be rare to non-existant (especially now that symbol resolvers
      are being deprecated) so the simpler method signature is preferable.
      
      llvm-svn: 337594
      d4df0f17
    • Lang Hames's avatar
      [ORC] Replace SymbolResolvers in the new ORC layers with search orders on VSOs. · fd0c1e71
      Lang Hames authored
      A search order is a list of VSOs to be searched linearly to find symbols. Each
      VSO now has a search order that will be used when fixing up definitions in that
      VSO. Each VSO's search order defaults to just that VSO itself.
      
      This is a first step towards removing symbol resolvers from ORC altogether. In
      practice symbol resolvers tended to be used to implement a search order anyway,
      sometimes with additional programatic generation of symbols. Now that VSOs
      support programmatic generation of definitions via fallback generators, search
      orders provide a cleaner way to achieve the desired effect (while removing a lot
      of boilerplate).
      
      llvm-svn: 337593
      fd0c1e71
  13. Jul 12, 2018
  14. Jul 11, 2018
  15. Jul 09, 2018
    • Lang Hames's avatar
      [ORC] Rename MaterializationResponsibility::delegate to replace and add a new · f07dad3d
      Lang Hames authored
      delegate method (and unit test).
      
      The name 'replace' better captures what the old delegate method did: it
      returned materialization responsibility for a set of symbols to the VSO.
      
      The new delegate method delegates responsibility for a set of symbols to a new
      MaterializationResponsibility instance. This can be used to split responsibility
      between multiple threads, or multiple materialization methods.
      
      llvm-svn: 336603
      f07dad3d
  16. Jul 05, 2018
  17. Jul 03, 2018
  18. Jun 27, 2018
  19. Jun 26, 2018
  20. Jun 23, 2018
  21. Jun 18, 2018
    • Lang Hames's avatar
      [ORC] Add an initial implementation of a replacement CompileOnDemandLayer. · 68c9b8d6
      Lang Hames authored
      CompileOnDemandLayer2 is a replacement for CompileOnDemandLayer built on the ORC
      Core APIs. Functions in added modules are extracted and compiled lazily.
      CompileOnDemandLayer2 supports multithreaded JIT'd code, and compilation on
      multiple threads.
      
      llvm-svn: 334967
      68c9b8d6
    • Lang Hames's avatar
      [ORC] Keep weak flag on VSO symbol tables during materialization, but treat · 2e96114c
      Lang Hames authored
      materializing weak symbols as strong.
      
      This removes some elaborate flag tweaking and plays nicer with RuntimeDyld,
      which relies of weak/common flags to determine whether it should emit a given
      weak definition. (Switching to strong up-front makes it appear as if there is
      already an overriding definition, which would require an extra back-channel to
      override).
      
      llvm-svn: 334966
      2e96114c
Loading