summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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
| * Adds canonicalizer to SubViewOp which folds constants from base memref and ↵Andy Davis2019-11-144-30/+243
| | | | | | | | | | | | | | | | operands into the subview result memref type. Changes SubViewOp to support zero operands case, when offset, strides and sizes are all constant. PiperOrigin-RevId: 280485075
| * Add CMakeLists.txt for AffineToStandard conversionAlex Zinenko2019-11-141-0/+24
| | | | | | | | PiperOrigin-RevId: 280470142
| * [ODS] Fix operation argument population to avoid crashLei Zhang2019-11-145-6/+74
| | | | | | | | | | | | | | | | | | | | The `Operator` class keeps an `arguments` field, which contains pointers to `operands` and `attributes` elements. Thus it must be populated after `operands` and `attributes` are finalized so to have stable pointers. SmallVector may re-allocate when still having new elements added, which will invalidate pointers. PiperOrigin-RevId: 280466896
| * Move Affine to Standard conversion to lib/ConversionAlex Zinenko2019-11-1411-12/+17
| | | | | | | | | | | | | | This is essentially a dialect conversion and conceptually belongs to conversions. PiperOrigin-RevId: 280460034
| * Make positions of elements in MemRef descriptor privateAlex Zinenko2019-11-142-31/+17
| | | | | | | | | | | | | | | | Previous commits removed all uses of LLVMTypeConverter::k*PosInMemRefDescriptor outside of the MemRefDescriptor class. These numbers are an implementation detail and can be hidden under a layer of more semantic APIs. PiperOrigin-RevId: 280442444
| * Use MemRefDescriptor in Vector-to-LLVM convresionAlex Zinenko2019-11-144-44/+27
| | | | | | | | | | | | | | | | | | | | Following up on the consolidation of MemRef descriptor conversion, update Vector-to-LLVM conversion to use the helper class that abstracts away the implementation details of the MemRef descriptor. This also makes the types of the attributes in emitted llvm.insert/extractelement operations consistently i64 instead of a mix of index and i64. PiperOrigin-RevId: 280441451
| * Adapt code to LLVM API updates.MLIR Team2019-11-141-1/+1
| | | | | | | | PiperOrigin-RevId: 280431812
| * Move VectorOps to Tablegen - (almost) NFCNicolas Vasilache2019-11-1421-908/+597
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL moves VectorOps to Tablegen and cleans up the implementation. This is almost NFC but 2 changes occur: 1. an interface change occurs in the padding value specification in vector_transfer_read: the value becomes non-optional. As a shortcut we currently use %f0 for all paddings. This should become an OpInterface for vectorization in the future. 2. the return type of vector.type_cast is trivial and simplified to `memref<vector<...>>` Relevant roundtrip and invalid tests that used to sit in core are moved to the vector dialect. The op documentation is moved to the .td file. PiperOrigin-RevId: 280430869
| * Use MemRefDescriptor in Linalg-to-LLVM conversionAlex Zinenko2019-11-143-201/+212
| | | | | | | | | | | | | | | | | | | | | | Following up on the consolidation of MemRef descriptor conversion, update Linalg-to-LLVM conversion to use the helper class that abstracts away the implementation details of the MemRef descriptor. This required MemRefDescriptor to become publicly visible. Since this conversion is heavily EDSC-based, introduce locally an additional wrapper that uses builder and location pointed to by the EDSC context while emitting descriptor manipulation operations. PiperOrigin-RevId: 280429228
| * [doc] Add debugging tips in ODS and DRR doc regarding mlir-tblgenLei Zhang2019-11-142-0/+49
| | | | | | | | PiperOrigin-RevId: 280398956
| * Concentrate memref descriptor manipulation logic in one placeAlex Zinenko2019-11-141-165/+174
| | | | | | | | | | | | | | | | | | | | | | Memref descriptor is becoming increasingly complex. Memrefs are manipulated by multiple standard instructions, each of which has a non-trivial lowering to the LLVM dialect. This leads to verbose code that manipulates the descriptors exposing the internals of insert/extractelement opreations. Implement a wrapper class that contains a memref descriptor and provides semantically named methods that build the primitive IR operations instead. PiperOrigin-RevId: 280371225
| * Do not emit aliases when printing local formJacques Pienaar2019-11-132-2/+15
| | | | | | | | | | | | Expand local scope printing to skip printing aliases as aliases are printed out at the top of a module and may not be part of the output generated by local scope print. PiperOrigin-RevId: 280278617
| * Replace explicit concatenation by llvm::concatNicolas Vasilache2019-11-131-4/+2
| | | | | | | | PiperOrigin-RevId: 280258938
| * Deprecate linalg.subview in favor of std.subviewNicolas Vasilache2019-11-1324-518/+335
| | | | | | | | | | | | | | | | | | | | | | This CL uses the now standard std.subview in linalg. Two shortcuts are currently taken to allow this port: 1. the type resulting from a view is currently degraded to fully dynamic to pass the SubViewOp verifier. 2. indexing into SubViewOp may access out of bounds since lowering to LLVM does not currently enforce it by construction. These will be fixed in subsequent commits after discussions. PiperOrigin-RevId: 280250129
| * Fix glossary formatting.Lucy Fox2019-11-131-142/+155
| | | | | | | | PiperOrigin-RevId: 280236761
| * Add FuncOp::eraseArgumentSean Silva2019-11-136-3/+223
| | | | | | | | | | | | | | | | | | | | | | | | This is a quite complex operation that users are likely to attempt to write themselves and get wrong (citation: users=me). Ideally, we could pull this into FunctionLike, but for now, the FunctionType rewriting makes it FuncOp specific. We would need some hook for rewriting the function type (which for LLVM's func op, would need to rewrite the underlying LLVM type). PiperOrigin-RevId: 280234164
| * NFC: Refactor block signature conversion to not erase the original arguments.River Riddle2019-11-136-200/+243
| | | | | | | | | | | | This refactors the implementation of block signature(type) conversion to not insert fake cast operations to perform the type conversion, but to instead create a new block containing the proper signature. This has the benefit of enabling the use of pre-computed analyses that rely on mapping values. It also leads to a much cleaner implementation overall. The major user facing change is that applySignatureConversion will now replace the entry block of the region, meaning that blocks generally shouldn't be cached over calls to applySignatureConversion. PiperOrigin-RevId: 280226936
| * Create and begin writing glossary.Lucy Fox2019-11-132-3/+158
| | | | | | | | | | | | This creates a central place in the documentation where MLIR-specific terminology is defined. See discussion on the MLIR forum (https://groups.google.com/a/tensorflow.org/g/mlir/c/5YXDSdu76Hk). PiperOrigin-RevId: 280220365
| * Rename the current parseSymbolName to parseOptionalSymbolNameRiver Riddle2019-11-135-17/+29
| | | | | | | | | | | | The current implementation silently fails if the '@' identifier isn't present, making it similar to the 'optional' parse methods. This change renames the current implementation to 'Optional' and adds a new 'parseSymbolName' that emits an error. PiperOrigin-RevId: 280214610
OpenPOWER on IntegriCloud