Skip to content

Upgrade to ORCv2 #1468

@lum1n0us

Description

@lum1n0us

WAMR was used to implement an eager compilation with MCJIT and a lazy compilation with ORCJIT. It leads to a unfriendly maintain case. ORCv2 gives us a good opportunity to improve that.

Here are modifications:

  • Use LLJIT to implement an eager compilation. It will perform on symbol LLVMOrcLLJITLookup. LLJIT compiles all functions in the target LLVMModuleRef.
  • Use LLLazyJIT to implement a lazy compilation. There is a CompileOnDemandLayer allowing LLLazyJIT compiling a function only when actually calling it.
  • Lazy call through provides a function stubs for every function. LLVMOrcLLLazyJITLookup will return the stub. It means once aot_loader fills the func_ptrs with results of LLVMORCXXXJITLookup, there is no necessary to assume meeting a NULL function pointer when dealing with call and call_indirect.
  • Since lib/ExecutionEngine/Orc/OrcV2CBindings.cpp only including LLJIT staff, need to create binds for LLLazyJIT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementCheck if this issue/PR enhances a feature; scripts will use this info.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions