- Mar 30, 2019
-
-
Jacques Pienaar authored
Change the type of elementType and remove the cast to PrimitiveType. PiperOrigin-RevId: 205698221
-
James Molloy authored
Mostly whitespace changes, but this makes these files clang-format clean. PiperOrigin-RevId: 205697599
-
MLIR Team authored
Clarify that the "integer" in primitive types is affine integer, not to be confused with IntegerType. PiperOrigin-RevId: 205688085
-
Chris Lattner authored
to all the things. Fill out the OneOperand trait class with support for getting and setting operands, allowing DimOp to have a working get/setOperand() method. I'm not thrilled with the extra template argument on OneOperand, I'll will investigate removing that in a follow-on patch. PiperOrigin-RevId: 205679696
-
Chris Lattner authored
PiperOrigin-RevId: 205666777
-
Chris Lattner authored
details, returning things in terms of values (which is what most clients want). Implement support for operands and results on Operation, and simplify the asmprinter to use it. PiperOrigin-RevId: 205608853
-
James Molloy authored
This patch adds support for basic block arguments including parsing and printing. In doing so noticed that `ssa-id-and-type` is undefined in the MLIR spec; suggested an implementation in the spec doc. PiperOrigin-RevId: 205593369
-
Chris Lattner authored
Add support for operands to the return instructions, enhance verifier to report errors through the diagnostics system when invoked by the parser. It doesn't have perfect location info, but it is close enough to be testable. PiperOrigin-RevId: 205534392
-
Chris Lattner authored
for forward references to the parser, add initial support for SSA use-list iteration and RAUW. PiperOrigin-RevId: 205484031
-
Jacques Pienaar authored
PiperOrigin-RevId: 205483944
-
Uday Bondhugula authored
Pass op token location where necessary so that errors on non-affine expressions are reported with accurate/meaningful location pointers. Before: /tmp/parser-affine-map-single.mlir:2:39: error: non-affine expression: at least one of the multiply operands has to be either a constant or symbolic #hello_world = (i, j) [s0, s1] -> (i*j, j) ^ After: /tmp/parser-affine-map-single.mlir:2:37: error: non-affine expression: at least one of the multiply operands has to be either a constant or symbolic #hello_world = (i, j) [s0, s1] -> (i*j, j) ^ PiperOrigin-RevId: 205458508 -
Chris Lattner authored
there is now an explicit state class - which only has one instance per top level FooThing::print call. The FunctionPrinter's now subclass ModulePrinter so they can just call print on their types and other global stuff. This also makes the contract strict that the global FooThing::print calls are the public entrypoints and that the printer implementation is otherwise self contained. No Functionality Change. PiperOrigin-RevId: 205409317
-
Chris Lattner authored
is still limited in several ways, which i'll build out in subsequent patches. Rename the accessor for inst operands/results to make the Operand/Result versions of these more obscure, allowing getOperand/getResult to traffic in values (which is what - by far - most clients actually care about). PiperOrigin-RevId: 205408439
-
Uday Bondhugula authored
- Drop sub-classing of affine binary op expressions. - Drop affine expr op kind sub. Represent it as multiply by -1 and add. This will also be in line with the math form when we'll need to represent a system of linear equalities/inequalities: the negative number goes into the coefficient of an affine form. (For eg. x_1 + (-1)*x_2 + 3*x_3 + (-2) >= 0). The folding simplification will transparently deal with multiplying the -1 with any other constants. This also means we won't need to simplify a multiply expression like in x_1 + (-2)*x_2 to a subtract expression (x_1 - 2*x_2) for canonicalization/uniquing. - When we print the IR, we will still pretty print to a subtract when possible. PiperOrigin-RevId: 205298958
-
Uday Bondhugula authored
PiperOrigin-RevId: 205288794
-
Tatiana Shpeisman authored
Loop bounds and presumed to be constants for now and are stored in ForStmt as affine constant expressions. ML function arguments, return statement operands and loop variable name are dropped for now. PiperOrigin-RevId: 205256208
-
Chris Lattner authored
- 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
-
Chris Lattner authored
iterators, along with type specific ones. Also provide mechanics to cast from Operation up to OperationStmt etc. PiperOrigin-RevId: 205175333
-
MLIR Team authored
PiperOrigin-RevId: 205157390
-
Chris Lattner authored
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
-
MLIR Team authored
PiperOrigin-RevId: 205096519
-
MLIR Team authored
PiperOrigin-RevId: 204999887
-
Jacques Pienaar authored
PiperOrigin-RevId: 204915682
-
Tatiana Shpeisman authored
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
-
MLIR Team authored
PiperOrigin-RevId: 204756982
-
Jacques Pienaar authored
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
-
Chris Lattner authored
is no strong reason to prefer one or the other, but // is nice for consistency given the rest of the compiler is written in C++. PiperOrigin-RevId: 204628476
-
Tatiana Shpeisman authored
PiperOrigin-RevId: 204614520
-
Tatiana Shpeisman authored
Use LLVM double-link with parent list to store statements within a block. PiperOrigin-RevId: 204515541
-
Uday Bondhugula authored
PiperOrigin-RevId: 204399402
-
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
-