summaryrefslogtreecommitdiffstats
path: root/mlir
Commit message (Collapse)AuthorAgeFilesLines
...
* missing outer index %i in search_bodyMLIR Team2019-11-201-2/+2
| | | | PiperOrigin-RevId: 281580028
* Add multi-level DCE pass.Sean Silva2019-11-206-0/+418
| | | | | | | | | This is a simple multi-level DCE pass that operates pretty generically on the IR. Its key feature compared to the existing peephole dead op folding that happens during canonicalization is being able to delete recursively dead cycles of the use-def graph, including block arguments. PiperOrigin-RevId: 281568202
* Changes to SubViewOp to make it more amenable to canonicalization.Mahesh Ravishankar2019-11-206-68/+322
| | | | | | | | | | | | | | The current SubViewOp specification allows for either all offsets, shape and stride to be dynamic or all of them to be static. There are opportunities for more fine-grained canonicalization based on which of these are static. For example, if the sizes are static, the result memref is of static shape. The specification of SubViewOp is modified to allow on or more of offsets, shapes and strides to be statically specified. The verification is updated to ensure that the result type of the subview op is consistent with which of these are static and which are dynamic. PiperOrigin-RevId: 281560457
* Implement unrolling of vector ops to finer-grained vector ops as a pattern.Nicolas Vasilache2019-11-2013-29/+570
| | | | | | | | | This CL uses the pattern rewrite infrastructure to implement a simple VectorOps -> VectorOps legalization strategy to unroll coarse-grained vector operations into finer grained ones. The transformation is written using local pattern rewrites to allow composition with other rewrites. It proceeds by iteratively introducing fake cast ops and cleaning canonicalizing or lowering them away where appropriate. This is an example of writing transformations as compositions of local pattern rewrites that should enable us to make them significantly more declarative. PiperOrigin-RevId: 281555100
* Add a new OpAsmOpInterface to allow for ops to directly hook into the ↵River Riddle2019-11-2012-93/+315
| | | | | | | | | | | | | | | | | | | | | | | AsmPrinter. This interface provides more fine-grained hooks into the AsmPrinter than the dialect interface, allowing for operations to define the asm name to use for results directly on the operations themselves. The hook is also expanded to enable defining named result "groups". Get a special name to use when printing the results of this operation. The given callback is invoked with a specific result value that starts a result "pack", and the name to give this result pack. To signal that a result pack should use the default naming scheme, a None can be passed in instead of the name. For example, if you have an operation that has four results and you want to split these into three distinct groups you could do the following: setNameFn(getResult(0), "first_result"); setNameFn(getResult(1), "middle_results"); setNameFn(getResult(3), ""); // use the default numbering. This would print the operation as follows: %first_result, %middle_results:2, %0 = "my.op" ... PiperOrigin-RevId: 281546873
* Add StridedMemRef<>::operator[] - NFCNicolas Vasilache2019-11-201-0/+29
| | | | | | This operator is used for internal debugging purposes. PiperOrigin-RevId: 281544152
* Fix the comment to Region block iterators.Alexander Belyaev2019-11-201-1/+1
| | | | PiperOrigin-RevId: 281506693
* Fix 'the the' typo.Alexander Belyaev2019-11-206-7/+6
| | | | PiperOrigin-RevId: 281501234
* Extend kernel outlining to also consider dim worth inlining.Stephan Herhut2019-11-202-10/+22
| | | | PiperOrigin-RevId: 281483447
* Add some CMake rules for installing headers, mlir-tblgen, and mlir-optEric Schweitz2019-11-192-1/+29
| | | | | | Closes tensorflow/mlir#246 PiperOrigin-RevId: 281442685
* Make type and rank explicit in mcuMemHostRegister function.Christian Sigg2019-11-195-35/+40
| | | | | | Fix registered size of indirect MemRefType kernel arguments. PiperOrigin-RevId: 281362940
* Add VectorOps.StridedSliceOpNicolas Vasilache2019-11-194-2/+289
| | | | | | | | | | | | | | | | | | | | | The `vector.strided_slice` takes an n-D vector, k-D `offsets` integer array attribute, a k-D `sizes` integer array attribute, a k-D `strides` integer array attribute and extracts the n-D subvector at the proper offset. Returns an n-D vector where the first k-D dimensions match the `sizes` attribute. The returned subvector contains the elements starting at offset `offsets` and ending at `offsets + sizes`. Example: ``` %1 = vector.strided_slice %0 {offsets : [0, 2], sizes : [2, 4], strides : [1, 1]}: vector<4x8x16xf32> // returns a vector<2x4x16xf32> ``` This op will be useful for progressive lowering within the VectorOp dialect. PiperOrigin-RevId: 281352749
* Fix pretty printer corner case in mlir_runner_utils.cpp.Nicolas Vasilache2019-11-192-27/+17
| | | | | | | In the particular case where the size of a memref dimension is 1, double printing would happen because printLast was called unconditionally. This CL fixes the print and updates an incorrect test that should have caught this in the first place. PiperOrigin-RevId: 281345142
* Add a note on commit messages to our developer guideMehdi Amini2019-11-191-0/+4
| | | | PiperOrigin-RevId: 281338738
* Add mention to avoid cl::opt for MLIR passes in the developer guideMehdi Amini2019-11-191-0/+6
| | | | PiperOrigin-RevId: 281338448
* Add getRemappedValue to ConversionPatternRewriterDiego Caballero2019-11-194-0/+86
| | | | | | | | | | This method is needed for N->1 conversion patterns to retrieve remapped Values used in the original N operations. Closes tensorflow/mlir#237 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/237 from dcaballe:dcaballe/getRemappedValue 1f64fadcf2b203f7b336ff0c5838b116ae3625db PiperOrigin-RevId: 281321881
* Add '*' and '?' and optional brace parse calls to the ParserEric Schweitz2019-11-192-0/+32
| | | | | | Closes tensorflow/mlir#245 PiperOrigin-RevId: 281321459
* Change conversion CLI flag from -lower-to-llvm to -convert-std-to-llvmAlex Zinenko2019-11-1910-22/+23
| | | | | | | | | | | | The command-line flag name `lower-to-llvm` for the pass performing dialect conversion from the Standard dialect to the LLVM dialect is misleading and inconsistent with most of the conversion passses. It leads the user to believe that there are no restrictions on what can be converted, while in fact only a subset of the Standard dialect can be converted (with operations from other dialects converted by separate passes). Use `convert-std-to-llvm` that better reflects what the pass does and is consistent with most other conversions. PiperOrigin-RevId: 281238797
* Add dialect-attribute-entry requirement to docsLogan Chien2019-11-181-2/+14
| | | | | | | This commit add `dialect-attribute-entry` requirements on function arguments, function results, and function attributes to the documentation. PiperOrigin-RevId: 281227740
* Fix the shape of the outcome in the example code.Manuel Freiberger2019-11-181-4/+4
| | | | | | | | | | The toy language uses element-wise multiplication. Transposing and multiplying two tensors with shape <2, 3> gives a tensor with shape <3, 2>. Closes tensorflow/mlir#227 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/227 from ombre5733:toy-ch1-docu-fix d79e5d3f9e3d5150a7ac8aac28b899df5a0d10a0 PiperOrigin-RevId: 281221671
* Support SPIR-V constant op to take DenseElementsAttr as input.Hanhan Wang2019-11-184-175/+155
| | | | | | | | Iterates each element to build the array. This includes a little refactor to combine bool/int/float into a function, since they are similar. The only difference is calling different function in the end. PiperOrigin-RevId: 281210288
* Use SmallVectorImpl instead of SmallVector for function parameters (NFC)Tian Jin2019-11-182-2/+2
| | | | | | Closes tensorflow/mlir#247 PiperOrigin-RevId: 281185661
* Lower linalg.indexed_generic to loops.Alexander Belyaev2019-11-185-74/+376
| | | | PiperOrigin-RevId: 281169885
* 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
* Fix SubViewOp stride calculation in constant folding.Andy Davis2019-11-182-12/+36
| | | | | | Adds unit tests for subview offset and stride argument constant folding. PiperOrigin-RevId: 281161041
* Add a parseAttribute<AttrType> overload for the non-type case.River Riddle2019-11-183-3/+10
| | | | | | The variant that accepts a type will check that the parsed attribute is a valid instance of AttrType. The non-type variant would silently fail in this case, leading to garbage attribute values. PiperOrigin-RevId: 281136528
* Fix gen_spirv_dialect.py regarding 1D/2D/3D Dim symbol nameLei Zhang2019-11-181-2/+12
| | | | PiperOrigin-RevId: 281131561
* [spirv] Add a canonicalizer for BitcastOp.Denis Khalikov2019-11-183-4/+63
| | | | | | | | | | Convert chained `spirv::BitcastOp` operations into one `spirv::BitcastOp` operation. Closes tensorflow/mlir#238 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/238 from denis0x0D:sandbox/canon_bitcast 4352ed4f81b959ec92f849c599e733b62a99c010 PiperOrigin-RevId: 281129234
* Also elide large array attribute in OpGraph DumpJing Pu2019-11-181-0/+6
| | | | PiperOrigin-RevId: 281114034
* ConvertStandardToLLVM: replace assertion with graceful failureAlex Zinenko2019-11-181-2/+2
| | | | | | | | | | | | | The assertion was introduced in the early days of dialect conversion infrastructure when we had the matching function separate from the rewriting function. The infrastructure evolved to have a common matchAndRewrite function and the separate matching function was dropped without chaning the rewriting that became matchAndRewrite. This has led to assertion being triggered. Return a matchFailure instead of failing an assertion on unsupported types. Closes tensorflow/mlir#230 PiperOrigin-RevId: 281113741
* Fix Affine Loop Fusion test case reported on github.Andy Davis2019-11-183-24/+122
| | | | | | This CL utilizies the more robust fusion feasibility analysis being built out in LoopFusionUtils, which will eventually be used to replace the current affine loop fusion pass. PiperOrigin-RevId: 281112340
* Standardize all VectorOps class names to be prefixed by Vector - NFCNicolas Vasilache2019-11-183-36/+51
| | | | | | This improves consistency and will concretely avoid collisions between VectorExtractElementOp and ExtractElementOp when they are included in the same transforms / rewrites. PiperOrigin-RevId: 281101588
* Implement folding of pattern dim(subview(_)[...][s1, ..., sn][...], i) -> si.Stephan Herhut2019-11-182-5/+25
| | | | PiperOrigin-RevId: 281042016
* Rename CLI flags -lower-gpu-ops-to-*-ops to -convert-gpu-to-*Alex Zinenko2019-11-184-5/+4
| | | | | | | This makes the flags consistent with the naming scheme used elsewhere in the codebase for dialect conversions. PiperOrigin-RevId: 281027517
* Fix mismatched-tags warningJacques Pienaar2019-11-161-1/+1
| | | | PiperOrigin-RevId: 280888290
* Fix attribute dict syntax in the docsLogan Chien2019-11-153-26/+26
| | | | | | This commit fixes several attribute dict syntax errors in the documentation. PiperOrigin-RevId: 280726269
* [spirv] Add bit opsDenis Khalikov2019-11-155-5/+314
| | | | | | | | | | | | | This CL added op definitions for a few bit operations: * OpBitFieldInsert * OpBitFieldSExtract * OpBitFieldUExtract Closes tensorflow/mlir#233 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/233 from denis0x0D:sandbox/bit_field_ops e7fd85b00d72d483d7992dc42b9cc4d673903455 PiperOrigin-RevId: 280691816
* Clarify that identity maps are discarded from the MemRef typeAlex Zinenko2019-11-151-0/+4
| | | | | | | Update LangRef to explicitly mention the type canonicalization rule applied to MemRef types: identity maps do not contribute to type identification. PiperOrigin-RevId: 280684904
* NFC: Convert CmpIPredicate in StandardOps to use EnumAttrLei Zhang2019-11-1511-120/+77
| | | | | | This turns several hand-written functions to auto-generated ones. PiperOrigin-RevId: 280684326
* Modify tutorial and other documentation for consistency, clarity, and ↵Lucy Fox2019-11-1514-334/+337
| | | | | | correctness. PiperOrigin-RevId: 280678392
* Use simpler highlighting textmate syntaxJacques Pienaar2019-11-151-352/+73
| | | | | | | | | | | | Changes from: https://github-lightshow.herokuapp.com/?utf8=%E2%9C%93&scope=from-url&grammar_format=auto&grammar_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fgrammars%2Fmlir.json&grammar_text=&code_source=from-url&code_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fsample.mlir&code= To: https://github-lightshow.herokuapp.com/?utf8=%E2%9C%93&scope=from-url&grammar_format=auto&grammar_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fsimpler%2Fgrammars%2Fmlir.json&grammar_text=&code_source=from-url&code_url=https%3A%2F%2Fraw.githubusercontent.com%2Fjpienaar%2Fmlir-grammar%2Fmaster%2Fsample.mlir&code= Which I think is an improvement. PiperOrigin-RevId: 280674770
* Fix build warningsNicolas Vasilache2019-11-151-0/+1
| | | | | | | | | Delete unused constexpr ints in LowerToLLVMDialect. Add (void)toStringRef for non-debug builds. Fixes tensorflow/mlir#232. PiperOrigin-RevId: 280671014
* Use aggregate-parameter builder for ops having autogen type-deduction builderLei Zhang2019-11-155-103/+283
| | | | | | | | | | | | | | | | | | | | | | Thus far DRR always invokes the separate-parameter builder (i.e., requiring a separate parameter for each result-type/operand/attribute) for creating ops, no matter whether we can auto-generate a builder with type-deduction ability or not. This CL changes the path for ops that we can auto-generate type-deduction builders, i.e., with SameOperandsAndResultType/FirstAttrDerivedResultType traits. Now they are going through a aggregate-parameter builder (i.e., requiring one parameter for all result-types/operands/attributes). attributes.) It is expected this approach will be more friendly for future shape inference function autogen and calling those autogen'd shape inference function without excessive packing and repacking operand/attribute lists. Also, it would enable better support for creating ops with optional attributes because we are not required to provide an Attribute() as placeholder for an optional attribute anymore. PiperOrigin-RevId: 280654800
* Templatize linalg::LowerToLoops - NFCNicolas Vasilache2019-11-151-65/+80
| | | | | | | This modification will allow to easily plug lowering of linalg ops to different types of loops (affine, loop.for and other future constructs). This is purely NFC for now. PiperOrigin-RevId: 280652186
* Mark std.view as no-sideeffect.Stephan Herhut2019-11-152-1/+7
| | | | | | The same reasoning as for std.subview applies. PiperOrigin-RevId: 280639308
* Mark std.subview as no-sideeffect.Stephan Herhut2019-11-152-26/+37
| | | | | | | | In essence, std.subview is just an abstract indexing transformation (somewhat akin to a gep in llvm) and by itself has no effect. From a practical perspective this helps, as it allows to remove dead subview operations. PiperOrigin-RevId: 280630046
* Add more navigation to the MLIR toy tutorial.MLIR Team2019-11-155-2/+21
| | | | | | | | This comes in the form of: 1. Missing links to next chapters. 2. Table of contents for each page. PiperOrigin-RevId: 280619053
* Expand on operation definition to clarify the difference between operation ↵Lucy Fox2019-11-141-0/+6
| | | | | | and op. PiperOrigin-RevId: 280555742
* Refactor the LowerVectorTransfers pass to use the RewritePattern infra - NFCNicolas Vasilache2019-11-1412-55/+88
| | | | | | This is step 1/n in refactoring infrastructure along the Vector dialect to make it ready for retargetability and composable progressive lowering. PiperOrigin-RevId: 280529784
* NFC: Refactor Dialect Conversion targeting SPIR-V.Mahesh Ravishankar2019-11-1415-582/+755
| | | | | | | | | | | | Refactoring the conversion from StandardOps/GPU dialect to SPIR-V dialect: 1) Move the SPIRVTypeConversion and SPIRVOpLowering class into SPIR-V dialect. 2) Add header files that expose functions to add patterns for the dialects to SPIR-V lowering, as well as a pass that does the dialect to SPIR-V lowering. 3) Make SPIRVOpLowering derive from OpLowering class. PiperOrigin-RevId: 280486871
OpenPOWER on IntegriCloud