summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * Add Python bindings for affine expressions with binary operators.MLIR Team2019-12-032-2/+73
| | | | | | | | PiperOrigin-RevId: 283569325
| * Add python bindings for ArrayAttr, AffineMapAttr.MLIR Team2019-12-032-2/+157
| | | | | | | | PiperOrigin-RevId: 283561252
| * Fix ViewOp to have at most one offset operandAlex Zinenko2019-12-038-30/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in the documentation, ViewOp is expected to take an optional dynamic offset followed by a list of dynamic sizes. However, the ViewOp parser did not include a check for the offset being a single value and accepeted a list of values instead. Furthermore, several tests have been exercising the wrong syntax of a ViewOp, passing multiple values to the dyanmic stride list, which was not caught by the parser. The trailing values could have been erronously interpreted as dynamic sizes. This is likely due to resyntaxing of the ViewOp, with the previous syntax taking the list of sizes before the offset. Update the tests to use the syntax with the offset preceding the sizes. Worse, the conversion of ViewOp to the LLVM dialect assumed the wrong order of operands with offset in the trailing position, and erronously relied on the permissive parsing that interpreted trailing dynamic offset values as leading dynamic sizes. Fix the lowering to use the correct order of operands. PiperOrigin-RevId: 283532506
| * AffineLoopFusion: Prevent fusion of multi-out-edge producer loopsDiego Caballero2019-12-032-3/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | tensorflow/mlir#162 introduced a bug that incorrectly allowed fusion of producer loops with multiple outgoing edges. This commit fixes that problem. It also introduces a new flag to disable sibling loop fusion so that we can test producer-consumer fusion in isolation. Closes tensorflow/mlir#259 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/259 from dcaballe:dcaballe/fix_multi_out_edge_producer_fusion 578d5661705fd5c56c555832d5e0528df88c5282 PiperOrigin-RevId: 283531105
| * Extend conversion of SubViewOp to llvm to also support cases where size and ↵Stephan Herhut2019-12-032-6/+78
| | | | | | | | | | | | | | | | | | | | | | | | stride are constant (i.e., there are no size and stride operands). We recently added canonicalization that rewrites constant size and stride operands to SubViewOp into static information in the type, so these patterns now occur during code generation. PiperOrigin-RevId: 283524688
| * [spirv] Add spv.SubgroupBallotKHROpLei Zhang2019-12-037-10/+131
| | | | | | | | PiperOrigin-RevId: 283522284
| * [Linalg] Update/fix documentation for linalg.indexed_generic.Alexander Belyaev2019-12-031-3/+3
| | | | | | | | PiperOrigin-RevId: 283503642
| * Add linkage support to LLVMFuncOpAlex Zinenko2019-12-037-53/+181
| | | | | | | | | | | | | | | | | | A recent commit introduced the Linkage attribute to the LLVM dialect and used it in the Global Op. Also use it in LLVMFuncOp. As per LLVM Language Reference, if the linkage attribute is omitted, the function is assumed to have external linkage. PiperOrigin-RevId: 283493299
| * [spirv] NFC: reorder sections in SPIRVBase.tdLei Zhang2019-12-022-379/+382
| | | | | | | | | | | | | | Put extensions and capabilities at the very beginning because they will be referenced later by other definitions. PiperOrigin-RevId: 283416972
| * NFC: use `&&` instead of `and`Lei Zhang2019-12-021-1/+1
| | | | | | | | PiperOrigin-RevId: 283392575
| * [VectorOps] Add legality rules to broadcastAart Bik2019-12-024-6/+48
| | | | | | | | PiperOrigin-RevId: 283360101
| * [ODS] Generate builders taking unwrapped value and defaults for attributesLei Zhang2019-12-029-136/+386
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Existing builders generated by ODS require attributes to be passed in as mlir::Attribute or its subclasses. This is okay foraggregate- parameter builders, which is primarily to be used by programmatic C++ code generation; it is inconvenient for separate-parameter builders meant to be called in manually written C++ code because it requires developers to wrap raw values into mlir::Attribute by themselves. This CL extends to generate additional builder methods that take raw values for attributes and handles the wrapping in the builder implementation. Additionally, if an attribute appears late in the arguments list and has a default value, the default value is supplied in the declaration if possible. PiperOrigin-RevId: 283355919
| * Generate dialect documentations in the doc folder for every dialectMehdi Amini2019-12-0210-40/+33
| | | | | | | | | | | | Also add a mlir-doc build target to general all the docs PiperOrigin-RevId: 283353529
| * docs: minor spelling tweaksbrett koonce2019-12-022-4/+4
| | | | | | | | | | | | | | Closes tensorflow/mlir#262 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/262 from brettkoonce:docs-sp 6833fc8aa41edd02d8bc7c3cbb84211cb8b0334c PiperOrigin-RevId: 283352765
| * Add missing `>` to the description of std.view.Denis Khalikov2019-12-021-2/+2
| | | | | | | | | | | | | | Closes tensorflow/mlir#266 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/266 from denis0x0D:sandbox/miss_char a5f662e1bf103b5009da67d045ee2fcebf822ab0 PiperOrigin-RevId: 283340486
| * [DRR] Introduce `$_` to ignore op argument matchLei Zhang2019-12-025-3/+42
| | | | | | | | | | | | | | | | Right now op argument matching in DRR is position-based, meaning we need to specify N arguments for an op with N ODS-declared argument. This can be annoying when we don't want to capture all the arguments. `$_` is to remedy the situation. PiperOrigin-RevId: 283339992
| * NFC: Update std.subview op to use AttrSizedOperandSegmentsLei Zhang2019-12-025-109/+77
| | | | | | | | | | | | This turns a few manually written helper methods into auto-generated ones. PiperOrigin-RevId: 283339617
| * add missing '>' in Ch-2JKIsaacLee2019-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | add missing '>' in Ch-2 (tensor<2x3xf64)->(tensor<2x3xf64>) Closes tensorflow/mlir#283 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/283 from JKIsaacLee:patch-1 b69fe8d51e2a540f7efaded159d35b88778ad159 PiperOrigin-RevId: 283333807
| * Lower linalg.indexed_generic with libcall to LLVM.Alexander Belyaev2019-12-022-3/+81
| | | | | | | | PiperOrigin-RevId: 283328994
| * Introduce Linkage attribute to the LLVM dialectAlex Zinenko2019-12-0214-67/+322
| | | | | | | | | | | | | | | | | | | | | | LLVM IR supports linkage on global objects such as global variables and functions. Introduce the Linkage attribute into the LLVM dialect, backed by an integer storage. Use this attribute on LLVM::GlobalOp and make it mandatory. Implement parsing/printing of the attribute and conversion to LLVM IR. See tensorflow/mlir#277. PiperOrigin-RevId: 283309328
| * mlir-tblgen: Dump input records when no generator is setJacques Pienaar2019-11-291-1/+4
| | | | | | | | | | | | Follow LLVM's tblgen convention when no generator is set instead of asserting. PiperOrigin-RevId: 283073690
| * Fix redundant convert and use NamedAttributeList as valueJacques Pienaar2019-11-292-8/+8
| | | | | | | | | | | | | | | | * Had leftover call that would result in converting to dictionary attr before being implicitedly converted back to NamedAttributeList; * NamedAttributeList is value typed, so don't use const reference; PiperOrigin-RevId: 283072576
| * Fixed typo in Ch-1 of Toy tutorialJKIsaacLee2019-11-291-1/+1
| | | | | | | | | | | | Closes tensorflow/mlir#282 PiperOrigin-RevId: 283064785
| * [spirv] Check that operand of `spirv::CompositeExtractOp` is constant while ↵Denis Khalikov2019-11-282-0/+14
| | | | | | | | | | | | | | | | | | folding. Closes tensorflow/mlir#281 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/281 from denis0x0D:sandbox/composite_ex_fold d02d73658bd1b9eaa515eb4e0aee34bc41d4252b PiperOrigin-RevId: 282971563
| * Split out FunctionLike printing/parsing into FunctionImplementation.{h,cpp}Alex Zinenko2019-11-286-75/+116
| | | | | | | | | | | | | | | | | | | | | | Helper utilies for parsing and printing FunctionLike Ops are only relevant to the implementation of the Op, not its definition. They depend on OpImplementation.h and increase the inclusion footprint of FunctionSupport.h, and do so only to provide some utilities in the "impl" namespace. Move them to a separate files, similarly to OpDefinition/OpImplementation distinction, and make only Op implementations use them while keeping headers cleaner. NFC. PiperOrigin-RevId: 282964556
| * [Linalg] Change attribute n_loop_types to iteratorJose Ignacio Gomez2019-11-288-60/+71
| | | | | | | | | | | | | | | | | | | | This addresses issue tensorflow/mlir#270. Linalg is updated to take the same form of iterator_types than vector contraction. Closes tensorflow/mlir#280 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/280 from tetuante:PRissue270 d26d88d090d3765d3b9884bfabdd023143f27287 PiperOrigin-RevId: 282905396
| * NFC: A few cleanups for SPIRVLoweringLei Zhang2019-11-272-60/+63
| | | | | | | | | | | | | | Updated comments and used static instead of anonymous namspace to hide functions to be consistent with the existing codebase. PiperOrigin-RevId: 282847784
| * [spirv] NFC: Add getZero() and getOne() static method to ConstantOpLei Zhang2019-11-276-6/+41
| | | | | | | | | | | | | | Getting constant zero or one is very common so it merits a special handy method on spirv::ConstantOp itself. PiperOrigin-RevId: 282832572
| * [spirv] Add folders for spv.IAdd and spv.IMulLei Zhang2019-11-273-73/+141
| | | | | | | | | | | | | | | | | | Adding zero and multiplying one can be common when generating code for index calculation. This CL also sorted canonicalize.mlir to alphabetical order. PiperOrigin-RevId: 282828055
| * Fixed typo in Toy tutorial (second var e -> var f)Aart Bik2019-11-278-15/+15
| | | | | | | | PiperOrigin-RevId: 282810649
| * Implement Linalg to loops lowering as a patternNicolas Vasilache2019-11-2711-137/+275
| | | | | | | | | | | | This CL rewrites the linalg ops to loops transformations as patterns that can be targeted directly from Tablegen. Reliance on OpFolder is removed and to cope with it we introduce local folding patterns that are applied greedily. PiperOrigin-RevId: 282765550
| * [VectorOps] Refine BroadcastOp in VectorOps dialectAart Bik2019-11-264-28/+24
| | | | | | | | | | | | | | | | Since second argument is always fully overwritten and shape is define in "to" clause, it is not needed. Also renamed "into" to "to" now that arg is dropped. PiperOrigin-RevId: 282686475
| * Add create method that takes equivalent of OperationState with ↵Jacques Pienaar2019-11-262-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | NamedAttributeList This method is close to creating an OperationState first and then unpacking it but avoids creating the OperationState and takes a NamedAttributeList for attributes rather than array of NamedAttribute (to enable reusing an already created NamedAttributeList). Reuse this new method via create that takes OperationState. I'll update inferReturnTypes in follow up to also take NamedAttributeList and so a build method that uses both inferReturnTypes and create can reuse the same list. PiperOrigin-RevId: 282651642
| * [VectorOps] Add a BroadcastOp to the VectorOps dialectAart Bik2019-11-264-0/+85
| | | | | | | | PiperOrigin-RevId: 282643305
| * Add OpenMP dialect to the dialect registryDavid Truby2019-11-261-0/+1
| | | | | | | | | | | | | | Closes tensorflow/mlir#244 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/244 from DavidTruby:openmp 30e2638ee678188575dd5aeb3f7fa51d93369f5f PiperOrigin-RevId: 282607397
| * Misc changes to lowering to SPIR-V.Mahesh Ravishankar2019-11-2610-69/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These changes to SPIR-V lowering while adding support for lowering SUbViewOp, but are not directly related. - Change the lowering of MemRefType to !spv.ptr<!spv.struct<!spv.array<...>[offset]>, ..> This is consistent with the Vulkan spec. - To enable testing a simple pattern of lowering functions is added to ConvertStandardToSPIRVPass. This is just used to convert the type of the arguments of the function. The added function lowering itself is not meant to be the way functions are eventually lowered into SPIR-V dialect. PiperOrigin-RevId: 282589644
| * Automated rollback of commit d60133f89bb08341718bb3132b19bc891f7d4f4dNicolas Vasilache2019-11-268-19/+19
| | | | | | | | PiperOrigin-RevId: 282574110
| * Relax restriction on affine_apply dim and symbol operandsNicolas Vasilache2019-11-262-31/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The affine_apply operation is currently "doubly" affine and conflates two things: 1. it applies an affine map to a list of values of type `index` that are defined as either dim or symbol 2. it restricts (and propagates constraints on) the provenance of dims and symbols to a small subset of ops for which more restrictive polyhedral constraints apply. Point 2. is related to the ability to form so-called static control parts and is related to dependence analysis and legality of transformations. Point 1. however is completely independent, the only local implication of dims and symbol for affine_apply is that dims compose while symbols concatenate as well as the structural constraint that dims may not be multiplied. The properties of composition and canonicalization in affine_apply are more generally useful. This CL relaxes the verifier on affine_apply so it can be used more generally. The relevant affine.for/if/load/store op verifiers already implement the dim and symbol checking. See this thread for the related discussion: https://groups.google.com/a/tensorflow.org/g/mlir/c/HkwCbV8D9N0/m/8srUNrX6CAAJ PiperOrigin-RevId: 282562517
| * Some minor corrections and improvements to LangRefAndrew Anderson2019-11-251-25/+26
| | | | | | | | | | | | | | | | | | | | Some productions in the LangRef were using undefined terminals and non-terminals, which have been added to the EBNF. The dialect type and dialect attribute productions matched precisely the same structure and have been deduplicated. The production for ssa-id was ambiguous but the fix is trivial (merging the leading '%') and has been applied. Closes tensorflow/mlir#265 PiperOrigin-RevId: 282470892
| * Add support for AttrSizedOperandSegments/AttrSizedResultSegmentsLei Zhang2019-11-259-39/+345
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain operations can have multiple variadic operands and their size relationship is not always known statically. For such cases, we need a per-op-instance specification to divide the operands into logical groups or segments. This can be modeled by attributes. This CL introduces C++ trait AttrSizedOperandSegments for operands and AttrSizedResultSegments for results. The C++ trait just guarantees such size attribute has the correct type (1D vector) and values (non-negative), etc. It serves as the basis for ODS sugaring that with ODS argument declarations we can further verify the number of elements match the number of ODS-declared operands and we can generate handy getter methods. PiperOrigin-RevId: 282467075
| * Use vector.InsertStridedSlice in Vector -> Vector unrollingNicolas Vasilache2019-11-253-28/+94
| | | | | | | | | | | | | | | | This CL uses the recently added op to finish the implementation of Vector -> Vector unrolling by replacing the "fake join op" by a series of InsertStridedSliceOp. Test is updated accordingly PiperOrigin-RevId: 282451126
| * Add a vector.InsertStridedSliceOpNicolas Vasilache2019-11-254-149/+337
| | | | | | | | | | | | This new op is the counterpart of vector.StridedSliceOp and will be used for in the pattern rewrites for vector unrolling. PiperOrigin-RevId: 282447414
| * Allow LLVM::ExtractElementOp to have non-i32 indices.MLIR Team2019-11-256-34/+40
| | | | | | | | | | | | Also change the text format a bit, so that indices are braced by squares. PiperOrigin-RevId: 282437095
| * Make std.divis and std.diviu support ElementsAttr folding.Ben Vanik2019-11-252-33/+91
| | | | | | | | PiperOrigin-RevId: 282434465
| * NFC: Actually expose the implementation of createGPUToSPIRVLoweringPass.Mahesh Ravishankar2019-11-251-2/+3
| | | | | | | | | | | | | | | | A mismatch in the function declaration and function definition, prevented the implementation of the createGPUToSPIRVLoweringPass from being exposed. PiperOrigin-RevId: 282419815
| * Add missing rule to generate SPIR-V ABI Attribute using tblgen to CMake.Mahesh Ravishankar2019-11-252-0/+6
| | | | | | | | PiperOrigin-RevId: 282415592
| * Update VectorContractionOp to take iterator types and index mapping ↵Andy Davis2019-11-254-76/+320
| | | | | | | | | | | | attributes compatible with linalg ops. PiperOrigin-RevId: 282412311
| * Changing directory shortcut for CPU/GPU runner utils.Christian Sigg2019-11-258-19/+19
| | | | | | | | | | | | | | Moving cuda-runtime-wrappers.so into subdirectory to match libmlir_runner_utils.so. Provide parent directory when running test and load .so from subdirectory. PiperOrigin-RevId: 282410749
| * De-duplicate EnumAttr overrides by defining defaultsLei Zhang2019-11-258-51/+19
| | | | | | | | | | | | | | EnumAttr should provide meaningful defaults so concrete instances do not need to duplicate the fields. PiperOrigin-RevId: 282398431
| * Introduce attributes that specify the final ABI for a spirv::ModuleOp.Mahesh Ravishankar2019-11-2521-292/+662
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To simplify the lowering into SPIR-V, while still respecting the ABI requirements of SPIR-V/Vulkan, split the process into two 1) While lowering a function to SPIR-V (when the function is an entry point function), allow specifying attributes on arguments and function itself that describe the ABI of the function. 2) Add a pass that materializes the ABI described in the function. Two attributes are needed. 1) Attribute on arguments of the entry point function that describe the descriptor_set, binding, storage class, etc, of the spv.globalVariable this argument will be replaced by 2) Attribute on function that specifies workgroup size, etc. (for now only workgroup size). Add the pass -spirv-lower-abi-attrs to materialize the ABI described by the attributes. This change makes the SPIRVBasicTypeConverter class unnecessary and is removed, further simplifying the SPIR-V lowering path. PiperOrigin-RevId: 282387587
OpenPOWER on IntegriCloud