summaryrefslogtreecommitdiffstats
path: root/mlir
Commit message (Collapse)AuthorAgeFilesLines
...
* [mlir][spirv] Add basic definitions for supporting availabilityLei Zhang2019-12-2715-23/+728
| | | | | | | | | | | | | | | | | | | | | | | | SPIR-V has a few mechanisms to control op availability: version, extension, and capabilities. These mechanisms are considered as different availability classes. This commit introduces basic definitions for modelling SPIR-V availability classes. Specifically, an `Availability` class is added to SPIRVBase.td, along with two subclasses: MinVersion and MaxVersion for versioning. SPV_Op is extended to take a list of `Availability`. Each `Availability` instance carries information for generating op interfaces for the corresponding availability class and also the concrete availability requirements. With the availability spec on ops, we can now auto-generate the op interfaces of all SPIR-V availability classes and also synthesize the op's implementations of these interfaces. The interface generation is done via new TableGen backends -gen-avail-interface-{decls|defs}. The op's implementation is done via -gen-spirv-avail-impls. Differential Revision: https://reviews.llvm.org/D71930
* [mlir][spirv] Update docs regarding how to define new ops and typesLei Zhang2019-12-271-2/+48
| | | | | | | This commit expands on the steps of defining a new SPIR-V op and also provides pointers on how to define a new SPIR-V specific type. Differential Revision: https://reviews.llvm.org/D71928
* [mlir] Convert std.and/std.or ops to spv.LogicalAnd/spv.LogicalOrMaheshRavishankar2019-12-272-7/+49
| | | | | | | | | The conversion from std.and/std.or to spv.LogicalAnd/spv.LogicalOr is only valid for boolean (i1) types. Modify BinaryOpPattern in StandardToSPIRV.td to allow limiting the type of the operands for which the pattern is applied. Differential Revision: https://reviews.llvm.org/D71881
* [MLIR][spirv] Fix links in docs after repo migrationLei Zhang2019-12-271-14/+15
| | | | | | | | | | | | | | | | Summary: This commit updates links to SPIR-V dialect code to LLVM monorepo on GitHub. It also points to the operation doc on mlir.llvm.org. Reviewers: mravishankar, denis13, ftynse Reviewed By: ftynse Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71926
* [mlir] fix typo in a commentwyzhao2019-12-271-1/+1
| | | | | Trivial patch, reviewed and accepted on https://github.com/tensorflow/mlir/pull/336 before MLIR merge.
* [MLIR] [NFC] fix unused var warningUday Bondhugula2019-12-271-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: Fix this warning: ` [69/106] Building CXX object tools/mlir/lib/Dialect/StandardOps/CMakeFiles/MLIRStandardOps.dir/Ops.cpp.o /home/uday/llvm-project/mlir/lib/Dialect/StandardOps/Ops.cpp: In member function ‘virtual mlir::PatternMatchResult {anonymous}::ViewOpShapeFolder::matchAndRewrite(mlir::ViewOp, mlir::PatternRewriter&) const’: /home/uday/llvm-project/mlir/lib/Dialect/StandardOps/Ops.cpp:2575:14: warning: variable ‘dynamicOffsetOperandCount’ set but not used [-Wunused-but-set-variable] 2575 | unsigned dynamicOffsetOperandCount = 0; ` Reviewers: rriddle, mehdi_amini, ftynse Reviewed By: ftynse Subscribers: jpienaar, burmako, shauheen, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71922
* [mlir] Floating constants for import-llvmAlex Zinenko2019-12-272-0/+35
| | | | | | | | | | | | | | | | | | | | | Summary: `mlir-translate -import-llvm test.ll` was going into segmentation fault if `test.ll` had `float` or `double` constants. For example, ``` %3 = fadd double 3.030000e+01, %0 ``` Now, it is handled in `Importer::getConstantAsAttr` (similar behaviour as normal integers) Added tests for FP arithmetic Reviewers: ftynse, mehdi_amini Reviewed By: ftynse, mehdi_amini Subscribers: shauheen, mehdi_amini, rriddle, jpienaar, burmako, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71912
* Add an __attribute__((unused)) to populateWithGenerated since it mightEric Christopher2019-12-261-1/+2
| | | | not be used where defined and is autogenerated.
* Fix a -Wcovered-switch-default warning by moving the unreachable out of theEric Christopher2019-12-261-2/+1
| | | | covered switch.
* Remove an unused static function.Eric Christopher2019-12-261-15/+0
|
* Fix a -Wcovered-switch-default warning by moving the unreachable out of theEric Christopher2019-12-261-2/+1
| | | | covered switch.
* Remove unused static function.Eric Christopher2019-12-261-15/+0
|
* Add a clang-tidy configuration file for MLIR, it is using camelBack for ↵Mehdi Amini2019-12-261-0/+4
| | | | naming at the moment
* Fix the MLIR Vim syntax file: the keyword group was missingchelxom2019-12-261-3/+3
|
* [MLIR][NFC] Insert const_cast to avoid warningHideto Ueno2019-12-252-2/+3
| | | | | | | | | | Reviewers: rriddle Reviewed By: rriddle Subscribers: mehdi_amini Differential Revision: https://reviews.llvm.org/D71853
* [mlir] Fix -Wunneeded-internal-declarationFangrui Song2019-12-241-1/+1
|
* mlir README.md: Fix the syntaxSylvestre Ledru2019-12-241-1/+1
|
* Add the Apache2 with LLVM exceptions license to MLIRMehdi Amini2019-12-241-0/+234
| | | | It seems that every subproject has a license file instead of having a top-level one.
* Remove static MLIR doc ; they are already on the websiteMehdi Amini2019-12-243-452/+0
|
* NFC: Rename printOptionValue to printValue to fix MSVC build.River Riddle2019-12-231-9/+7
| | | | MSVC has trouble resolving the static 'printOptionValue' from the method on llvm::cl::opt/list. This change renames the static method to avoid this conflict.
* Adjust some MLIR paths and docsMehdi Amini2019-12-2442-466/+2
|
* Remove pybind11-based bindingsMehdi Amini2019-12-233-1743/+0
| | | | | | | | These bindings were added as an experiment, and never had a CMake configuration. We will bring back python bindings after picking carefully our dependency and the kind of layering we expect to expose for these bindings. PiperOrigin-RevId: 286963717
* Refactor the way that pass options are specified.River Riddle2019-12-2310-177/+369
| | | | | | | | | This change refactors pass options to be more similar to how statistics are modeled. More specifically, the options are specified directly on the pass instead of in a separate options class. (Note that the behavior and specification for pass pipelines remains the same.) This brings about several benefits: * The specification of options is much simpler * The round-trip format of a pass can be generated automatically * This gives a somewhat deeper integration with "configuring" a pass, which we could potentially expose to users in the future. PiperOrigin-RevId: 286953824
* NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.River Riddle2019-12-23192-2271/+2160
| | | | | | ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
* Change the `notifyRootUpdated` API to be transaction based.River Riddle2019-12-2310-87/+199
| | | | | | This means that in-place, or root, updates need to use explicit calls to `startRootUpdate`, `finalizeRootUpdate`, and `cancelRootUpdate`. The major benefit of this change is that it enables in-place updates in DialectConversion, which simplifies the FuncOp pattern for example. The major downside to this is that the cases that *may* modify an operation in-place will need an explicit cancel on the failure branches(assuming that they started an update before attempting the transformation). PiperOrigin-RevId: 286933674
* Update SPIR-V.mdLei Zhang2019-12-232-65/+612
| | | | | | | | | This CL updates SPIR-V.md to reflect recent developments in the SPIR-V dialect and its conversions. Along the way, also updates the doc for define_inst.sh. PiperOrigin-RevId: 286933546
* Resubmit: ReImplement the Value classes as value-typed objects wrapping an ↵River Riddle2019-12-2330-160/+370
| | | | | | | | internal pointer storage. This will enable future commits to reimplement the internal implementation of OpResult without needing to change all of the existing users. This is part of a chain of commits optimizing the size of operation results. PiperOrigin-RevId: 286930047
* Automated rollback of commit f603a50109107b447b835dac11f0eb541288393eMLIR Team2019-12-2330-370/+160
| | | | PiperOrigin-RevId: 286924059
* ReImplement the Value classes as value-typed objects wrapping an internal ↵River Riddle2019-12-2330-160/+370
| | | | | | | | pointer storage. This will enable future commits to reimplement the internal implementation of OpResult without needing to change all of the existing users. This is part of a chain of commits optimizing the size of operation results. PiperOrigin-RevId: 286919966
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-23593-7723/+2464
| | | | PiperOrigin-RevId: 286906740
* NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to ↵River Riddle2019-12-22201-2413/+2493
| | | | | | | | | | Value being value-typed. This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics. PiperOrigin-RevId: 286844725
* Add integer bit-shift operations to the standard dialect.Manuel Freiberger2019-12-2223-174/+294
| | | | | | | | | | | | | | | | | | | Rename the 'shlis' operation in the standard dialect to 'shift_left'. Add tests for this operation (these have been missing so far) and add a lowering to the 'shl' operation in the LLVM dialect. Add also 'shift_right_signed' (lowered to LLVM's 'ashr') and 'shift_right_unsigned' (lowered to 'lshr'). The original plan was to name these operations 'shift.left', 'shift.right.signed' and 'shift.right.unsigned'. This works if the operations are prefixed with 'std.' in MLIR assembly. Unfortunately during import the short form is ambigous with operations from a hypothetical 'shift' dialect. The best solution seems to omit dots in standard operations for now. Closes tensorflow/mlir#226 PiperOrigin-RevId: 286803388
* Make Type and Attribute classes trivially copyableAlex Zinenko2019-12-212-10/+4
| | | | | | | | | | This requires using explicitly default copy constructor and copy assignment operator instead of hand-rolled ones. These classes are indeed cheap to copy since they are wrappers around a pointer to the implementation. This change makes sure templated code can use standard type traits to understand that copying such objects is cheap and appeases analysis tools such as clang-tidy. PiperOrigin-RevId: 286725565
* NFC: Move the classes related to Pass options into a new header file ↵River Riddle2019-12-202-67/+98
| | | | | | | | PassOptions.h This will make refactoring and adding additional features to the pass options infrastructure simpler in followup commits. PiperOrigin-RevId: 286687564
* [VectorOps] unify vector dialect "subscripts"Aart Bik2019-12-208-95/+95
| | | | PiperOrigin-RevId: 286650682
* [VectorOps] remove redundant returns from invalid ops testAart Bik2019-12-201-27/+0
| | | | PiperOrigin-RevId: 286640660
* fix isValidDim for block arg caseUday Bondhugula2019-12-203-11/+23
| | | | | | | | | | | | | - a block argument associated with an arbitrary op can't be a valid dimensional identifier; it has to be the block argument of either a function op or an affine.for. Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#331 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/331 from bondhugula:valid_dim 3273b4fcbaa31fb7b6671d93c9e42a6b2a6a4e4c PiperOrigin-RevId: 286593693
* Add gpu.shuffle op.Christian Sigg2019-12-208-2/+213
| | | | | | | | This will allow us to lower most of gpu.all_reduce (when all_reduce doesn't exist in the target dialect) within the GPU dialect, and only do target-specific lowering for the shuffle op. PiperOrigin-RevId: 286548256
* Allow dialect to create friendly names for region argumentsFrank Laub2019-12-194-0/+46
| | | | | | | | | This is the block argument equivalent of the existing `getAsmResultNames` hook. Closes tensorflow/mlir#329 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/329 from plaidml:flaub-region-arg-names fc7876f2d1335024e441083cd25263fd6247eb7d PiperOrigin-RevId: 286523299
* Unique trait list during ODS Operator trait constructionJacques Pienaar2019-12-193-7/+17
| | | | | | Concatting lists in TableGen is easy, creating unique lists less so. There is no reason for duplicated op traits so we could throw an error instead but duplicates could occur due to concatting different list of traits in ODS (e.g., for convenience reasons), so just dedup them during Operator trait construction instead. PiperOrigin-RevId: 286488423
* [VectorOps] Update vector transfer_read/write ops to operatate on memrefs ↵Andy Davis2019-12-194-47/+161
| | | | | | | | | with vector element type. Update vector transfer_read/write ops to operatate on memrefs with vector element type. This handle cases where the memref vector element type represents the minimal memory transfer unit (or multiple of the minimal memory transfer unit). PiperOrigin-RevId: 286482115
* Restructure and update Linalg ODS and documentation - NFCNicolas Vasilache2019-12-1920-38/+703
| | | | | | | | This CL allows specifying an additional name for specifying the .td file that is used to generate the doc for a dialect. This is necessary for a dialect like Linalg which has different "types" of ops that are used in different contexts. This CL also restructures the Linalg documentation and renames LinalgLibraryOps -> LinalgStructuredOps but is otherwise NFC. PiperOrigin-RevId: 286450414
* [VectorOps] Add vector ReshapeOp to the VectorOps dialect.Andy Davis2019-12-194-0/+311
| | | | | | Adds vector ReshapeOp to the VectorOps dialect. An aggregate vector reshape operation, which aggregates multiple hardware vectors, can enable optimizations during decomposition (e.g. loading one input hardware vector and performing multiple rotate and scatter store operations to the vector output). PiperOrigin-RevId: 286440658
* LLVMFuncOp: implement addEntryBlockAlex Zinenko2019-12-191-1/+15
| | | | | | | | | This function has been declared as a part of the LLVMFuncOp interface but never implemented. Closes tensorflow/mlir#325. PiperOrigin-RevId: 286439619
* [VectorOps] minor cleanup: vector dialect "subscripts" are i32Aart Bik2019-12-196-25/+41
| | | | | | | | Introduces some centralized methods to move towards consistent use of i32 as vector subscripts. Note: sizes/strides/offsets attributes are still i64 PiperOrigin-RevId: 286434133
* Detemplatize ModuleTranslation::lookupValuesAlex Zinenko2019-12-192-10/+12
| | | | | | | | | This function template has been introduced in the early days of MLIR to work around the absence of common type for ranges of values (operands, block argumeents, vectors, etc). Core IR now provides ValueRange for exactly this purpose. Use it instead of the template parameter. PiperOrigin-RevId: 286431338
* Add runtime utils support for print_memref_i8Nicolas Vasilache2019-12-183-15/+50
| | | | | | This CL adds print_memref_i8 along with a unit test. PiperOrigin-RevId: 286299237
* [VectorOps] Replace iostream with stdio in support lib for vector.printAart Bik2019-12-181-6/+8
| | | | PiperOrigin-RevId: 286252829
* Add a couple useful LLVM_DEBUG's to the inliner.Sean Silva2019-12-182-1/+14
| | | | | | This makes it easier to narrow down on ops that are preventing inlining. PiperOrigin-RevId: 286243868
* Move the specializations of VectorTransferRewriter::matchAndRewrite back ↵River Riddle2019-12-181-80/+80
| | | | | | | | into the anonymous namespace. This appeases the GCC bug related to specializations in a different namespace. PiperOrigin-RevId: 286234667
OpenPOWER on IntegriCloud