summaryrefslogtreecommitdiffstats
path: root/mlir/examples/toy/Ch2
Commit message (Collapse)AuthorAgeFilesLines
* [MLIR] Fix broken link locations after move to monorepoDaniel Galvez2020-01-141-1/+1
| | | | | | | | | | I used the codemod python tool to do this with the following commands: codemod 'tensorflow/mlir/blob/master/include' 'llvm/llvm-project/blob/master/mlir/include' codemod 'tensorflow/mlir/blob/master' 'llvm/llvm-project/blob/master/mlir' codemod 'tensorflow/mlir' 'llvm-project/llvm' Differential Revision: https://reviews.llvm.org/D72244
* [mlir] NFC: Remove Value::operator* and Value::operator-> now that Value is ↵River Riddle2020-01-111-3/+2
| | | | | | | | | | properly value-typed. Summary: These were temporary methods used to simplify the transition. Reviewed By: antiagainst Differential Revision: https://reviews.llvm.org/D72548
* NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.River Riddle2019-12-233-27/+25
| | | | | | ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-2310-130/+40
| | | | PiperOrigin-RevId: 286906740
* NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to ↵River Riddle2019-12-223-28/+30
| | | | | | | | | | Value being value-typed. This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics. PiperOrigin-RevId: 286844725
* NFC: Use this-> to appease GCC bug related to template lambda.River Riddle2019-12-171-1/+1
| | | | | | | GCC is unable to properly implicitly capture 'this' in generic lambdas. This bug is not fixed until 7.1.0: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67274 PiperOrigin-RevId: 286083427
* NFC: Use TypeSwitch to simplify existing code.River Riddle2019-12-171-14/+10
| | | | PiperOrigin-RevId: 286066371
* Fix minor spelling tweaks.shanshanpt2019-12-091-1/+1
| | | | | | | Closes tensorflow/mlir#306 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/306 from shanshanpt:master 11430c2131281d84a432f45e854e29917b336e8d PiperOrigin-RevId: 284613648
* Minor spelling tweaksKazuaki Ishizaki2019-12-091-1/+1
| | | | | | Closes tensorflow/mlir#304 PiperOrigin-RevId: 284568358
* NFC: Remove unnecessarily guarded tablegen includes.River Riddle2019-11-221-2/+0
| | | | | | Support for including a file multiple times was added in tablegen, removing the need for these extra guards. This is because we already insert c/c++ style header guards within each of the specific .td files. PiperOrigin-RevId: 282076728
* Add support for nested symbol references.River Riddle2019-11-111-1/+1
| | | | | | | | | | | | | | | | | | This change allows for adding additional nested references to a SymbolRefAttr to allow for further resolving a symbol if that symbol also defines a SymbolTable. If a referenced symbol also defines a symbol table, a nested reference can be used to refer to a symbol within that table. Nested references are printed after the main reference in the following form: symbol-ref-attribute ::= symbol-ref-id (`::` symbol-ref-id)* Example: module @reference { func @nested_reference() } my_reference_op @reference::@nested_reference Given that SymbolRefAttr is now more general, the existing functionality centered around a single reference is moved to a derived class FlatSymbolRefAttr. Followup commits will add support to lookups, rauw, etc. for scoped references. PiperOrigin-RevId: 279860501
* Fix segfault (nullptr dereference) when passing a non-existent file to the ↵Mehdi Amini2019-11-091-0/+2
| | | | | | | | Toy tutorial compiler Fix tensorflow/mlir#229 PiperOrigin-RevId: 279557863
* NFC: Tidy up the implementation of operations in the Toy tutorialRiver Riddle2019-11-062-46/+53
| | | | | | Use header blocks to separate operation implementations, and switch the build methods to be out-of-line when possible. PiperOrigin-RevId: 278982913
* NFC: Uniformize parser naming scheme in Toy tutorial to camelCase and tidy a ↵River Riddle2019-11-066-215/+201
| | | | | | bit of the implementation. PiperOrigin-RevId: 278982817
* NFC: Use #ifndef in various .td files instead of #ifdef and #elseLei Zhang2019-10-311-4/+2
| | | | | | | | | | Upstream LLVM gained support for #ifndef with https://reviews.llvm.org/D61888 This is changed mechanically via the following command: find . -name "*.td" -exec sed -i -e ':a' -e 'N' -e '$!ba' -e 's/#ifdef \([A-Z_]*\)\n#else/#ifndef \1/g' {} \; PiperOrigin-RevId: 277789427
* NFC: Remove references to the toy.generic attribute.River Riddle2019-10-231-7/+1
| | | | | | This was used for shape inference in the previous tutorial flow. PiperOrigin-RevId: 276351916
* Fix minor spelling tweaks (NFC)Kazuaki Ishizaki2019-10-203-5/+5
| | | | | | Closes tensorflow/mlir#175 PiperOrigin-RevId: 275726876
* NFC: Remove trivial builder get methods.River Riddle2019-10-172-8/+8
| | | | | | These don't add any value, and some are even more restrictive than the respective static 'get' method. PiperOrigin-RevId: 275391240
* Fix invalid transpose in example and add proper verification.River Riddle2019-10-162-0/+18
| | | | | | The transpose in the example had the same result type as its input, which is incorrect. PiperOrigin-RevId: 275186568
* NFC: Remove NoSideEffect traits from all ops except for ConstantOp.River Riddle2019-10-161-4/+4
| | | | | | These traits are added in chapter 3 when we begin discussion optimization on the toy operations. PiperOrigin-RevId: 274974010
* NFC: Split out ToyOpsIncGen into a separate CMakeLists.txt.River Riddle2019-10-153-5/+6
| | | | | | This fixes an issue with make where it fails to properly handle the dependency ordering. PiperOrigin-RevId: 274897702
* Merge Ch3 of the Toy tutorial into chapter 2.River Riddle2019-10-146-88/+526
| | | | | | 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
* Fix typos, NFC.Christian Sigg2019-10-041-3/+3
| | | | PiperOrigin-RevId: 272851237
* Unify error messages to start with lower-case.MLIR Team2019-09-181-4/+4
| | | | PiperOrigin-RevId: 269803466
* Update Ch.2 of the Toy tutorial.River Riddle2019-08-274-220/+205
| | | | | | | | 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
* NFC: Move LLVMIR, SDBM, and StandardOps to the Dialect/ directory.River Riddle2019-08-191-1/+1
| | | | PiperOrigin-RevId: 264193915
* Change from llvm::make_unique to std::make_uniqueJacques Pienaar2019-08-172-23/+21
| | | | | | | | Switch to C++14 standard method as llvm::make_unique has been removed ( https://reviews.llvm.org/D66259). Also mark some targets as c++14 to ease next integrates. PiperOrigin-RevId: 263953918
* NFC: Update FuncOp::addEntryBlock to return the newly inserted block.River Riddle2019-08-071-3/+1
| | | | | | The entry block is often used recently after insertion. This removes the need to perform an additional lookup in such cases. PiperOrigin-RevId: 262265671
* Rename FunctionAttr to SymbolRefAttr.River Riddle2019-07-121-0/+1
| | | | | | This allows for the attribute to hold symbolic references to other operations than FuncOp. This also allows for removing the dependence on FuncOp from the base Builder. PiperOrigin-RevId: 257650017
* NFC: Rename Module to ModuleOp.River Riddle2019-07-101-3/+3
| | | | | | Module is a legacy name that only exists as a typedef of ModuleOp. PiperOrigin-RevId: 257427248
* Update ModuleOp::create(...) to take a Location instead of a context.River Riddle2019-07-101-1/+1
| | | | | | This allows for giving a Module a more interesting location than 'Unknown'. PiperOrigin-RevId: 257310117
* NFC: Rename Function to FuncOp.River Riddle2019-07-101-5/+5
| | | | PiperOrigin-RevId: 257293379
* Remove std::move of trivially-copyable type.Jacques Pienaar2019-07-081-1/+1
| | | | | | | | Address ClangTidy finding: * std::move of the expression of the trivially-copyable type 'mlir::Module' (aka 'mlir::ModuleOp') has no effect; remove std::move() PiperOrigin-RevId: 256981849
* NFC: Move the Function/Module/Operation::verify methods out-of-line.River Riddle2019-07-022-2/+4
| | | | | | As Functions/Modules becomes operations, these methods will conflict with the 'verify' hook already on derived operation types. PiperOrigin-RevId: 256246112
* NFC: Refactor Module to be value typed.River Riddle2019-07-023-12/+11
| | | | | | As with Functions, Module will soon become an operation, which are value-typed. This eases the transition from Module to ModuleOp. A new class, OwningModuleRef is provided to allow for owning a reference to a Module, and will auto-delete the held module on destruction. PiperOrigin-RevId: 256196193
* NFC: Refactor Function to be value typed.River Riddle2019-07-011-13/+15
| | | | | | Move the data members out of Function and into a new impl storage class 'FunctionStorage'. This allows for Function to become value typed, which will greatly simplify the transition of Function to FuncOp(given that FuncOp is also value typed). PiperOrigin-RevId: 255983022
* Move the emitError/Warning/Remark utility methods out of MLIRContext and ↵River Riddle2019-06-251-13/+10
| | | | | | | | into the mlir namespace. Now that Locations are attributes, they have direct access to the MLIR context. This allows for simplifying error emission by removing unnecessary context lookups. PiperOrigin-RevId: 255112791
* NFC: Uniformize the return of the LocationAttr 'get' methods to 'Location'.River Riddle2019-06-251-1/+1
| | | | PiperOrigin-RevId: 255078768
* NFC: Remove the 'context' parameter from OperationState.River Riddle2019-06-221-8/+8
| | | | | | Now that Locations are Attributes they contain a direct reference to the MLIRContext, i.e. the context can be directly accessed from the given location instead of being explicitly passed in. PiperOrigin-RevId: 254568329
* Replace usages of 'UniquedFilename' with 'Identifier' and remove it. ↵River Riddle2019-06-191-3/+2
| | | | | | Identifier already contains all of the necessary functionality/verification, so having a separate class for filenames is unnecessary. PiperOrigin-RevId: 253855505
* NFC: Rename FuncBuilder to OpBuilder and refactor to take a top level region ↵River Riddle2019-06-091-2/+2
| | | | | | instead of a function. PiperOrigin-RevId: 251563898
* Fix unused variable warning in the Toy tutorial (NFC)Mehdi Amini2019-05-101-1/+0
| | | | | | -- PiperOrigin-RevId: 247672377
* Fix bug in Toy tutorial where IR emission stopped after any `print`Mehdi Amini2019-04-081-1/+1
| | | | | | -- PiperOrigin-RevId: 242407970
* Change the asmprinter to use pretty syntax for dialect types when it can,Chris Lattner2019-04-071-1/+1
| | | | | | | | | | | | 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-051-1/+1
| | | | | | | | FunctionAttr::dropFunctionReference. -- PiperOrigin-RevId: 242050934
* Chapter 3 for Toy tutorial: introduction of a dialectMehdi Amini2019-04-031-6/+0
| | | | | | -- PiperOrigin-RevId: 241849162
* Rename UnknownType to OpaqueType (NFC)Mehdi Amini2019-04-031-2/+2
| | | | | | | | | This came up in a review of the tutorial, it was suggested that "opaque" is more descriptive than "unknown" here. -- PiperOrigin-RevId: 241832927
* Fix Toy tutorial gcc 7 build (NFC)Mehdi Amini2019-04-021-8/+2
| | | | | | -- PiperOrigin-RevId: 241613710
* Chapter 2 of the Toy tutorialMehdi Amini2019-04-028-0/+1968
This introduces a basic MLIRGen through straight AST traversal, without dialect registration at this point. -- PiperOrigin-RevId: 241588354
OpenPOWER on IntegriCloud