summaryrefslogtreecommitdiffstats
path: root/mlir
Commit message (Collapse)AuthorAgeFilesLines
...
* Standardize and refactor Attribute type printing.River Riddle2019-06-269-113/+116
| | | | | | Remove the ability to print an attribute without a type, but allow for attributes to elide the type under certain circumstances. This fixes a bug where attributes within ArrayAttr, and other collection attributes, would never print the type. PiperOrigin-RevId: 255306974
* Split out TranslateClParser and add new parse method that reuses SourceMgr.Jacques Pienaar2019-06-267-112/+194
| | | | | | | | 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
* Add a pass that inserts getters for all cubins found via nvvm.cubinStephan Herhut2019-06-264-0/+182
| | | | | | | | | annotations. Getters are required as there are currently no global constants in MLIR and this is an easy way to unblock CUDA execution while waiting for those. PiperOrigin-RevId: 255169002
* Make GPU to CUDA transformations independent of CUDA runtime.Stephan Herhut2019-06-269-117/+133
| | | | | | | | | | | The actual transformation from PTX source to a CUDA binary is now factored out, enabling compiling and testing the transformations independently of a CUDA runtime. MLIR has still to be built with NVPTX target support for the conversions to be built and tested. PiperOrigin-RevId: 255167139
* Move the emitError/Warning/Remark utility methods out of MLIRContext and ↵River Riddle2019-06-2544-350/+262
| | | | | | | | into the mlir namespace. Now that Locations are attributes, they have direct access to the MLIR context. This allows for simplifying error emission by removing unnecessary context lookups. PiperOrigin-RevId: 255112791
* Change the attribute dictionary syntax to separate name and value with '='.River Riddle2019-06-2564-724/+724
| | | | | | | | | | | The current syntax separates the name and value with ':', but ':' is already overloaded by several other things(e.g. trailing types). This makes the syntax difficult to parse in some situtations: Old: "foo: 10 : i32" New: "foo = 10 : i32" PiperOrigin-RevId: 255097928
* NFC: Uniformize the return of the LocationAttr 'get' methods to 'Location'.River Riddle2019-06-2512-40/+39
| | | | PiperOrigin-RevId: 255078768
* Modify the syntax of the the ElementsAttrs to print the type as a colon type.River Riddle2019-06-2537-534/+682
| | | | | | | | | This is the standard syntax for types on operations, and is also already used by IntegerAttr and FloatAttr. Example: dense<5> : tensor<i32> dense<[3]> : tensor<1xi32> PiperOrigin-RevId: 255069157
* Fix typo in Toy tutorial documentationRasmus Munk Larsen2019-06-251-3/+3
| | | | PiperOrigin-RevId: 255054639
* Fix unclear sentence.Rasmus Munk Larsen2019-06-251-2/+2
| | | | PiperOrigin-RevId: 255022564
* Move the IndexedAccessorIterator to STLExtras to allow for reuse.River Riddle2019-06-256-72/+60
| | | | | | This iterator is useful for implementing random access iterators based upon an index and an object pointer. Moving it to STLExtras allows for reuse elsewhere throughout the codebase, e.g. simplifying the DenseElementsAttr iterators. PiperOrigin-RevId: 255020377
* Internal changeNicolas Vasilache2019-06-251-7/+7
| | | | PiperOrigin-RevId: 255018853
* Support printing SSA ids in affine.load/store which do not have special names.Andy Davis2019-06-253-44/+61
| | | | PiperOrigin-RevId: 254997746
* Update the OperationFolder to find a valid insertion point when ↵River Riddle2019-06-259-76/+100
| | | | | | | | materializing constants. The OperationFolder currently just inserts into the entry block of a Function, but regions may be isolated above, i.e. explicit capture only, and blindly inserting constants may break the invariants of these regions. PiperOrigin-RevId: 254987796
* GPUtoNVVM: adjust integer bitwidth when lowering special register opsAlex Zinenko2019-06-252-18/+39
| | | | | | | | | | | | | | GPU dialect operations (launch and launch_func) use `index` type for thread and block index values inside the kernel, for compatibility with affine loops. NVVM dialect operations, following the NVVM intrinsics, use `!llvm.i32` type, which does not necessarily have the same bit width as the lowered `index` type. Optionally sign-extend (indices are signed) or truncate the result of the NVVM dialect operation to the bit width of the lowered `index` type before passing it to other operations. This behavior is consistent with `std.index_cast`. We cannot use the latter since we are targeting LLVM dialect types directly, rather than standard integer types. PiperOrigin-RevId: 254980868
* Add gpu::GPUDialect::isKernel helper.Stephan Herhut2019-06-253-8/+14
| | | | | | Also some mild cleanup of the kernel to cubin conversion pass. PiperOrigin-RevId: 254959303
* Add missing dependence to MLIRLLVMIRNicolas Vasilache2019-06-251-1/+1
| | | | PiperOrigin-RevId: 254957980
* NVVM target: emit nvvm.annotations for kernel functionsAlex Zinenko2019-06-254-21/+44
| | | | | | | | | | PTX backend in LLVM expects additional module-level metadata `!nvvm.annotations` that lists functions that can be used as GPU kernels. Generate this metadata based on the `gpu.kernel` attribute attached to functions. This attribute is added automatically by the kernel outlining pass in the GPU dialect lowering flow. PiperOrigin-RevId: 254957345
* gpu.launch_func: add accessors to grid configuration operandsAlex Zinenko2019-06-252-0/+13
| | | | | | | | Add accessor functions that return `gpu::KernelDim3` containing the respective operands for grid and block size accepted by `gpu.launch_func`. Use the same signature as for `gpu.launch`. PiperOrigin-RevId: 254942674
* Print both type in diagnostic emitted on mismatch between def/use of SSA ↵Mehdi Amini2019-06-252-2/+4
| | | | | | | | | | Values (NFC) The error would look like: path/filename.mlir:32:23: error: use of value '%28' expects different type than prior uses: ''i32'' vs ''!_tf.control'' PiperOrigin-RevId: 254874859
* NFC: Move the ArgConverter methods out-of-line to improve readability.River Riddle2019-06-241-182/+217
| | | | PiperOrigin-RevId: 254872695
* Fix OSS buildNicolas Vasilache2019-06-241-1/+0
| | | | PiperOrigin-RevId: 254847773
* Split test-specific passes out of mlir-optNicolas Vasilache2019-06-2424-31/+30
| | | | | | Instead put their impl in test/lib and link them into mlir-test-opt PiperOrigin-RevId: 254837439
* Cache several common LLVMTypes in the LLVMDialect.River Riddle2019-06-242-30/+78
| | | | | | LLVM is not thread-safe which means that several of the 'get' methods for LLVMType must be double locked to ensure thread-safety. This cl adds static caching, i.e. no lookups or locking, for several simple LLVM types(i1, half, void, etc.). It also cleans up the implementation of the double locking that is required for some types. In the future we could add a form of dynamic caching to only need to lock one mutex in the best case, but that requires analysis on the memory overhead/vs time lost to taking two locks. PiperOrigin-RevId: 254806747
* Add SPIR-V Load/Store operations. Currently this only support memoryMahesh Ravishankar2019-06-246-0/+600
| | | | | | operands being None, Volatile, Aligned and Nontemporal PiperOrigin-RevId: 254792353
* NFC: Simplify Operation::getContext to use the context within the location.River Riddle2019-06-241-13/+1
| | | | PiperOrigin-RevId: 254771979
* Cleanup test following bad mergeNicolas Vasilache2019-06-241-1/+1
| | | | PiperOrigin-RevId: 254770395
* Use linalg.view_slice in tiling and fusionNicolas Vasilache2019-06-247-272/+126
| | | | | | | | | This CL makes use of view_slice in tiling and fusion. Using a higher level IR element greatly simplifies the IR produced during tiling and fusion. Lowering to LLVM is updated to first translate view_slice into a sequence of dim, range and cmpi. This level will also be useful when lowering to affine. PiperOrigin-RevId: 254767814
* Remove leftover change from splitting mlir-opt change.Jacques Pienaar2019-06-241-1/+0
| | | | PiperOrigin-RevId: 254767366
* Split out mlir-opt main into separate file.Jacques Pienaar2019-06-247-127/+225
| | | | | | | | Enable reusing the real mlir-opt main from unit tests and in case where additional initialization needs to happen before main is invoked (e.g., when using different command line flag libraries). PiperOrigin-RevId: 254764575
* Add higher-level linalg.view_slice operation.Nicolas Vasilache2019-06-245-0/+139
| | | | | | This will be useful to simplify the IR emitted during transformations as well as lowering to affine. PiperOrigin-RevId: 254757641
* Add parsing/printing for new affine.load and affine.store operations.Andy Davis2019-06-247-22/+593
| | | | | | | The new operations affine.load and affine.store will take composed affine maps by construction. These operations will eventually replace load and store operations currently used in affine regions and operated on by affine transformation and analysis passes. PiperOrigin-RevId: 254754048
* Update CSE to respect nested regions that are isolated from above. This cl ↵River Riddle2019-06-244-44/+68
| | | | | | also removes the unused 'NthRegionIsIsolatedFromAbove' trait as it was replaced with a more general 'IsIsolatedFromAbove'. PiperOrigin-RevId: 254709704
* Change string to std::string.Jacques Pienaar2019-06-241-2/+1
| | | | PiperOrigin-RevId: 254580672
* Allow converting Diagnostic to LogicalResult::Failure. This matches the ↵River Riddle2019-06-247-20/+23
| | | | | | behavior of InFlightDiagnostic and enables notes to be converted to failure. PiperOrigin-RevId: 254579098
* Linalg1LLVMConversion should depend on MLIRLLVMIR to ensure ops generated.Jacques Pienaar2019-06-241-1/+1
| | | | PiperOrigin-RevId: 254578530
* Add a new dialect hook 'materializeConstant' to create a constant operation ↵River Riddle2019-06-227-110/+204
| | | | | | that materializes an attribute value with the given type. This effectively adds support for dialect specific constant values that have different invariants than std.constant. 'OperationFolder' is updated to use this new hook, or attempt to default to std.constant when legal. PiperOrigin-RevId: 254570153
* NFC: Remove the 'context' parameter from OperationState.River Riddle2019-06-2213-46/+41
| | | | | | Now that Locations are Attributes they contain a direct reference to the MLIRContext, i.e. the context can be directly accessed from the given location instead of being explicitly passed in. PiperOrigin-RevId: 254568329
* Add missing build dep.Jacques Pienaar2019-06-221-0/+1
| | | | PiperOrigin-RevId: 254557652
* Add int8 predicates to the tf lite opsFeng Liu2019-06-221-13/+18
| | | | PiperOrigin-RevId: 254519710
* Define a ModuleOp that represents a Module as an Operation.River Riddle2019-06-2210-37/+256
| | | | | | | | | | | | | | | | | | The ModuleOp contains a single region that must contain a single block. This block must be terminated by a new pseudo operation 'module_terminator'. The syntax for this operations is as follows: `module` (`attributes` attr-dict)? region Example: module { ... } module attributes { ... } { ... } PiperOrigin-RevId: 254513752
* Remove dead functionNicolas Vasilache2019-06-221-8/+0
| | | | PiperOrigin-RevId: 254507641
* Add a Linalg convolution op.Nicolas Vasilache2019-06-228-29/+340
| | | | | | | | | | | This CL adds a conv op that corresponds to the TF description along with its lowering to loops (https://www.tensorflow.org/api_docs/python/tf/nn/convolution). The dimension of the convolution is inferred from the rank of the views. The other logical dimensions correspond to the TF description. The computation of tiled views need to be updated to work for the input tensor. This is left for a future CL. PiperOrigin-RevId: 254505644
* Refactor the location classes to be attributes instead of separate IR classes.River Riddle2019-06-2213-509/+390
| | | | | | This will allow for locations to be used in the same contexts as attributes. Given that attributes are nullable types, the 'Location' class now represents a non-nullable wrapper around a 'LocationAttr'. This preserves the desired semantics we have for non-optional locations. PiperOrigin-RevId: 254505278
* Simplify PredecessorIterator by using mapped_iterator.River Riddle2019-06-222-40/+29
| | | | PiperOrigin-RevId: 254495164
* [spirv] Basic serializer and deserializerLei Zhang2019-06-2222-2/+810
| | | | | | | | | | | | | | | | 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
* NFC: Drop the unnecessary dependence on TransformsUtils from Parser. This is ↵River Riddle2019-06-221-1/+1
| | | | | | a historical dependency that is no longer needed. PiperOrigin-RevId: 254460518
* Define the 'reference' type for the remaining value-typed iterators. This ↵River Riddle2019-06-222-1/+7
| | | | | | allows for them to be used with llvm::enumerate and other various iterator utilities. PiperOrigin-RevId: 254460201
* Define the 'reference' type for the OperandType and ResultType iterators so ↵River Riddle2019-06-221-0/+4
| | | | | | that they can be used with llvm::enumerate. PiperOrigin-RevId: 254422623
* Clarify documentation for MLIR to indicate that the build instructions run ↵Krzysztof Drewniak2019-06-221-5/+6
| | | | | | the test suite. PiperOrigin-RevId: 254421795
OpenPOWER on IntegriCloud