summaryrefslogtreecommitdiffstats
path: root/mlir/lib/IR
Commit message (Collapse)AuthorAgeFilesLines
...
* Add basic parser support for operands:Chris Lattner2019-03-291-0/+2
| | | | | | | | | | | - This introduces a new FunctionParser base class to handle logic common between the kinds of functions we have, e.g. ssa operand/def parsing. - This introduces a basic symbol table (without support for forward references!) and links defs and uses. - CFG functions now parse and build operand lists for operations. The printer isn't set up for them yet tho. PiperOrigin-RevId: 205246110
* Provide better factoring for the SSA types to allow type agnostic def/useChris Lattner2019-03-292-5/+6
| | | | | | | | iterators, along with type specific ones. Also provide mechanics to cast from Operation up to OperationStmt etc. PiperOrigin-RevId: 205175333
* Support for AffineMapAttr.MLIR Team2019-03-294-65/+100
| | | | PiperOrigin-RevId: 205157390
* Initial support for operands and results and SSA constructs, first onChris Lattner2019-03-292-3/+66
| | | | | | | | | | | the instruction side of the house. This has a number of limitations, including that we are still dropping operands on the floor in the parser. Also, most of the convenience methods aren't wired up yet. This is enough to get result type lists round tripping through. PiperOrigin-RevId: 205148223
* Address AsmPrinter changes from last CL.MLIR Team2019-03-291-120/+95
| | | | PiperOrigin-RevId: 205096519
* Adds ModuleState to support printing outlined AffineMaps.MLIR Team2019-03-292-114/+297
| | | | PiperOrigin-RevId: 204999887
* Parse operations in ML functions. Add builder class for ML functions.Tatiana Shpeisman2019-03-291-4/+3
| | | | | | | Refactors operation parsing to share functionality between CFG and ML functions. ML function construction now goes through a builder, similar to the way it is done for CFG functions. PiperOrigin-RevId: 204779279
* Adds MemRef type and adds support for parsing memref affine map composition.MLIR Team2019-03-293-3/+100
| | | | PiperOrigin-RevId: 204756982
* Move newline printed with op to function/basic block printer.Jacques Pienaar2019-03-292-8/+13
| | | | | | Allows printing the instruction to string without trailing newline. Making it easier to reuse print to annotate instructions during lowering. And removes need for newline in the print functions of ops. PiperOrigin-RevId: 204630791
* Use LLVM dynamic dispatch to disambiguate between StmtBlock subclasses.Tatiana Shpeisman2019-03-293-15/+16
| | | | PiperOrigin-RevId: 204614520
* Refactor implementation of Statement class heirarchy to use statement block.Tatiana Shpeisman2019-03-294-52/+157
| | | | | | Use LLVM double-link with parent list to store statements within a block. PiperOrigin-RevId: 204515541
* Comment fixes for affine map range size parsing.Uday Bondhugula2019-03-291-3/+1
| | | | PiperOrigin-RevId: 204399402
* Parse affine map range sizes.Uday Bondhugula2019-03-294-9/+30
| | | | PiperOrigin-RevId: 204240947
* Implement some simple affine expr canonicalization/simplification.Uday Bondhugula2019-03-293-111/+189
| | | | | | | | | | | | | | | - fold constants when possible. - for a mul expression, canonicalize to always keep the LHS as the constant/symbolic term, and similarly, the RHS for an add expression to keep it closer to the mathematical form. (Eg: f(x) = 3*x + 5)); other similar simplifications; - verify binary op expressions at creation time. TODO: we can completely drop AffineSubExpr, and instead use add and mul by -1. This way something like x - 4 and -4 + x get canonicalized to x + -1 * 4 instead of being x - 4 and x + -4. (The other alternative if wanted to retain AffineSubExpr would be to simplify x + -1*y to x - y and x + <neg number> to x - <pos number>). PiperOrigin-RevId: 204240258
* Add attributes and affine expr/map to the Builder, switch the parser over toChris Lattner2019-03-293-38/+114
| | | | | | | | | | use it. This also removes "operand" from the affine expr classes: it is unnecessary verbosity and "operand" will mean something very specific for SSA stuff (we will have an Operand type). PiperOrigin-RevId: 203976504
* Implement OperationStmt. Refactor function printing to use FunctionState ↵Tatiana Shpeisman2019-03-291-30/+53
| | | | | | class for operation printing. FunctionState class is a base class for CFGFunctionState and MLFunctionState classes. No parsing yet - will add once cl/203785893 is in. PiperOrigin-RevId: 203862427
* Complete affine expr parsing supportUday Bondhugula2019-03-294-30/+166
| | | | | | | | | | - check for non-affine expressions - handle negative numbers and negation of id's, expressions - functions to check if a map is pure affine or semi-affine - simplify/clean up affine map parsing code - report more errors messages, more accurate error messages PiperOrigin-RevId: 203773633
* Introduce the start of IR builder APIs, which makes it easier and less errorChris Lattner2019-03-292-3/+60
| | | | | | prone to create things. PiperOrigin-RevId: 203703229
* Change to assert(0,x) to llvm_unreachable(x)Jacques Pienaar2019-03-291-1/+1
| | | | | | | This avoids fall-through error in opt mode: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] PiperOrigin-RevId: 203616256
* Implement a simple IR verifier, including support for custom ops adding theirChris Lattner2019-03-293-0/+184
| | | | | | own requirements. PiperOrigin-RevId: 203497491
* Implement Uday's suggestion to unique attribute lists across instructions,Chris Lattner2019-03-293-9/+184
| | | | | | | | | reducing the memory impact on Operation to one word instead of 3 from an std::vector. Implement Jacques' suggestion to merge OpImpl::Storage into OpImpl::Base. PiperOrigin-RevId: 203426518
* Add the ability to have "Ops" defined as small C++ classes, with some niceChris Lattner2019-03-296-2/+132
| | | | | | | | | | | | | | | | | properties: - They allow type checked dynamic casting from their base Operation. - They allow nice accessors for C++ clients, e.g. a "getIndex()" method on 'dim' that returns an unsigned. - They work with both OperationInst/OperationStmt (once OperationStmt is implemented). - They get custom printing logic. They will eventually get custom parsing, verifier, and builder logic as well. - Out of tree clients can register their own operation set without having to change MLIR core, e.g. for TensorFlow or custom target instructions. This registers addf and dim as examples. PiperOrigin-RevId: 203382993
* Add parsing for attributes and attibutes on operations. Add IR representationChris Lattner2019-03-293-10/+66
| | | | | | | for attributes on operations. Split Operation out from OperationInst so it can be shared with OperationStmt one day. PiperOrigin-RevId: 203325366
* Implement IR support for attributes.Chris Lattner2019-03-292-25/+181
| | | | PiperOrigin-RevId: 203293376
* Clean up the implementation of Type, making it structurally more similar toChris Lattner2019-03-292-21/+20
| | | | | | Instruction and AffineExpr. NFC. PiperOrigin-RevId: 203287117
* Clean up an MLIRContext commentUday Bondhugula2019-03-291-4/+2
| | | | PiperOrigin-RevId: 203227287
* Parsing support for affine maps and affine expressionsUday Bondhugula2019-03-293-33/+197
| | | | | | | | A recursive descent parser for affine maps/expressions with operator precedence and associativity. (While on this, sketch out uniqui'ing functionality for affine maps and affine binary op expressions (partly).) PiperOrigin-RevId: 203222063
* Basic representation and parsing of if and for statements. Loop headers and ↵Tatiana Shpeisman2019-03-293-35/+134
| | | | | | if statement conditions are not yet supported. PiperOrigin-RevId: 203211526
* Improve management of instructions and basic blocks by having their inclusionChris Lattner2019-03-293-19/+145
| | | | | | | in a container automatically maintain their parent pointers, and change storage from std::vector to the proper llvm::iplist type. PiperOrigin-RevId: 202889037
* Enhance the type system to support arbitrary precision integers, which areChris Lattner2019-03-292-37/+54
| | | | | | | | | important for low-bitwidth inference cases and hardware synthesis targets. Rename 'int' to 'affineint' to avoid confusion between "the integers" and "the int type". PiperOrigin-RevId: 202751508
* [WIP] Sketching IR and parsing support for affine maps, affine expressionsUday Bondhugula2019-03-294-12/+92
| | | | | | | | | | | Run test case: $ mlir-opt test/IR/parser-affine-map.mlir test/IR/parser-affine-map.mlir:3:30: error: expect '(' at start of map range #hello_world2 (i, j) [s0] -> i+s0, j) ^ PiperOrigin-RevId: 202736856
* Sketch out parser/IR support for OperationInst, and a new Instruction baseChris Lattner2019-03-293-11/+75
| | | | | | | | | | class. Introduce an Identifier class to MLIRContext to represent uniqued identifiers, introduce string literal support to the lexer, introducing parser and printer support etc. PiperOrigin-RevId: 202592007
* Introduce IR and parser support for ML functions.Tatiana Shpeisman2019-03-293-0/+52
| | | | | | | Representing function arguments is still TODO. Supporting instructions other than return is also TODO. PiperOrigin-RevId: 202570934
* Add some scaffolding for parsing affine maps:MLIR Team2019-03-292-0/+54
| | | | | | | | - parsing affine map identifiers - place-holder classes for AffineMap - module contains a list of affine maps (defined at the top level). PiperOrigin-RevId: 202336919
* Add the unconditional branch instruction, improve diagnostics for blockChris Lattner2019-03-293-1/+10
| | | | | | references. PiperOrigin-RevId: 201872745
* Remove unused UnrankedTensorTypeKeyInfo.MLIR Team2019-03-291-16/+0
| | | | PiperOrigin-RevId: 201830967
* Add tensor type.MLIR Team2019-03-292-0/+126
| | | | PiperOrigin-RevId: 201830793
* Implement parser/IR support for CFG functions, basic blocks and return ↵Chris Lattner2019-03-295-40/+240
| | | | | | | | | | instruction. This is pretty much minimal scaffolding for this step. Basic block arguments, instructions, other terminators, a proper IR representation for blocks/instructions, etc are all coming. PiperOrigin-RevId: 201826439
* Introduce IR support for MLIRContext, primitive types, function types, andChris Lattner2019-03-293-2/+293
| | | | | | | | | vector types. tensors and memref types are still TODO, and would be a good starter project for someone. PiperOrigin-RevId: 201782748
* Continue sketching out basic infrastructure, including an input and outputChris Lattner2019-03-292-5/+43
| | | | | | | filename, and printing of trivial stuff. There is no parser yet, so the input file is ignored. PiperOrigin-RevId: 201596916
* Sketch out a new repository for the mlir project (go/mlir).Chris Lattner2019-03-291-0/+27
PiperOrigin-RevId: 201540159
OpenPOWER on IntegriCloud