summaryrefslogtreecommitdiffstats
path: root/mlir/test/mlir-cpu-runner
Commit message (Collapse)AuthorAgeFilesLines
...
* Pipe Linalg to LLVM via mlir-cpu-runnerNicolas Vasilache2019-05-101-0/+58
| | | | | | | | | | | This CL adds support for functions in the Linalg dialect to run with mlir-cpu-runner. For this purpose, this CL adds BufferAllocOp, BufferDeallocOp, LoadOp and StoreOp to the Linalg dialect as well as their lowering to LLVM. To avoid collisions with mlir::LoadOp/StoreOp (which should really become mlir::affine::LoadOp/StoreOp), the mlir::linalg namespace is added. The execution uses a dummy linalg_dot function that just returns for now. In the future a proper library call will be used. -- PiperOrigin-RevId: 247476061
* Remove global LLVM CLI variables from library codeDimitrios Vytiniotis2019-03-291-2/+3
| | | | | | Plus move parsing code into the MLIR CPU runner binary. PiperOrigin-RevId: 240786709
* ExecutionEngine OptUtils: support -On flags in string-based initializationAlex Zinenko2019-03-291-2/+2
| | | | | | | | | | | | | | Original implementation of OutUtils provided two different LLVM IR module transformers to be used with the MLIR ExecutionEngine: OptimizingTransformer parameterized by the optimization levels (similar to -O3 flags) and LLVMPassesTransformer parameterized by the string formatted similarly to command line options of LLVM's "opt" tool without support for -O* flags. Introduce such support by declaring the flags inside the parser and by populating the pass managers similarly to what "opt" does. Remove the additional flags from mlir-cpu-runner as they can now be wrapped into `-llvm-opts` together with other LLVM-related flags. PiperOrigin-RevId: 236107292
* ExecutionEngine: provide utils for running CLI-configured LLVM passesAlex Zinenko2019-03-291-1/+3
| | | | | | | | | | | | | | | | | | | A recent change introduced a possibility to run LLVM IR transformation during JIT-compilation in the ExecutionEngine. Provide helper functions that construct IR transformers given either clang-style optimization levels or a list passes to run. The latter wraps the LLVM command line option parser to parse strings rather than actual command line arguments. As a result, we can run either of mlir-cpu-runner -O3 input.mlir mlir-cpu-runner -some-mlir-pass -llvm-opts="-llvm-pass -other-llvm-pass" to combine different transformations. The transformer builder functions are provided as a separate library that depends on LLVM pass libraries unlike the main execution engine library. The library can be used for integrating MLIR execution engine into external frameworks. PiperOrigin-RevId: 234173493
* Simple CPU runnerAlex Zinenko2019-03-291-0/+30
This implements a simple CPU runner based on LLVM Orc JIT. The base functionality is provided by the ExecutionEngine class that compiles and links the module, and provides an interface for obtaining function pointers to the JIT-compiled MLIR functions and for invoking those functions directly. Since function pointers need to be casted to the correct pointer type, the ExecutionEngine wraps LLVM IR functions obtained from MLIR into a helper function with the common signature `void (void **)` where the single argument is interpreted as a list of pointers to the actual arguments passed to the function, eventually followed by a pointer to the result of the function. Additionally, the ExecutionEngine is set up to resolve library functions to those available in the current process, enabling support for, e.g., simple C library calls. For integration purposes, this also provides a simplistic runtime for memref descriptors as expected by the LLVM IR code produced by MLIR translation. In particular, memrefs are transformed into LLVM structs (can be mapped to C structs) with a pointer to the data, followed by dynamic sizes. This implementation only supports statically-shaped memrefs of type float, but can be extened if necessary. Provide a binary for the runner and a test that exercises it. PiperOrigin-RevId: 230876363
OpenPOWER on IntegriCloud