summaryrefslogtreecommitdiffstats
path: root/mlir
Commit message (Collapse)AuthorAgeFilesLines
...
* Add "[TOC]" to generated documentationMLIR Team2019-10-291-0/+3
| | | | PiperOrigin-RevId: 277354482
* Bugfix: Keep worklistMap in sync with worklist in GreedyPatternRewriterDiego Caballero2019-10-291-0/+1
| | | | | | | | | | | When we removed a pattern, we removed it from worklist but not from worklistMap. Then, when we tried to add a new pattern on the same Operation again, the pattern wasn't added since it already existed in the worklistMap (but not in the worklist). Closes tensorflow/mlir#211 PiperOrigin-RevId: 277319669
* [spirv] Use LLVM graph traversal utility for PrettyBlockOrderVisitorLei Zhang2019-10-291-72/+33
| | | | | | | This removes a bunch of special tailored DFS code in favor of the common LLVM utility. Besides, we avoid recursion with system stack given that llvm::depth_first_ext is iterator based and maintains its own stack. PiperOrigin-RevId: 277272961
* Add a convenient operation build method for spirv::SelectOpMahesh Ravishankar2019-10-282-0/+9
| | | | | | | | The SelectOp always has the same result type as its true/false value. Add a builder method that uses the operand type to get the result type. PiperOrigin-RevId: 277217978
* [spirv] Support OpPhi using block argumentsLei Zhang2019-10-285-116/+657
| | | | | | | | | | This CL adds another control flow instruction in SPIR-V: OpPhi. It is modelled as block arguments to be idiomatic with MLIR. See the rationale.md doc for "Block Arguments vs PHI nodes". Serialization and deserialization is updated to convert between block arguments and SPIR-V OpPhi instructions. PiperOrigin-RevId: 277161545
* Parse locations in parseGenericOperationSean Silva2019-10-283-14/+21
| | | | | | | | | For ops that recursively re-enter the parser to parse an operation (such as ops with a "wraps" pretty form), this ensures that the wrapped op will parse its location, which can then be used for the locations of the wrapping op and any other implicit ops. PiperOrigin-RevId: 277152636
* Standardize Linalg transformations to take an OpBuilder and an ↵Nicolas Vasilache2019-10-287-81/+114
| | | | | | | | OperationFolder - NFC This will be used to specify declarative Linalg transformations in a followup CL. In particular, the PatternRewrite mechanism does not allow folding and has its own way of tracking erasure. PiperOrigin-RevId: 277149158
* Add support for marking an operation as recursively legal.River Riddle2019-10-285-82/+257
| | | | | | | | | | | | | | | | | | | | | In some cases, it may be desirable to mark entire regions of operations as legal. This provides an additional granularity of context to the concept of "legal". The `ConversionTarget` supports marking operations, that were previously added as `Legal` or `Dynamic`, as `recursively` legal. Recursive legality means that if an operation instance is legal, either statically or dynamically, all of the operations nested within are also considered legal. An operation can be marked via `markOpRecursivelyLegal<>`: ```c++ ConversionTarget &target = ...; /// The operation must first be marked as `Legal` or `Dynamic`. target.addLegalOp<MyOp>(...); target.addDynamicallyLegalOp<MySecondOp>(...); /// Mark the operation as always recursively legal. target.markOpRecursivelyLegal<MyOp>(); /// Mark optionally with a callback to allow selective marking. target.markOpRecursivelyLegal<MyOp, MySecondOp>([](Operation *op) { ... }); /// Mark optionally with a callback to allow selective marking. target.markOpRecursivelyLegal<MyOp>([](MyOp op) { ... }); ``` PiperOrigin-RevId: 277086382
* Print reason why dynamic library could not be loaded during execution.Christian Sigg2019-10-281-1/+2
| | | | PiperOrigin-RevId: 277037138
* Lookup function declaration in SymbolTable not ModuleOp.Alexander Belyaev2019-10-281-4/+2
| | | | PiperOrigin-RevId: 277033167
* Fix include guards and add tests for OpToFuncCallLowering.Alexander Belyaev2019-10-263-7/+49
| | | | PiperOrigin-RevId: 276859463
* Define AnyRankedTensor Type in TableGenSmit Hinsu2019-10-253-0/+33
| | | | PiperOrigin-RevId: 276714649
* Add support for parsing multiple result name groups.River Riddle2019-10-252-48/+47
| | | | | | | | | | | | This allows for parsing things like: %name_1, %name_2:5, %name_3:2 = "my.op" ... This is useful for operations that have groups of variadic result values. The total number of results is expected to match the number of results defined by the operation. PiperOrigin-RevId: 276703280
* [spirv] AccessChainOp canonicalization.Denis Khalikov2019-10-243-3/+99
| | | | | | | | | | Combine chained `spirv::AccessChainOp` operations into one `spirv::AccessChainOp` operation. Closes tensorflow/mlir#198 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/198 from denis0x0D:sandbox/canon_access_chain 0cb87955a85511071143d62637ff939d0dabc2bd PiperOrigin-RevId: 276609345
* Convert the Canonicalize and CSE passes to generic Operation Passes.River Riddle2019-10-2425-89/+83
| | | | | | This allows for them to be used on other non-function, or even other function-like, operations. The algorithms are already generic, so this is simply changing the derived pass type. The majority of this change is just ensuring that the nesting of these passes remains the same, as the pass manager won't auto-nest them anymore. PiperOrigin-RevId: 276573038
* Add support for replacing all uses of a symbol.River Riddle2019-10-244-45/+259
| | | | | | This requires reconstructing the attribute dictionary of each operation containing a use. PiperOrigin-RevId: 276520544
* Add missing dependency on MLIRIR on MLIREDSCInterfaceMehdi Amini2019-10-241-0/+1
| | | | | | | | MLIRIR includes generated header for interfaces, including these headers require an extra dependency to ensure these headers are generated before we attempt to build MLIREDSCInterface. PiperOrigin-RevId: 276518255
* Add custom lowering of ExpOp for NVVM and ROCM.Alexander Belyaev2019-10-244-1/+112
| | | | PiperOrigin-RevId: 276440911
* Wrap ODS to 80 lines and remove const qualifier for local `int` variable (NFC)Alexander Belyaev2019-10-232-4/+5
| | | | | | This addresses post-submit comments on 00d2a37e32 PiperOrigin-RevId: 276419770
* Add @below and @above directives to verify-diagnostics.River Riddle2019-10-235-314/+357
| | | | | | | | | | | | | | | | | | This simplifies defining expected-* directives when there are multiple that apply to the next or previous line. @below applies the directive to the next non-designator line, i.e. the next line that does not contain an expected-* designator. @above applies to the previous non designator line. Examples: // Expect an error on the next line that does not contain a designator. // expected-remark@below {{remark on function below}} // expected-remark@below {{another remark on function below}} func @bar(%a : f32) // Expect an error on the previous line that does not contain a designator. func @baz(%a : f32) // expected-remark@above {{remark on function above}} // expected-remark@above {{another remark on function above}} PiperOrigin-RevId: 276369085
* Fix "set-but-unused" warning in DialectConversionAlex Zinenko2019-10-231-0/+1
| | | | | | | The variable in question is only used in an assertion, leading to a warning in opt builds. PiperOrigin-RevId: 276352259
* NFC: Remove references to the toy.generic attribute.River Riddle2019-10-236-41/+8
| | | | | | This was used for shape inference in the previous tutorial flow. PiperOrigin-RevId: 276351916
* Drop MemRefUtils from the ExecutionEngineAlex Zinenko2019-10-234-163/+0
| | | | | | | | | | The ExecutionEngine was updated recently to only take the LLVM dialect as input. Memrefs are no longer expected in the signature of the entry point function by the executor so there is no need to allocate and free them. The code in MemRefUtils is therefore dead and furthermore out of sync with the recent evolution of memref type to support strides. Drop it. PiperOrigin-RevId: 276272302
* Update chapter 3 code snippet to match the actual output of the codeMLIR Team2019-10-221-2/+1
| | | | PiperOrigin-RevId: 276117540
* Update loop.for verifier messageUday Bondhugula2019-10-222-3/+3
| | | | | | | | | fix: nonnegative -> positive Closes tensorflow/mlir#206 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/206 from bondhugula:bondhugula-patch-1 9a47ca7dfd230180a9df33e9a64b33d02252d30a PiperOrigin-RevId: 276060885
* Expose optimizations flags in Python bindingsAlex Zinenko2019-10-221-3/+30
| | | | | | | | | ExecutionEngine currently supports additional parameters that can be used to run LLVM transformations during JIT compilation. Expose this to Python bindings. When the ExecutionEngine functionality is moved to LLVM, the bindings-specific code can be updated to interact with LLVM. PiperOrigin-RevId: 276060475
* NFC: Remove a right parenthesis from comment.Hanhan Wang2019-10-211-1/+1
| | | | PiperOrigin-RevId: 275998781
* NFC: Add support for parsing attributes programmatically via ↵River Riddle2019-10-212-9/+60
| | | | | | | | mlir::parseAttribute. This matches the behavior of the public mlir::parseType, and even uses the internal implementation. PiperOrigin-RevId: 275989777
* [DRR] Allow interleaved operands and attributesLei Zhang2019-10-215-38/+101
| | | | | | | | Previously DRR assumes attributes to appear after operands. This was the previous requirements on ODS, but that has changed some time ago. Fix DRR to also support interleaved operands and attributes. PiperOrigin-RevId: 275983485
* [spirv] Allow block arguments on spv.Branch(Conditional)Lei Zhang2019-10-215-36/+106
| | | | | | | | | | | | We will use block arguments as the way to model SPIR-V OpPhi in the SPIR-V dialect. This CL also adds a few useful helper methods to both ops to get the block arguments. Also added tests for branch weight (de)serialization. PiperOrigin-RevId: 275960797
* Use LLVM_Type instead of AnyType in the definition of LLVM_CallOpAlex Zinenko2019-10-212-5/+3
| | | | | | | | | | The type constraint had to be relaxed due to the order of lowering passes in the examples, that since has been fixed. The relaxed version was still used by the CUDA lowering for launch sizes of `index` type. This is not necessary since the GPU dialect does not restrict the type of the launch size operands. Use an LLVM type instead and restore the check in the LLVM_CallOp definition. PiperOrigin-RevId: 275920109
* Cleanup and rewrite Ch-4.md.River Riddle2019-10-2110-90/+370
| | | | | | This change rewrites Ch-4.md to introduced interfaces in a detailed step-by-step manner, adds examples, and fixes some errors. PiperOrigin-RevId: 275887017
* NFC: Fix remaining usages of MulOp as matrix multiplication.River Riddle2019-10-2119-214/+177
| | | | | | MulOp now represents an element-wise multiplication instead of a matrix multiplication. PiperOrigin-RevId: 275886774
* Unify GPU op definition names with other dialects.Christian Sigg2019-10-218-42/+49
| | | | | | Rename GPU op names from gpu_Foo to GPU_FooOp. PiperOrigin-RevId: 275882232
* NFC: Elide the value of a UnitAttr within nested attribute dictionaries.River Riddle2019-10-212-3/+12
| | | | | | This matches the behavior of the top level attribute dictionary. PiperOrigin-RevId: 275879828
* Add a Symbol trait to simplify defining operations that represent symbols.River Riddle2019-10-2110-44/+79
| | | | | | This trait provides accessors for the name, symbol use list methods, verification, with more to be added. PiperOrigin-RevId: 275864554
* NFC: Fix typo : Retur -> ReturnRiver Riddle2019-10-206-6/+6
| | | | PiperOrigin-RevId: 275745931
* Update Ch1 to reflect new changes in the tutorial.River Riddle2019-10-201-21/+21
| | | | | | The chapter list is out of date, as well as mentions of matrix multiplication(now element-wise multiplication). PiperOrigin-RevId: 275744911
* [DRR] Address GCC warning by wrapping for statement body with {}Lei Zhang2019-10-201-1/+2
| | | | | | | Otherwise, we'll see the following warning when compiling with GCC 8: warning: this ?for? clause does not guard... [-Wmisleading-indentation] PiperOrigin-RevId: 275735925
* Fix minor spelling tweaks (NFC)Kazuaki Ishizaki2019-10-2040-62/+62
| | | | | | Closes tensorflow/mlir#175 PiperOrigin-RevId: 275726876
* Fix minor spelling tweaks (NFC)Kazuaki Ishizaki2019-10-2038-106/+107
| | | | | | Closes tensorflow/mlir#177 PiperOrigin-RevId: 275692653
* Add SourceMgrDiagnosticHandler to toyJacques Pienaar2019-10-193-9/+15
| | | | PiperOrigin-RevId: 275659433
* Add missing include to StringMap in Verifier and DialectConversion.Jacques Pienaar2019-10-192-0/+3
| | | | PiperOrigin-RevId: 275656416
* Add missing include to llvm Allocator.hMehdi Amini2019-10-192-2/+2
| | | | | | This header is not self-contained otherwise. PiperOrigin-RevId: 275651582
* Slight rewording in toy ch2 to make persistence of name clearerJacques Pienaar2019-10-191-5/+7
| | | | PiperOrigin-RevId: 275650756
* Use new eraseOp instead of replaceOp with empty valuesGeoffrey Martin-Noble2019-10-194-5/+5
| | | | PiperOrigin-RevId: 275631166
* Get active source lane predicate from shuffle instruction.Christian Sigg2019-10-199-33/+117
| | | | | | | | nvvm.shfl.sync.bfly optionally returns a predicate whether source lane was active. Support for this was added to clang in https://reviews.llvm.org/D68892. Add an optional 'pred' unit attribute to the instruction to return this predicate. Specify this attribute in the partial warp reduction so we don't need to manually compute the predicate. PiperOrigin-RevId: 275616564
* NFC: Cleanup the implementation of walkSymbolUses.River Riddle2019-10-182-68/+45
| | | | | | Refactor the implementation to be much cleaner by adding a `make_second_range` utility to walk the `second` value of a range of pairs. PiperOrigin-RevId: 275598985
* NFC: Add missing include for StringMap.River Riddle2019-10-181-0/+1
| | | | PiperOrigin-RevId: 275588019
* NFC: Rename SPIR-V serializer find*ID() to get*ID() to be consistentLei Zhang2019-10-182-30/+30
| | | | | | We use get*() in deserizer and other places across the codebase. PiperOrigin-RevId: 275582390
OpenPOWER on IntegriCloud