| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- introduce affine integer sets into the IR
- parse and print affine integer sets (both inline or outlined) similar to
affine maps
- use integer set for IfStmt's conditional, and implement parsing of IfStmt's
conditional
- fixed an affine expr paren omission bug while one this.
TODO: parse/represent/print MLValue operands to affine integer set references.
PiperOrigin-RevId: 207779408
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Implement a diagnostic hook in one of the paths in mlir-opt which
captures and reports the diagnostics nicely.
- Have the parser capture simple location information from the parser
indicating where each op came from in the source .mlir file.
- Add a verifyDominance() method to MLFuncVerifier to demo this, resolving b/112086163
- Add some PrettyStackTrace handlers to make crashes in the testsuite easier
to track down.
PiperOrigin-RevId: 207488548
|
|
|
|
| |
PiperOrigin-RevId: 207235956
|
|
|
|
| |
PiperOrigin-RevId: 206977161
|
|
|
|
|
|
|
|
|
|
|
|
| |
handlers and to feed them with errors and warnings produced by the compiler.
Enhance Operation to be able to get its own MLIRContext on demand, simplifying
some clients. Change the verifier to emit certain errors with the diagnostic
handler.
This is steps towards reworking the verifier and diagnostic propagation but is
itself not particularly useful. More to come.
PiperOrigin-RevId: 206948643
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and OtherType. Other type is now the thing that holds AffineInt, Control,
eventually Resource, Variant, String, etc. FloatType holds the floating point
types, and allows convenient query of isa<FloatType>().
This fixes issues where we allowed control to be the element type of tensor,
memref, vector. At the same time, ban AffineInt from being an element of a
vector/memref/tensor as well since we don't need it.
I updated the spec to match this as well.
PiperOrigin-RevId: 206361942
|
|
|
|
|
|
|
|
|
| |
The code for this has been convoluted. We shouldn't be doing a "*result =
simplified" below at 703 since the simplified expression would have already
been inserted by a simplify* method, whether it was a binary op expr or
something else.
PiperOrigin-RevId: 206114115
|
|
|
|
|
|
|
|
| |
from the bump pointer allocator.
- delete AffineExpr destructors.
PiperOrigin-RevId: 205943807
|
|
|
|
|
|
|
|
| |
While fixing this the parser-affine-map.mlir test started failing due to ordering of the printed affine maps. Even the existing CHECK-DAGs weren't enough to disambiguate; a partial match on one line precluded a total match on a following line.
The fix for this was easy - print the affine maps in reference order rather than in DenseMap iteration order.
PiperOrigin-RevId: 205843770
|
|
|
|
|
|
| |
Change the type of elementType and remove the cast to PrimitiveType.
PiperOrigin-RevId: 205698221
|
|
|
|
|
|
| |
Mostly whitespace changes, but this makes these files clang-format clean.
PiperOrigin-RevId: 205697599
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
| |
PiperOrigin-RevId: 205157390
|
|
|
|
| |
PiperOrigin-RevId: 204756982
|
|
|
|
| |
PiperOrigin-RevId: 204399402
|
|
|
|
| |
PiperOrigin-RevId: 204240947
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
| |
own requirements.
PiperOrigin-RevId: 203497491
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 203293376
|
|
|
|
|
|
| |
Instruction and AffineExpr. NFC.
PiperOrigin-RevId: 203287117
|
|
|
|
| |
PiperOrigin-RevId: 203227287
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
PiperOrigin-RevId: 201830967
|
|
|
|
| |
PiperOrigin-RevId: 201830793
|
|
vector types.
tensors and memref types are still TODO, and would be a good starter project
for someone.
PiperOrigin-RevId: 201782748
|