- Mar 30, 2019
-
-
Uday Bondhugula authored
PiperOrigin-RevId: 204240947
-
Uday Bondhugula authored
- 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
-
Jacques Pienaar authored
Fixes use-after-free ASAN failure. PiperOrigin-RevId: 204177796
-
Jacques Pienaar authored
Previously the errorReporter was incorrectly moved post creating the Lexer. PiperOrigin-RevId: 204077155
-
Chris Lattner authored
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
-
Chris Lattner authored
and AffineMapParser to localize the parsing productions that only make sense at the top level of a module, and within an affine map, respectively. NFC. PiperOrigin-RevId: 203966841
-
Chris Lattner authored
state into their own specialized parser subclasses. This is important, because a monolithic parser grows very large very quickly and we're already getting big. Doing this requires splitting mutable parser state out from Parser to its own ParserState class or into transient subclasses like CFGParser. This works better than having things like CFGFuncParserState which gets passed around everywhere, because we can put the parser methods on the new classes. This patch just does CFGFunc and MLFunc, but I'll follow up with AffineMaps (unless someone else wants to take it). PiperOrigin-RevId: 203871695
-
Tatiana Shpeisman authored
Implement OperationStmt. Refactor function printing to use FunctionState 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
-
Uday Bondhugula authored
affine expr parsing. - also make error messages uniform PiperOrigin-RevId: 203822686
-
Uday Bondhugula authored
- 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
-
Chris Lattner authored
prone to create things. PiperOrigin-RevId: 203703229
-
Jacques Pienaar authored
* check-parser-errors can match multiple errors per line; * Add offset notation to expected-error; PiperOrigin-RevId: 203625348
-
Chris Lattner authored
isn't actually constructing IR objects yet, it is eating the tokens and discarding them. PiperOrigin-RevId: 203616265
-
Jacques Pienaar authored
This avoids fall-through error in opt mode: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] PiperOrigin-RevId: 203616256
-
Chris Lattner authored
own requirements. PiperOrigin-RevId: 203497491
-
Chris Lattner authored
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
-
Chris Lattner authored
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
-
Chris Lattner authored
for attributes on operations. Split Operation out from OperationInst so it can be shared with OperationStmt one day. PiperOrigin-RevId: 203325366
-
Chris Lattner authored
PiperOrigin-RevId: 203293376
-
Chris Lattner authored
Instruction and AffineExpr. NFC. PiperOrigin-RevId: 203287117
-
Uday Bondhugula authored
PiperOrigin-RevId: 203227287
-
Uday Bondhugula authored
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
-
Tatiana Shpeisman authored
Basic representation and parsing of if and for statements. Loop headers and if statement conditions are not yet supported. PiperOrigin-RevId: 203211526
-
Jacques Pienaar authored
Add a default error reporter for the parser that uses the SourceManager to print the error. Also and OptResult enum (mirroring ParseResult) to make the behavior self-documenting. PiperOrigin-RevId: 203173647
-
Chris Lattner authored
in a container automatically maintain their parent pointers, and change storage from std::vector to the proper llvm::iplist type. PiperOrigin-RevId: 202889037
-
Chris Lattner authored
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
-
Uday Bondhugula authored
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 -
Chris Lattner authored
to share code a bit more, and fixes a diagnostic bug Uday pointed out where parseCommaSeparatedList would print the wrong diagnostic when the end signifier was not a ). PiperOrigin-RevId: 202676858
-
Chris Lattner authored
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
-
Tatiana Shpeisman authored
Representing function arguments is still TODO. Supporting instructions other than return is also TODO. PiperOrigin-RevId: 202570934
-
MLIR Team authored
- parsing affine map identifiers - place-holder classes for AffineMap - module contains a list of affine maps (defined at the top level). PiperOrigin-RevId: 202336919
-
Jacques Pienaar authored
For checking parse errors, the input file is split and failures reported per memory buffer. Simply reporting the errors loses the mapping back to the original file. Change the reporting to instead relate the error reported back to the original file. Use SourceMgr's PrintMessage consistently for errors and relates back to file being parsed. PiperOrigin-RevId: 202136152
-
Jacques Pienaar authored
Change from using FileCheck to directly verifying the message (simple substring checking) and line number of the error. PiperOrigin-RevId: 201955181
-
Jacques Pienaar authored
Add diagnostic reporter function to lexer/parser and use that from mlir-opt to report errors instead of having the lexer/parser print the errors. PiperOrigin-RevId: 201892004
-
Chris Lattner authored
references. PiperOrigin-RevId: 201872745
-
Jacques Pienaar authored
Add parsing tests with errors. Follows direct path of splitting file into test groups (using a marker) and parsing each section individually. The expected errors are checked using FileCheck and parser error does not result in terminating parsing the rest of the file if check-parser-error. This is an interim approach until refactoring lexer/parser. PiperOrigin-RevId: 201867941
-
MLIR Team authored
PiperOrigin-RevId: 201830967
-
MLIR Team authored
PiperOrigin-RevId: 201830793
-
Chris Lattner authored
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
-
Chris Lattner authored
vector types. tensors and memref types are still TODO, and would be a good starter project for someone. PiperOrigin-RevId: 201782748
-