summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * NFC - fix name / comments - isAccessInvariantUday Bondhugula2019-12-042-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - the name was misleading; this is really checking if a Value being used to index was loop IV invariant. Update comment. - the method is only used locally; what can be exposed in the future is isAccessInvariant(LoadOrStoreOp op, Value *iv) Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#285 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/285 from bondhugula:quickfix fe5837abe987980c4ab469a9aa7de8e4f0007d9f PiperOrigin-RevId: 283771923
| * [spirv] Adding sqrt op in the GLSL extension.Scott Todd2019-12-043-1/+69
| | | | | | | | PiperOrigin-RevId: 283769736
| * Loop coalescing: fix pointer chainsing in use-chain traversalAlex Zinenko2019-12-042-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the replaceAllUsesExcept utility function called from loop coalescing the iteration over the use-chain is incorrect. The use list nodes (IROperands) have next/prev links, and bluntly resetting the use would make the loop to continue on uses of the value that was replaced instead of the original one. As a result, it could miss the existing uses and update the wrong ones. Make sure we increment the iterator before updating the use in the loop body. Reported-by: Uday Bondhugula <uday@polymagelabs.com> Closes tensorflow/mlir#291. PiperOrigin-RevId: 283754195
| * Added new FAbs, FCeil, Cos, Neg, Sign, Tanh operations.Julian Gross2019-12-043-242/+534
| | | | | | | | | | | | | | Closes tensorflow/mlir#251 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/251 from dfki-jugr:new_ops 0398997bf9953016898f873068e22916a062eb2b PiperOrigin-RevId: 283750699
| * Adds support for unrolling single-result vector operations with iterator ↵Andy Davis2019-12-045-21/+432
| | | | | | | | | | | | | | | | type lists and indexing maps to a target vector size. Adds unit tests for unrolling the vector ContractionOp with different iteration orders. PiperOrigin-RevId: 283747503
| * minor spelling tweaksKazuaki Ishizaki2019-12-048-12/+12
| | | | | | | | | | | | | | Closes tensorflow/mlir#250 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/250 from kiszk:spelling_tweaks_201911 50fc04443723190b764e824b6fcd2469fecb56e6 PiperOrigin-RevId: 283733032
| * Avoid variable name conflict in MLIR tutorial code snippetSmit Hinsu2019-12-031-4/+5
| | | | | | | | PiperOrigin-RevId: 283682865
| * Refactor dependencies to expose Vector transformations as patterns - NFCNicolas Vasilache2019-12-0329-88/+210
| | | | | | | | | | | | | | | | | | This CL refactors some of the MLIR vector dependencies to allow decoupling VectorOps, vector analysis, vector transformations and vector conversions from each other. This makes the system more modular and allows extracting VectorToVector into VectorTransforms that do not depend on vector conversions. This refactoring exhibited a bunch of cyclic library dependencies that have been cleaned up. PiperOrigin-RevId: 283660308
| * [spirv] Add spv.GroupNonUniformBallotLei Zhang2019-12-037-7/+170
| | | | | | | | | | | | | | | | | | This CL also did the following cleanup: - Moved the test for spv.SubgroupBallotKHR to its own file - Wrapped generated canonicalization patterns in anonymous namespace - Updated header comments in SPVOps.td PiperOrigin-RevId: 283650091
| * Add a pass to legalize operations before lowering to SPIR-V.Mahesh Ravishankar2019-12-039-2/+362
| | | | | | | | | | | | | | | | | | | | | | | | Not all StandardOps can be lowered to SPIR-V. For example, subview op implementation requires use of pointer bitcasts which is not valid according to SPIR-V spec (or at least is ambiguous about it). Such ops need to be removed/transformed before lowering to SPIR-V. The SPIRVLegalizationPass is added a place where such legalizations can be added. Current implementation folds the subview ops with load/stores so that the lowering itself does not have to convert a subview op. PiperOrigin-RevId: 283642981
| * Make diagnostic a bit clearer.Sean Silva2019-12-032-2/+2
| | | | | | | | | | | | This prints out in case of any pass failure. Not just a crash. PiperOrigin-RevId: 283616719
| * Add CreateMaskOp to the VectorOps dialect.Andy Davis2019-12-034-1/+84
| | | | | | | | PiperOrigin-RevId: 283591888
| * Verifier: Better error message in case of successor operand mismatch.Sean Silva2019-12-032-7/+23
| | | | | | | | | | | | In particular, print the successor number in the diagnostic. PiperOrigin-RevId: 283585084
| * Allow analyses to provide a hook 'isInvalidated' to determine if they are ↵River Riddle2019-12-033-9/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | truly invalidated. The hook has the following form: * `bool isInvalidated(const AnalysisManager::PreservedAnalyses &)` Given a preserved analysis set, the analysis returns true if it should truly be invalidated. This allows for more fine-tuned invalidation in cases where an analysis wasn't explicitly marked preserved, but may be preserved(or invalidated) based upon other properties; such as analyses sets. PiperOrigin-RevId: 283582889
| * Convert MemRefType to a linearized array in SPIR-V lowering.Mahesh Ravishankar2019-12-034-80/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SPIR-V lowering used nested !spv.arrays to represented multi-dimensional arrays, with the hope that in-conjunction with the layout annotations, the shape and layout of memref can be represented directly. It is unclear though how portable this representation will end up being. It will rely on driver compilers implementing complex index computations faithfully. A more portable approach is to use linearized arrays to represent memrefs and explicitly instantiate all the index computation in SPIR-V. This gives added benefit that we can further optimize the generated code in MLIR before generating the SPIR-V binary. PiperOrigin-RevId: 283571167
| * 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
OpenPOWER on IntegriCloud