Commit Graph

17 Commits

Author SHA1 Message Date
Jacques Pienaar dcab80115f Add SameOperandsAndResultElementType trait.
This trait only works for tensor and vector types at the moment, verifying that the element type of an op with only tensor and vector types match. Added a unit test for it as there is no op currently in core that uses this trait.

--

PiperOrigin-RevId: 246661697
2019-05-06 08:28:59 -07:00
Alex Zinenko 9de199676f Implement the conversion between SDBMExpr and AffineExpr
Since SDBM expressions are a subset of affine expressions, they can be
    converted to affine expressions in a straightforward way.  The inverse
    conversion may fail when the affine expression is not an SDBM.  Implement the
    inverse convresion assuming affine expressions are simplified and
    canonicalizied, detect subtractive and multiplicative forms of the stripe
    operation.

--

PiperOrigin-RevId: 245494735
2019-05-06 08:18:31 -07:00
Alex Zinenko 24d0f60d31 Start building SDBM infrastructure
Striped difference-bound matrix expressions are a subset of affine expressions
    supporting low-complexity algorithms that can be useful for loop
    transformations.  This introduces the basic data data structures for building
    such expressions and unique'ing them in a MLIRContext.

--

PiperOrigin-RevId: 245380206
2019-05-06 08:17:42 -07:00
Lei Zhang 05dfb1c7e0 Fix MLIRTableGenTests target_link_libraries typo
--

PiperOrigin-RevId: 244168112
2019-04-18 11:50:19 -07:00
Lei Zhang 48a6aa6c51 [TableGen] Better support for predicate and rewrite rule specification
Currently predicates are written with positional placeholders `{N}` and rely on
    `formatv` as the engine to do substitution. The problem with this approach is that
    the definitions of those positional placeholders are not consistent; they are
    entirely up to the defining predicate of question. For example, `{0}` in various
    attribute constraints is used to mean the attribute, while it is used to main the
    builder for certain attribute transformations. This can become very confusing.

    This CL introduces `tgfmt` as a new mechanism to better support for predicate and
    rewrite rule specification. Instead of entirely relying on positional placeholders,
    `tgfmt` support both positional and special placeholders. The former is used for
    DAG operands. The latter, including $_builder, $_op, $_self, are used as special
    "hooks" to entities in the context. With this, the predicate and rewrite rules
    specification can be more consistent is more readable.

--

PiperOrigin-RevId: 243249671
2019-04-18 11:47:27 -07:00
Stella Laurenzo 13bb8f491a Initial release of the Quantization dialect
Includes a draft of documentation for the quantization setup.

Given how many comments such docs have garnered in the past, I've biased towards a lightly edited first-draft so that people can argue about terminology, approach and structure without having spent too much time on it.

Note that the sections under "Uniform quantization" were cribbed nearly verbatim from internal documentation that Daniel wrote.

PiperOrigin-RevId: 241768668
2019-04-03 19:20:12 -07:00
River Riddle dfc58742a2 Rename the 'namePrefix' field in the Dialect class to 'name' and tidy some comments to make it clear that 'name' refers to the dialect namespace.
--

PiperOrigin-RevId: 241103116
2019-03-30 11:23:55 -07:00
Jacques Pienaar 1273af232c Add build files and update README.
* Add initial version of build files;
    * Update README with instructions to download and build MLIR from github;

--

PiperOrigin-RevId: 241102092
2019-03-30 11:23:22 -07:00
River Riddle 6f24bf82f9 Assert that registered dialects have unique names. This creates a guarantee that the namespace of a dialect can be used a unique key.
--

PiperOrigin-RevId: 241049578
2019-03-29 17:57:41 -07:00
River Riddle af9760fe18 Replace remaining usages of the Instruction class with Operation.
PiperOrigin-RevId: 240777521
2019-03-29 17:50:04 -07:00
River Riddle 9ffdc930c0 Rename the Instruction class to Operation. This just renames the class, usages of Instruction will still refer to a typedef in the interim.
This is step 1/N to renaming Instruction to Operation.

PiperOrigin-RevId: 240431520
2019-03-29 17:42:50 -07:00
Lei Zhang eeadfbc170 Change getBroadcastedShape() to return result shape via parameter
This is a more efficient way than returning SmallVector directly.

PiperOrigin-RevId: 239407024
2019-03-29 17:25:38 -07:00
Lei Zhang 7972dcef84 Pull shape broadcast out as a stand-alone utility function
So that we can use this function to deduce broadcasted shapes elsewhere.

Also added support for unknown dimensions, by following TensorFlow behavior.

PiperOrigin-RevId: 237846065
2019-03-29 17:12:11 -07:00
River Riddle 2d2b40bce5 Add basic infrastructure for instrumenting pass execution and analysis computation. A virtual class, PassInstrumentation, is provided to allow for different parts of the pass manager infrastructure. The currently available hooks allow for instrumenting:
* before/after pass execution
* after a pass fails
* before/after an analysis is computed

After getting this infrastructure in place, we can start providing common developer utilities like pass timing, IR printing after pass execution, etc.

PiperOrigin-RevId: 237709692
2019-03-29 17:10:06 -07:00
River Riddle d43f630de8 NFC: Remove 'Result' from the analysis manager api to better reflect the implementation. There is no distinction between analysis computation and result.
PiperOrigin-RevId: 237093101
2019-03-29 17:02:12 -07:00
River Riddle 1d87b62afe Add support for preserving specific analyses in the analysis manager. Passes can now preserve specific analyses via 'markAnalysesPreserved'.
Example:

markAnalysesPreserved<DominanceInfo>();
markAnalysesPreserved<DominanceInfo, PostDominanceInfo>();

PiperOrigin-RevId: 237081454
2019-03-29 17:01:41 -07:00
River Riddle 7b0b344c5e Add a unittests directory for MLIR and start adding tests for OperandStorage from InstructionSupport.h.
PiperOrigin-RevId: 236911640
2019-03-29 16:58:05 -07:00