Backend
backend
LLVMRawJITFunc
dataclass
Bases: RawJITFunc
:class:RawJITFunc that retains LLVM MCJIT runtime objects.
The engine and related objects must remain referenced for as long as
c_func may be called.
Source code in xdsl/jit/llvm/backend.py
25 26 27 28 29 30 31 32 33 34 35 36 37 | |
target: Target
instance-attribute
target_machine: TargetMachine
instance-attribute
backing_mod: ModuleRef
instance-attribute
engine: ExecutionEngine
instance-attribute
__init__(c_func_type: CFuncSignature, c_func: CFunc, target: Target, target_machine: TargetMachine, backing_mod: ModuleRef, engine: ExecutionEngine) -> None
LLVMJITBackend
Bases: JITBackend
:class:JITBackend using xDSL's LLVM converter and llvmlite MCJIT.
Runs :attr:lowering, requires symbol to name an llvm.FuncOp, then
converts the module and exposes the entry point through CFFI ABI mode.
Source code in xdsl/jit/llvm/backend.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
lowering: tuple[ModulePass, ...] = lowering
instance-attribute
Pass pipeline applied before resolving symbol.
__init__(lowering: tuple[ModulePass, ...] = (MLIROptPass(arguments=('--convert-arith-to-llvm', '--convert-func-to-llvm'), generic=True),))
Construct the backend with the given lowering pipeline.
Source code in xdsl/jit/llvm/backend.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
jit(mlir_module: builtin.ModuleOp, symbol: str, ir_context: Context) -> RawJITFunc
Lower mlir_module, bind symbol, and return an :class:LLVMRawJITFunc.
Source code in xdsl/jit/llvm/backend.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |