summaryrefslogtreecommitdiffstats
path: root/mlir/test/Examples/Toy
Commit message (Collapse)AuthorAgeFilesLines
* Fixed typo in Toy tutorial (second var e -> var f)Aart Bik2019-11-277-14/+14
| | | | PiperOrigin-RevId: 282810649
* Add Ch-7 of the toy tutorial detailing how to define new types.River Riddle2019-11-0710-0/+369
| | | | | | This chapter adds a new composite type to Toy, and shows the process of adding a new type to the IR, adding and updating operations to use it, and constant folding operations producing it. PiperOrigin-RevId: 279107885
* Cleanup and rewrite Ch-4.md.River Riddle2019-10-213-15/+9
| | | | | | 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-2114-131/+149
| | | | | | MulOp now represents an element-wise multiplication instead of a matrix multiplication. PiperOrigin-RevId: 275886774
* NFC: Fix typo : Retur -> ReturnRiver Riddle2019-10-206-6/+6
| | | | PiperOrigin-RevId: 275745931
* Add Ch.6 of the Toy tutorial.River Riddle2019-10-177-0/+246
| | | | | | This chapters introduces the notion of a full conversion, and adds support for lowering down to the LLVM dialect, LLVM IR, and thus code generation. PiperOrigin-RevId: 275337786
* Fix invalid transpose in example and add proper verification.River Riddle2019-10-161-36/+36
| | | | | | The transpose in the example had the same result type as its input, which is incorrect. PiperOrigin-RevId: 275186568
* Add Ch.5 of the toy tutorial.River Riddle2019-10-1610-139/+174
| | | | | | This chapter adds a partial lowering of toy operations, all but PrintOp, to a combination of the Affine and Std dialects. This chapter focuses on introducing the conversion framework, the benefits of partial lowering, and how easily dialects may co-exist in the IR. PiperOrigin-RevId: 275150649
* Add support for inlining toy call operations.River Riddle2019-10-161-0/+30
| | | | | | The GenericCallOp needed to have the CallOpInterface to be picked up by the inliner. This also adds a CastOp to perform shape casts that are generated during inlining. The casts generated by the inliner will be folded away after shape inference. PiperOrigin-RevId: 275150438
* Update Chapter 4 of the Toy tutorialSana Damani2019-10-166-67/+21
| | | | | | | | | | This Chapter now introduces and makes use of the Interface concept in MLIR to demonstrate ShapeInference. END_PUBLIC Closes tensorflow/mlir#191 PiperOrigin-RevId: 275085151
* Update comments in ast.toyJacques Pienaar2019-10-163-84/+87
| | | | PiperOrigin-RevId: 275084969
* Update Chapter 3 to demonstrate pattern match and rewrite optimizationsSana Damani2019-10-153-23/+20
| | | | | | | | | This is using Table-driven Declarative Rewrite Rules (DRR), the previous version of the tutorial only showed the C++ patterns. Closes tensorflow/mlir#187 PiperOrigin-RevId: 274852321
* Merge Ch3 of the Toy tutorial into chapter 2.River Riddle2019-10-142-5/+17
| | | | | | This effectively rewrites Ch.2 to introduce dialects, operations, and registration instead of deferring to Ch.3. This allows for introducing the best practices up front(using ODS, registering operations, etc.), and limits the opaque API to the chapter document instead of the code. PiperOrigin-RevId: 274724289
* Emit LLVM IR equivalent of sizeof when lowering alloc operationsAlex Zinenko2019-10-111-1/+1
| | | | | | | | | | | | | | | | | Originally, the lowering of `alloc` operations has been computing the number of bytes to allocate when lowering based on the properties of MLIR type. This does not take into account type legalization that happens when compiling LLVM IR down to target assembly. This legalization can widen the type, potentially leading to out-of-bounds accesses to `alloc`ed data due to mismatches between address computation that takes the widening into account and allocation that does not. Use the LLVM IR's equivalent of `sizeof` to compute the number of bytes to be allocated: %0 = getelementptr %type* null, %indexType 0 %1 = ptrtoint %type* %0 to %indexType adapted from http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt PiperOrigin-RevId: 274159900
* Update Ch.2 of the Toy tutorial.River Riddle2019-08-271-16/+15
| | | | | | | | The code and documentation for this chapter of the tutorial have been updated to follow the new flow. The toy 'array' type has been replaced by usages of the MLIR tensor type. The code has also been cleaned up and modernized. Closes tensorflow/mlir#101 PiperOrigin-RevId: 265744086
* Change the attribute dictionary syntax to separate name and value with '='.River Riddle2019-06-257-23/+23
| | | | | | | | | | | The current syntax separates the name and value with ':', but ':' is already overloaded by several other things(e.g. trailing types). This makes the syntax difficult to parse in some situtations: Old: "foo: 10 : i32" New: "foo = 10 : i32" PiperOrigin-RevId: 255097928
* Modify the syntax of the the ElementsAttrs to print the type as a colon type.River Riddle2019-06-257-11/+11
| | | | | | | | | This is the standard syntax for types on operations, and is also already used by IntegerAttr and FloatAttr. Example: dense<5> : tensor<i32> dense<[3]> : tensor<1xi32> PiperOrigin-RevId: 255069157
* Update the Parser to support parsing/printing DenseElementAttrs with a splat ↵River Riddle2019-06-193-3/+3
| | | | | | | | | value. The syntax for this is the same as 0-D tensors: dense<tensor<100x100x100xi32>, 10> dense<tensor<1x1x1xi64>, -5> PiperOrigin-RevId: 252907880
* Remove the Toy/* file path from the location check lines. This assumes a ↵River Riddle2019-06-015-135/+135
| | | | | | | | specific file path format that breaks on MSVC. -- PiperOrigin-RevId: 250549223
* Toy tutorial Chapter 5: Lowering to Linalg and LLVMMehdi Amini2019-04-087-0/+189
| | | | | | -- PiperOrigin-RevId: 242606796
* Change the asmprinter to use pretty syntax for dialect types when it can,Chris Lattner2019-04-078-42/+42
| | | | | | | | | | | | making the IR dumps much nicer. This is part 2/3 of the path to making dialect types more nice. Part 3/3 will slightly generalize the set of characters allowed in pretty types and make it more principled. -- PiperOrigin-RevId: 242249955
* NFC: Fix a few typos in the tutorials and one in the comment of ↵River Riddle2019-04-053-3/+3
| | | | | | | | FunctionAttr::dropFunctionReference. -- PiperOrigin-RevId: 242050934
* Add Chapter 4 for the Toy tutorial: shape inference, function ↵Mehdi Amini2019-04-056-0/+173
| | | | | | | | specialization, and basic combines -- PiperOrigin-RevId: 242050514
* Fix Toy Ch3 testing with CMakeMehdi Amini2019-04-031-0/+2
| | | | | | | | | Mainly a missing dependency caused the tests to pass if one already built the repo, but not from a clean (or incremental) build. -- PiperOrigin-RevId: 241852313
* Chapter 3 for Toy tutorial: introduction of a dialectMehdi Amini2019-04-036-3/+131
| | | | | | -- PiperOrigin-RevId: 241849162
* Chapter 2 of the Toy tutorialMehdi Amini2019-04-024-32/+150
| | | | | | | | | This introduces a basic MLIRGen through straight AST traversal, without dialect registration at this point. -- PiperOrigin-RevId: 241588354
* Initial version for chapter 1 of the Toy tutorialMehdi Amini2019-04-021-0/+71
-- PiperOrigin-RevId: 241549247
OpenPOWER on IntegriCloud