summaryrefslogtreecommitdiffstats
path: root/mlir
Commit message (Collapse)AuthorAgeFilesLines
...
* Allow a function to take the name of another existing function.River Riddle2019-05-203-0/+14
| | | | | | -- PiperOrigin-RevId: 248968285
* Add support for streaming Operations into Diagnostics.River Riddle2019-05-202-0/+20
| | | | | | -- PiperOrigin-RevId: 248967563
* Update the rewrite methods of each of the DialectConversion patterns to ↵River Riddle2019-05-207-79/+36
| | | | | | | | notify the PatternRewriter that the operation is being replaced. -- PiperOrigin-RevId: 248965082
* Add a utility function 'Operation::replaceUsesOfWith' to replace uses of ↵River Riddle2019-05-202-0/+12
| | | | | | | | a value within a single operation. -- PiperOrigin-RevId: 248961779
* Move the ConversionListBuilder utility to PatternMatch.h and rename it ↵River Riddle2019-05-2013-51/+49
| | | | | | | | to RewriteListBuilder. It has no specific functionality for DialectOpConversion patterns and can be useful for RewritePatterns in general. -- PiperOrigin-RevId: 248884466
* Add user iterators to IRObjects, i.e. Values.River Riddle2019-05-209-52/+76
| | | | | | -- PiperOrigin-RevId: 248877752
* Make shape matching work for any shaped type.Geoffrey Martin-Noble2019-05-201-14/+11
| | | | | | | | | | | | The current implementation makes some assumptions about what can be a shaped type, which aren't really necessary. It also has strange behavior for types that aren't in the limited set it handles (e.g. dialect-defined types) Updated the comment to match the implementation. This is partially motivated by the desire to make MemRef a subclass of ShapedType -- PiperOrigin-RevId: 248859674
* Rewrite the DialectOpConversion patterns to inherit from RewritePattern ↵River Riddle2019-05-2013-520/+393
| | | | | | | | instead of Pattern. This simplifies the infrastructure a bit by being able to reuse PatternRewriter and the RewritePatternMatcher, but also starts to lay the groundwork for a more generalized legalization framework that can operate on DialectOpConversions as well as normal RewritePatterns. -- PiperOrigin-RevId: 248836492
* Clean up tablegen vector and tensor typesGeoffrey Martin-Noble2019-05-207-85/+63
| | | | | | | | There was a weird mix of names, styles, and inheritance here. I think this makes it cleaner and more consistent. We can also have a more principled and far-reaching refactor of some of this naming, but this seems like a good improvement regardless -- PiperOrigin-RevId: 248827005
* Upstream the Quantizer tool (part 3).Stella Laurenzo2019-05-204-0/+676
| | | | | | | | | | This upstreams the config and constraints for a reference quantization scheme based on the FxpMathOps dialect. There are probably two more CLs to get the rest: one with the passes/tests, and one with the tool main() itself. -- PiperOrigin-RevId: 248817505
* Add support for saving and restoring the insertion point of a ↵River Riddle2019-05-2017-54/+140
| | | | | | | | FuncBuilder. This also updates the edsc::ScopedContext to use a single builder that saves/restores insertion points. This is necessary for using edscs within RewritePatterns. -- PiperOrigin-RevId: 248812645
* Refactor PatternRewriter to inherit from FuncBuilder instead of Builder. ↵River Riddle2019-05-204-11/+10
| | | | | | | | This is necessary for allowing more complicated rewrites in the future that may do things like update the insertion point (e.g. for rewrites involving regions). -- PiperOrigin-RevId: 248803153
* Also visit memref element type in AsmPrinterGeoffrey Martin-Noble2019-05-201-3/+8
| | | | | | -- PiperOrigin-RevId: 248797935
* Enable EDSC API test running through litAlex Zinenko2019-05-204-2/+27
| | | | | | | | | | | EDSC subsystem contains an API test which is a .cpp file calling the API in question and producing IR. This IR is further checked using FileCheck and should plug into lit. Provide a CMakeLists.txt to build the test and modify the lit configuration to process the source file. -- PiperOrigin-RevId: 248794443
* Allow for the case where ShapedType is a MemRef in fixed point math ↵Geoffrey Martin-Noble2019-05-201-4/+7
| | | | | | | | | | kernel utils MemRef may soon be a subclass of ShapedType. -- PiperOrigin-RevId: 248788950
* Refactor Attribute and Type to use 'classof' instead of 'kindof' ↵River Riddle2019-05-205-19/+27
| | | | | | | | internally. If a 'classof' method is not defined, a default implementation will invoke 'kindof' on a derived type. This allows for defining supplementary Attribute/Type classes that expose additional functionality, but do not have a specific kind value. An example of this can be seen in the 'Constant(Float|Index|Int)Ops' that derive from 'ConstantOp'. -- PiperOrigin-RevId: 248724093
* Fix use of variables only used in asserts.MLIR Team2019-05-201-2/+6
| | | | | | | | This otherwise triggers "unused variable" errors in optimized build mode. -- PiperOrigin-RevId: 248706350
* Overload arithmetic operators for SDBM expressionsAlex Zinenko2019-05-204-88/+239
| | | | | | | | | | | | | | | | Provide an "unsafe" version of the overloaded arithmetic operators for SDBM expressions. These operators expect the operands to be of the right SDBM expression subtype and assert if they are not. They also perform simple folding operations as well as some semantically correct operations that construct an SDBM expression of a different subtype, e.g., a difference expression if the RHS of an operator+ is a negated variable. These operators are scoped in a namespace to allow for a future "safe" version of the operators that propagates null expressions to denote the error state when expressions have wrong subtypes. -- PiperOrigin-RevId: 248704153
* Implement SDBM and conversion between SDBM and lists of SDBMExprAlex Zinenko2019-05-205-70/+1140
| | | | | | | | | | | | Implement the storage class for striped difference-bound matrices (SDBM) as a container with a difference bounds matrix and a list of stripe expressions. An SDBM defines an integer set. Provide conversion mechanisms between lists of SDBM expressions treated as equalities with zero or less-than-or-equal inequalities with zero. -- PiperOrigin-RevId: 248702871
* LLVM API updates.MLIR Team2019-05-201-1/+1
| | | | | | -- PiperOrigin-RevId: 248651086
* Update cmake dependencies.Jacques Pienaar2019-05-202-0/+4
| | | | | | -- PiperOrigin-RevId: 248650428
* Fixes a small bug in computing dependence direction vectors, where ↵Andy Davis2019-05-202-1/+58
| | | | | | | | equality constraint can be created on the wrong loop IVs when source/sink of the dependence are at different loop depths. Adds unit tests for cases where source/sink of the dependence are at varying loop depths. -- PiperOrigin-RevId: 248627490
* Simplify the verification of ExtractElementop.Geoffrey Martin-Noble2019-05-203-8/+63
| | | | | | | | | | | Make it clear that it cares about the aggregate type being a vector or tensor and not just that it has a shape. Remove redundant validation from the custom method that is now covered by the tablegen'ed verification This is related to making MemRefs a ShapedType as well. -- PiperOrigin-RevId: 248610443
* Expand ReturnOp error to include types. NFC.Jacques Pienaar2019-05-202-3/+5
| | | | | | | | Found it a bit easier to see what mismatches occurred when invoking passes doesn't match. -- PiperOrigin-RevId: 248597286
* Don't fail verifying unranked shapes as being the same as this could be ↵Jacques Pienaar2019-05-202-5/+45
| | | | | | | | | | valid at runtime. tensor<*xf32> could be a tensor<1xf32> at runtime but this verifyShapeMatch would return failure and say function is invalid. -- PiperOrigin-RevId: 248583038
* Unify the 'constantFold' and 'fold' hooks on an operation into just ↵River Riddle2019-05-2021-449/+255
| | | | | | | | 'fold'. This new unified fold hook will take constant attributes as operands, and may return an existing 'Value *' or a constant 'Attribute' when folding. This removes the awkward situation where a simple canonicalization like "sub(x,x)->0" had to be written as a canonicalization pattern as opposed to a fold. -- PiperOrigin-RevId: 248582024
* Add linalg.range_intersect conversion to LLVM.Nicolas Vasilache2019-05-202-19/+87
| | | | | | | | | | | This CL adds lowering for linalg.range_intersect into LLVM by computing: * new_min <- max (range1.min, range2.min) * new_max <- min (range1.max, range2.max) * new_step <- range1.step * range2.step -- PiperOrigin-RevId: 248571810
* Add a linalg.range_intersect op.Nicolas Vasilache2019-05-207-78/+158
| | | | | | | | | | This CL adds an operation whose purpose is to encode boundary conditions directly in the view type. In particular, full/partial tile distinction can occur at the level of metadata only. This CL also adopts a Linalg_Op pattern that is similar to Std_Op. -- PiperOrigin-RevId: 248529469
* Rename VectorOrTensorType to ShapedTypeGeoffrey Martin-Noble2019-05-2026-199/+183
| | | | | | | | | | | | This is in preparation for making it also support/be a parent class of MemRefType. MemRefs have similar shape/rank/element semantics and it would be useful to be able to use these same utilities for them. This CL should not change any semantics and only change variables, types, string literals, and comments. In follow-up CLs I will prepare all callers to handle MemRef types or remove their dependence on ShapedType. Discussion/Rationale in https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/cHLoyfGu8y8 -- PiperOrigin-RevId: 248476449
* Store the child function analysis maps of a ModuleAnalysisManager by ↵River Riddle2019-05-202-7/+12
| | | | | | | | unique_ptr instead of by-value. -- PiperOrigin-RevId: 248456926
* Add a new tutorial document that details how to define Dialect ↵River Riddle2019-05-202-0/+272
| | | | | | | | Attributes and Types. -- PiperOrigin-RevId: 248417063
* Upstreaming Quantizer tool (part 2).Stella Laurenzo2019-05-209-0/+1042
| | | | | | | | | | This adds some additional core types and utilities, notably the constraint analysis graph (CAG) structures, associated metadata and configuration policy object base class. The CAG is not particularly memory efficient as it stands now. I had started some work to turn it into a form that could be better managed by a bump pointer allocator but abandoned that for now in favor of having something that does semantically what I was going for as a starting point. -- PiperOrigin-RevId: 248413133
* Fixed Attributes.h comment typo from vecctor to vectorRob Suderman2019-05-201-1/+1
| | | | | | -- PiperOrigin-RevId: 248369005
* Cleanup linalg integration testNicolas Vasilache2019-05-2015-83/+99
| | | | | | | | | | This CL performs post-commit cleanups. It adds the ability to specify which shared libraries to load dynamically in ExecutionEngine. The linalg integration test is updated to use a shared library. Additional minor cleanups related to LLVM lowering of Linalg are also included. -- PiperOrigin-RevId: 248346589
* Add support for parsing/printing dialect defined attributes. This also ↵River Riddle2019-05-2011-168/+349
| | | | | | | | | | | | adds support for a pretty syntax for dialects attributes that is synonymous with the pretty syntax for dialect types. This cl also adds a new attribute 'OpaqueAttr' that allows for roundtripping attributes attached to unregistered dialects. Dialect attributes have the following syntax: dialect-attribute ::= `#` dialect-namespace `<` `"` attr-data `"` `>` dialect-attribute ::= `#` alias-name pretty-dialect-sym-body? -- PiperOrigin-RevId: 248344416
* Remove some extraneous const qualifiers on Type, and 0b1 -> 1 in tblgen ↵Chris Lattner2019-05-209-61/+60
| | | | | | | | files. (NFC) -- PiperOrigin-RevId: 248332674
* Make Linalg tiling a FunctionPass instead of a ModulePass - NFCNicolas Vasilache2019-05-202-8/+5
| | | | | | -- PiperOrigin-RevId: 248286354
* Add a new document detailing the diagnostics infrastructure.River Riddle2019-05-201-0/+251
| | | | | | -- PiperOrigin-RevId: 248275851
* Start to introduce the "Quantizer" tool, which is responsible for ↵Stella Laurenzo2019-05-207-0/+922
| | | | | | | | | | transforming a computation expressed in floating point to one operating in terms of quantized types (where possible), either using quant-aware-training hints where available or post-training statistics. This is being integrated from an experimental side repository piece by piece over the course of several patches and will ultimately include full build support, documentation and e2e tests. -- PiperOrigin-RevId: 248259895
* Add support for a Linalg base op classNicolas Vasilache2019-05-207-86/+261
| | | | | | | | | | | | | | | | | | | | This CL uses a pattern proposed by aminim@ to add a base Linalg op that further dispatches to the proper op implementation. This CL adds a LinalgOp which implements isclassof for only a subset of the linalg ops: the ops that behave like a library call for the purpose of transformations like tiling. This uses a static dispatch mechanism based on the LinalgLibraryOps.td ops declarations to avoid switch or visitor patterns. This may later be replaced by Tablegen'd dispatch when it is available. As a consequence, the list of library like operations in Linalg may now grow without having to modify any of the dispatch or transformation support. More details in the concept-based dispatch, as explained by aminim@ ``` This is inspired by Sean Parent's: https://sean-parent.stlab.cc/papers-and-presentations/#value-semantics-and-concept-based-polymorphism A key difference is that the set of classes erased is statically known, which avoids to use dynamic memory allocation. We use a zero-sized templated class to emit the virtual table and generate a singleton object for each instantiation of this class. We pay the cost of initialization once on construction (find which class to dispatch to) and then a virtual dispatch on every call. ``` -- PiperOrigin-RevId: 248258921
* Remove unnecessary C++ specifier in CPP files. NFC.Jacques Pienaar2019-05-2018-18/+18
| | | | | | | | These are only required in .h files to disambiguate between C and C++ header files. -- PiperOrigin-RevId: 248219135
* Add an AffineExpr matcherNicolas Vasilache2019-05-201-74/+137
| | | | | | | | | | This CL gives a pattern-matching-y look and feel to AffineExpr. For now this uses a shared_ptr instead of unique'ing into a bumpPtrAllocator. SDBM gives a simple use case with more idiomatic syntax for matchers. -- PiperOrigin-RevId: 248188075
* Move Quantization -> Dialect/QuantOps, FxpMathOps -> Dialect/FxpMathOps.Stella Laurenzo2019-05-2048-88/+93
| | | | | | | | | | | | | Adding the additional layer of directory was discussed offline and matches the Target/ tree. The names match the defacto convention we seem to be following where the C++ namespace is ^(.+)Ops/$ matched against the directory name. This is in preparation for patching the Quantizer into this tree, which would have been confusing without moving the Quantization dialect to its more proper home. It is left to others to move other dialects if desired. Tested: ninja check-mlir -- PiperOrigin-RevId: 248171982
* When converting a location to an SMLoc, advance to the first ↵River Riddle2019-05-201-3/+16
| | | | | | | | | | | | | | | | | | | | | | non-whitespace if the column is unknown(zero). This also fixes a small bug with call stack printing. Example: /tmp/file_C.py:21:5: error: 'foo.bar' op attribute 'something' raise app.UsageError('Too many command-line arguments.') ^ /tmp/file_D.py:20:3: note: called from if len(argv) > 1: ^ /tmp/file_E.py:19:1: note: called from def main(argv): ^ /tmp/file_F.py:24:3: note: called from app.run(main) ^ -- PiperOrigin-RevId: 248151212
* [ODS] Add definition for TypeAttrLei Zhang2019-05-202-4/+25
| | | | | | -- PiperOrigin-RevId: 248147938
* Move specification of print, parse and verify to Std_Op base.Jacques Pienaar2019-05-203-57/+44
| | | | | | | | Removes some boilerplate in ops, add support to refer to C++ class name from parser function specification in ODS. -- PiperOrigin-RevId: 248140977
* Add initial support to the SourceMgrDiagnosticHandler for printing call ↵River Riddle2019-05-202-34/+71
| | | | | | | | | | | | | | | | | | | | | | | stacks. Example: /tmp/file_C.py:17:1: error: 'foo.bar' op attribute 'something' ... app.run(main) ^ /tmp/file_D.py:14:1: note: called from raise app.UsageError('Too many command-line arguments.') ^ /tmp/file_E.py:12:1: note: called from def main(argv): ^ /tmp/file_F.py:13:1: note: called from if len(argv) > 1: ^ -- PiperOrigin-RevId: 248074804
* Fix lingering sign compare warnings in exposed by "ninja check-mlir".Stella Laurenzo2019-05-208-9/+14
| | | | | | -- PiperOrigin-RevId: 248050178
* Add a linalg.dimNicolas Vasilache2019-05-207-42/+136
| | | | | | | | | A linalg.dim operation is used to extract size information from !linalg.view objects passed through function call boundaries. -- PiperOrigin-RevId: 248017488
* Refactor NameLoc so that it also holds a child location. This removes ↵River Riddle2019-05-207-10/+77
| | | | | | | | the awkward use of CallSiteLoc as a variable usage location. -- PiperOrigin-RevId: 248014642
OpenPOWER on IntegriCloud