Ignore:
Timestamp:
Mar 18, 2018, 9:49:56 PM (14 months ago)
Author:
cameron
Message:

ORCJIT for LLVM 3.9/4.0 initial check-in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain/cpudriver.h

    r5913 r5915  
    22#define CPUDRIVER_H
    33#include "driver.h"
    4 #include <llvm/IR/LegacyPassManager.h>             // for PassManager
    5 
     4#include <toolchain/toolchain.h>
    65namespace llvm { class ExecutionEngine; }
    76namespace llvm { class TargetMachine; }
    87namespace llvm { class raw_fd_ostream; }
     8
     9#include <llvm/IR/LegacyPassManager.h>
     10#if LLVM_VERSION_INTEGER >= LLVM_VERSION_CODE(3, 9, 0)
     11#define ORCJIT
     12#endif
     13#ifdef ORCJIT
     14#include <llvm/ExecutionEngine/Orc/CompileUtils.h>
     15#include <llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h>
     16#include <llvm/ExecutionEngine/Orc/IRCompileLayer.h>
     17#include <llvm/ExecutionEngine/Orc/IRTransformLayer.h>
     18typedef llvm::orc::IRCompileLayer<llvm::orc::ObjectLinkingLayer<>> CompileLayerT;
     19using OptimizeFnT = std::function<std::unique_ptr<llvm::Module>(std::unique_ptr<llvm::Module>)>;
     20typedef llvm::orc::IRTransformLayer<CompileLayerT, OptimizeFnT> OptimizeLayerT;
     21
     22#endif
    923
    1024class ParabixObjectCache;
     
    3448    llvm::Function * addLinkFunction(llvm::Module * mod, llvm::StringRef name, llvm::FunctionType * type, void * functionPtr) const override;
    3549
    36 private:
    3750    llvm::TargetMachine *                                   mTarget;
    3851    llvm::legacy::PassManager                               mPassManager;
     52
     53#ifdef ORCJIT
     54    llvm::orc::ObjectLinkingLayer<>  mObjectLayer;
     55    std::unique_ptr<CompileLayerT> mCompileLayer;
     56   
     57    //std::unique_ptr<OptimizeLayerT> mOptimizeLayer;
     58   
     59    //OptimizeLayerT::ModuleSetHandleT addModule(std::unique_ptr<llvm::Module> M);
     60
     61#else
    3962    llvm::ExecutionEngine *                                 mEngine;
     63#endif
    4064    ParabixObjectCache *                                    mCache;
    4165    std::vector<kernel::Kernel *>                           mUncachedKernel;
Note: See TracChangeset for help on using the changeset viewer.