summaryrefslogtreecommitdiffstats
path: root/mlir/tools/mlir-translate
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] Mark the MLIR tools for installation in CMakeKern Handa2020-02-051-1/+1
| | | | | | | | This binplaces `mlir-translate`, `mlir-cuda-runner`, and `mlir-cpu-runner` when building the CMake install target. Differential Revision: https://reviews.llvm.org/D73986 (cherry picked from commit b8004b7308b490b93231789cd05f86294a77d663)
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+4
| | | | PiperOrigin-RevId: 286906740
* Drop unnecessary dependences from mlir-translateUday Bondhugula2019-11-181-6/+0
| | | | | | | Closes tensorflow/mlir#243 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/243 from bondhugula:patch-2 fb682996efde001189414a4c7aa59ce42ace7831 PiperOrigin-RevId: 281167834
* mlir-translate: support -verify-diagnosticsAlex Zinenko2019-11-071-2/+22
| | | | | | | | | | | MLIR translation tools can emit diagnostics and we want to be able to check if it is indeed the case in tests. Reuse the source manager error handlers provided for mlir-opt to support the verification in mlir-translate. This requires us to change the signature of the functions that are registered to translate sources to MLIR: it now takes a source manager instead of a memory buffer. PiperOrigin-RevId: 279132972
* [ROCm] Adding ROCDL Dialect.Deven Desai2019-09-271-0/+1
| | | | | | | | | | | | | This commit introduces the ROCDL Dialect (i.e. the ROCDL ops + the code to lower those ROCDL ops to LLWM intrinsics/functions). Think of ROCDL Dialect as analogous to the NVVM Dialect, but for AMD GPUs. This patch contains just the essentials needed to get a simple example up and running. We expect to make further additions to the ROCDL Dialect. This is the first of 3 commits, the follow-up will be: * add a pass that lowers GPU Dialect to ROCDL Dialect * add a "mlir-rocm-runner" utility Closes tensorflow/mlir#146 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/146 from deven-amd:deven-rocdl-dialect e78e8005c75a78912631116c78dc844fcc4b0de9 PiperOrigin-RevId: 271511259
* Let mlir-translate support -split-input-fileLei Zhang2019-09-231-3/+24
| | | | | | | | Similar to mlir-opt, having a -split-input-file mode is quite useful in mlir-translate. It allows to put logically related tests in the same test file for better organization. PiperOrigin-RevId: 270805467
* Change MLIR translation functions signatureLei Zhang2019-09-171-2/+21
| | | | | | | | | | This CL changes translation functions to take MemoryBuffer as input and raw_ostream as output. It is generally better to avoid handling files directly in a library (unless the library is specifically for file manipulation) and we can unify all file handling to the mlir-translate binary itself. PiperOrigin-RevId: 269625911
* InitLLVM already initializes PrettyStackTraceProgramJacques Pienaar2019-08-181-2/+0
| | | | | | Remove extra PrettyStackTraceProgram and use InitLLVM consistently. PiperOrigin-RevId: 264041205
* Split out TranslateClParser and add new parse method that reuses SourceMgr.Jacques Pienaar2019-06-262-108/+5
| | | | | | | | Split out class to command line parser for translate methods into standalone class. Similar to splitting up mlir-opt to reuse functionality with different initialization. PiperOrigin-RevId: 255225790
* [spirv] Basic serializer and deserializerLei Zhang2019-06-221-0/+2
| | | | | | | | | | | | | | | | This CL adds the basic SPIR-V serializer and deserializer for converting SPIR-V module into the binary format and back. Right now only an empty module with addressing model and memory model is supported; (de)serialize other components will be added gradually with subsequent CLs. The purpose of this library is to enable importing SPIR-V binary modules to run transformations on them and exporting SPIR-V modules to be consumed by execution environments. The focus is transformations, which inevitably means changes to the binary module; so it is not designed to be a general tool for investigating the SPIR-V binary module and does not guarantee roundtrip equivalence (at least for now). PiperOrigin-RevId: 254473019
* Add keywords in target_link_libraries post add_llvm_executable.Jacques Pienaar2019-06-011-1/+1
| | | | | | -- PiperOrigin-RevId: 250704528
* Replace usages of 'add_executable' with 'add_llvm_executable'.River Riddle2019-06-011-1/+1
| | | | | | -- PiperOrigin-RevId: 250691487
* Use SourceMgrDiagnosticHandler in mlir-translate for translations from ↵Jacques Pienaar2019-06-011-50/+59
| | | | | | | | | | MLIR input. Report errors using the file and line location using SourceMgr's diagnostic reporting. Reduce some horizontal white spacing too. -- PiperOrigin-RevId: 250193646
* Reserve the required capacity to avoid pointer invalidations for ↵Smit Hinsu2019-05-061-2/+8
| | | | | | | | translation functions -- PiperOrigin-RevId: 245992152
* Add transformation of the NVVM dialect to an LLVM module. Only handlesStephan Herhut2019-05-062-1/+2
| | | | | | | | the generation of intrinsics out of NVVM index ops for now. -- PiperOrigin-RevId: 245933152
* Update the Function and Module verifiers to return LogicalResult instead ↵River Riddle2019-04-021-1/+1
| | | | | | | | of bool. -- PiperOrigin-RevId: 241553930
* Fix MacOS buildMehdi Amini2019-04-011-1/+1
| | | | | | | | | This is making up for some differences in standard library and linker flags. It also get rid of the requirement to build with RTTI. -- PiperOrigin-RevId: 241348845
* Add build files and update README.Jacques Pienaar2019-03-301-0/+19
| | | | | | | | | * Add initial version of build files; * Update README with instructions to download and build MLIR from github; -- PiperOrigin-RevId: 241102092
* Continue pushing const out of the IR types - removing the notion of a 'constChris Lattner2019-03-291-2/+1
| | | | | | Module'. NFC. PiperOrigin-RevId: 239532885
* Verify IR produced by TranslateToMLIR functionsSmit Hinsu2019-03-291-2/+3
| | | | | | TESTED with existing unit tests PiperOrigin-RevId: 235623059
* Extract openInputFile() into Support/FileUtilitiesLei Zhang2019-03-291-5/+5
| | | | | | | | | | Multiple binaries have the needs to open input files. Use this function to de-duplicate the code. Also changed openOutputFile() to return errors using std::string since it is a library call and accessing I/O in library call is not friendly. PiperOrigin-RevId: 228878221
* Create the Support library.Alex Zinenko2019-03-291-13/+1
| | | | | | | | | This has been a long-standing TODO in the build system. Now that we need to share the non-inlined implementation of file utilities for translators, create a separate library for support functionality. Move Support/* headers to the new library in the build system. PiperOrigin-RevId: 222398880
* Separate translators into "from MLIR" and "to MLIR".Alex Zinenko2019-03-292-66/+41
| | | | | | | | | | | | | | | | | | | | Translations performed by mlir-translate only have MLIR on one end. MLIR-to-MLIR conversions (including dialect changes) should be treated as passes and run by mlir-opt. Individual translations should not care about reading or writing MLIR and should work on in-memory representation of MLIR modules instead. Split the TranslateFunction interface and the translate registry into two parts: "from MLIR" and "to MLIR". Update mlir-translate to handle both registries together by wrapping translation functions into source-to-source convresions. Remove MLIR parsing and writing from individual translations and make them operate on Modules instead. This removes the need for individual translators to include tools/mlir-translate/mlir-translate.h, which can now be safely removed. Remove mlir-to-mlir translation that only existed as a registration example and use mlir-opt instead for tests. PiperOrigin-RevId: 222398707
* Factor out translation registry.Alex Zinenko2019-03-292-39/+26
| | | | | | | | | | | | | | | | | | | | The mlir-translate tool is expected to discover individual translations at link time. These translations must register themselves and may need the utilities that are currently defined in mlir-translate.cpp for their entry point functions. Since mlir-translate is linking against individual translations, the translations cannot link against mlir-translate themselves. Extract out the utilities into a separate "Translation" library to avoid the potential dependency cycle. Individual translations link to that library to access TranslateRegistration. The mlir-translate tool links to individual translations and to the "Translation" library because it needs the utilities as well. The main header of the new library is located in include/mlir/Translation.h to make it easily accessible by translators. The rationale for putting it to include/mlir rather than to one of its subdirectories is that its purpose is similar to that of include/mlir/Pass.h so it makes sense to put them at the same level. PiperOrigin-RevId: 222398617
* Add MLIR (addf) -> MLIR HLO thin slice.Jacques Pienaar2019-03-291-3/+0
| | | | | | Super thin slice that can convert a MLIR program (with addfs) to MLIR HLO dialect. Add this as translations to mlir-translate. Also add hlo::AddOp op and HLO op registration. PiperOrigin-RevId: 214480409
* Add op registry for registering MLIR ops.Jacques Pienaar2019-03-291-3/+0
| | | | | | Instead of linking in different initializeMLIRContext functions, add a registry mechanism and function to initialize all registered ops in a given MLIRContext. Initialize all registered ops along with the StandardOps when constructing a MLIRContext. PiperOrigin-RevId: 214073842
* Switch from positional argument to explicit flags for mlir-translateJacques Pienaar2019-03-292-45/+43
| | | | | | This results in uniform behavior with mlir-opt. Exactly one transformation is allowed. PiperOrigin-RevId: 213493415
* Tool for translating from/to MLIR.Jacques Pienaar2019-03-292-0/+198
mlir-translate is a tool to translate from/to MLIR. The translations are registered at link time and intended for use in tests. An identity transformation (mlir-to-mlir) is registered by default as example and used in the parser test where simply parsing & printing required. The TranslateFunctions take filenames (instead of MemoryBuffer) to allow translations special write behavior (e.g., writing to uncommon filesystems). PiperOrigin-RevId: 213370448
OpenPOWER on IntegriCloud