summaryrefslogtreecommitdiffstats
path: root/mlir
Commit message (Collapse)AuthorAgeFilesLines
...
* EDSC: use llvm::function_ref instead of std::functionAlex Zinenko2019-06-012-6/+7
| | | | | | | | | | Region body constructors in EDSC now take a callback to the function that fills in the body. This callback is called immediately and not stored, so it is sufficient to pass a reference to it and avoid a potentially expensive copy. -- PiperOrigin-RevId: 250473793
* Add a linalg.for operation to support non-affine loop constructsNicolas Vasilache2019-06-015-1/+244
| | | | | | | | | | | | | | | | | The affine.for operation has restrictions that make it suitable for dependence analysis. The Linalg dialect aims at being more general. This CL introduces linalg.for, and its associated terminator, along with a simple roundtripping test. A `linalg.for` only takes one value of index type for lower bound, upper bound and step. Example usage: ``` linalg.for %iv = %lb to %ub step %step { ... // body } ``` -- PiperOrigin-RevId: 250369722
* Remove unused IsSingleResult templateLei Zhang2019-06-011-6/+0
| | | | | | -- PiperOrigin-RevId: 250335025
* NFC: Replace Function::args_iterator with Block::args_iterator.River Riddle2019-06-011-41/+7
| | | | | | -- PiperOrigin-RevId: 250311059
* Fix mismatched-tags warning.Jacques Pienaar2019-06-011-1/+1
| | | | | | -- PiperOrigin-RevId: 250310618
* Tidy up a few parser functions in the ModuleParser. This also adds a ↵River Riddle2019-06-012-11/+22
| | | | | | | | missing error for attribute aliases that contain '.' characters. -- PiperOrigin-RevId: 250291646
* [ODS] Support numRegions in Op definitionLei Zhang2019-06-016-3/+76
| | | | | | -- PiperOrigin-RevId: 250282024
* Do not assume Blocks belong to FunctionsAlex Zinenko2019-06-013-7/+7
| | | | | | | | | | | | | | | Fix Block::splitBlock and Block::eraseFromFunction that erronously assume blocks belong to functions. They now belong to regions. When splitting, new blocks should be created in the same region as the existing block. When erasing a block, it should be removed from the region rather than from the function body that transitively contains the region. Also rename Block::eraseFromFunction to Block::erase for consistency with other IR containers. -- PiperOrigin-RevId: 250278272
* Fix translation of NVVM special registers to intrinsics.Stephan Herhut2019-06-013-5/+6
| | | | | | | | | | The original implementation did not map the return value of the intrinsics call to the result value of the special register op. Uses of the result value hence hit a nullpointer. -- PiperOrigin-RevId: 250255436
* Decouple affine->standard lowering from the passAlex Zinenko2019-06-012-33/+60
| | | | | | | | | | | | | | | The lowering from the Affine dialect to the Standard dialect was originally implemented as a standalone pass. However, it may be used by other passes willing to lower away some of the affine constructs as a part of their operation. Decouple the transformation functions from the pass infrastructure and expose the entry point for the lowering. Also update the lowering functions to use `LogicalResult` instead of bool for return values. -- PiperOrigin-RevId: 250229198
* Fix correspondence between trait names in ODS and C++ class names.Jacques Pienaar2019-06-019-24/+26
| | | | | | | | Make the correspondence between the ODS and C++ side clearer. -- PiperOrigin-RevId: 250211194
* Change pattern test to use TestDialect instead.Jacques Pienaar2019-06-015-99/+77
| | | | | | | | Verify pattern specification, added benefit, named pattern and location recording using TestDialect. Naming is verified via explicitly adding named pattern to TestPatternDriver pass. Refactoring test to verify the desired functionality rather than generated code. -- PiperOrigin-RevId: 250205618
* Use SourceMgrDiagnosticHandler in mlir-translate for translations from ↵Jacques Pienaar2019-06-011-50/+59
| | | | | | | | | | MLIR input. Report errors using the file and line location using SourceMgr's diagnostic reporting. Reduce some horizontal white spacing too. -- PiperOrigin-RevId: 250193646
* Move the 'is_detected' utility out of StorageUniquer and into STLExtras ↵River Riddle2019-06-012-31/+34
| | | | | | | | to allow reuse throughout the codebase. -- PiperOrigin-RevId: 250160508
* Avoid unused variable warning.Jacques Pienaar2019-06-011-1/+1
| | | | | | -- PiperOrigin-RevId: 250109802
* NFC: Add a missing include for std::isalnum and std::digit.River Riddle2019-06-011-0/+1
| | | | | | -- PiperOrigin-RevId: 250085298
* NFC: Cleanup a switch statement that only has a default case.River Riddle2019-06-011-8/+3
| | | | | | -- PiperOrigin-RevId: 250062529
* Add a 'getDialectNamespace' utility to a few dialects.River Riddle2019-06-016-3/+6
| | | | | | -- PiperOrigin-RevId: 250049416
* [spirv] Start the SPIR-V dialectLei Zhang2019-06-0113-0/+321
| | | | | | | | | | | | | | | | This CL sets up the basic structure for a SPIR-V dialect: operation definition specification, dialect registration, testing, etc. A single op, FMul, is defined and tested to showcase. The SPIR-V dialect aims to be a simple proxy for the SPIR-V binary format to enable straightforward and lightweight conversion from/to the binary format. Ops in this dialect should stay as the same semantic level and try to be a mechanical mapping to the corresponding SPIR-V instructions; but they can deviate representationally to allow using MLIR mechanisms. -- PiperOrigin-RevId: 250040830
* Add a templated wrapper around RewritePattern that allows for defining ↵River Riddle2019-06-019-250/+215
| | | | | | | | match/rewrite methods with an instance of the source op instead of a raw Operation*. -- PiperOrigin-RevId: 250003405
* Use fused location for rewritten ops in generated rewrites.Jacques Pienaar2019-06-012-2/+26
| | | | | | | | This does tracks the location by recording all the ops in the source pattern and using the fused location for the transformed op. Track the locations via the rewrite state which is a bit heavy weight, in follow up to change to matchAndRewrite this will be addressed (and need for extra array go away). -- PiperOrigin-RevId: 249986555
* Make scope explicit to avoid misleading-indentation warnings.Jacques Pienaar2019-06-011-2/+2
| | | | | | -- PiperOrigin-RevId: 249986537
* Address some build warnings.Jacques Pienaar2019-06-017-31/+6
| | | | | | -- PiperOrigin-RevId: 249986120
* Add support to RewritePattern for specifying the potential operations ↵River Riddle2019-06-017-6/+63
| | | | | | | | that can be generated during a rewrite. This will enable analyses to start understanding the possible effects of applying a rewrite pattern. -- PiperOrigin-RevId: 249936309
* Fix incorrect result type inference for nested tuples & remove hacky ↵Jacques Pienaar2019-06-011-7/+3
| | | | | | | | | | const case. Builders can be further refined but wanted to address bug where the result type was used beyond the first depth. -- PiperOrigin-RevId: 249936004
* Update the type printer for Diagnostic to automatically wrap the type ↵River Riddle2019-06-013-4/+4
| | | | | | | | with ''. -- PiperOrigin-RevId: 249935489
* Update the m_Constant matcher to enable matching derived attribute types.River Riddle2019-06-012-16/+14
| | | | | | -- PiperOrigin-RevId: 249933184
* Rename DialectConversion to TypeConverter and split out pattern ↵River Riddle2019-06-0111-242/+170
| | | | | | | | construction. This simplifies building the conversion pattern list from multiple sources. -- PiperOrigin-RevId: 249930583
* Move the definitions of LoadOp and StoreOp to the ODG framework.River Riddle2019-06-013-137/+106
| | | | | | -- PiperOrigin-RevId: 249928980
* Move the definitions of CmpIOp, CmpFOp, and SelectOp to the ODG framework.River Riddle2019-06-016-212/+193
| | | | | | -- PiperOrigin-RevId: 249928953
* Replace checks for rank -1 with direct calls to hasRankGeoffrey Martin-Noble2019-06-013-6/+5
| | | | | | | | Also removed a redundant check for rank after already checking for static shape (which implies rank) -- PiperOrigin-RevId: 249927636
* Limit the number of places where shaped type has to explicitly reference ↵Geoffrey Martin-Noble2019-06-012-50/+31
| | | | | | | | | | | | its base classes. Introduces a hasRank() method to make checking for rank a bit easier. This is partially to make it easier to make MemRef subclass ShapedType -- PiperOrigin-RevId: 249927442
* Use TestDialect to test traits instead of unittest.Jacques Pienaar2019-06-014-133/+62
| | | | | | -- PiperOrigin-RevId: 249916947
* Add a type-constrained nested tuple type.Geoffrey Martin-Noble2019-06-016-42/+118
| | | | | | | | This is useful for dialects that use tuples but only support a subset of types. -- PiperOrigin-RevId: 249910133
* Add TestLoopFusion.cpp to CMakeLists.txtLei Zhang2019-06-011-0/+1
| | | | | | -- PiperOrigin-RevId: 249901490
* Add operand type iterators to Operation and cleanup usages of ↵River Riddle2019-06-0114-94/+119
| | | | | | | | operand->getType. This also simplifies some lingering usages of result->getType. -- PiperOrigin-RevId: 249889174
* Add LoopFusionUtils.cpp to CMakeLists.Andy Davis2019-06-011-0/+1
| | | | | | -- PiperOrigin-RevId: 249887371
* Affine Loop Fusion Utility Module (1/n).Andy Davis2019-06-016-0/+721
| | | | | | | | | | *) Adds LoopFusionUtils which will expose a set of loop fusion utilities (e.g. dependence checks, fusion cost/storage reduction, loop fusion transformation) for use by loop fusion algorithms. Support for checking block-level fusion-preventing dependences is added in this CL (additional loop fusion utilities will be added in subsequent CLs). *) Adds TestLoopFusion test pass for testing LoopFusionUtils at a fine granularity. *) Adds unit test for testing dependence check for block-level fusion-preventing dependences. -- PiperOrigin-RevId: 249861071
* NFC: Rename DialectConversionPattern to ConversionPattern.River Riddle2019-06-0111-62/+52
| | | | | | -- PiperOrigin-RevId: 249857277
* Detemplatize convertRegion in DialectConversionAlex Zinenko2019-06-011-9/+10
| | | | | | | | | | | | | Originally, FunctionConverter::convertRegion in the DialectConversion framework was implemented as a function template because it was creating a new region in the parent object, which could have been an op or a function. Since DialectConversion now operates in place, new region is no longer created so there is no need for convertRegion to be aware of the parent, only of the error reporting location. -- PiperOrigin-RevId: 249826392
* Add support for llvm.constant with StringAttr as value.Stephan Herhut2019-06-012-0/+11
| | | | | | | | | These are translated to an llvm::ConstantDataArray on translation to llvm IR proper. -- PiperOrigin-RevId: 249813111
* Move explicit calls to Module::getNamedFunction outside of the ↵River Riddle2019-06-014-14/+17
| | | | | | | | operations that contain FunctionAttr. It is up to the users of operations to query the module for a specific function referenced by a FunctionAttr. -- PiperOrigin-RevId: 249743109
* Introduce a new common diagnostic handler ScopedDiagnosticHandler to ↵River Riddle2019-06-013-5/+71
| | | | | | | | simplify saving and restoring the currently registered handler. -- PiperOrigin-RevId: 249735912
* Add pattern file location to generated code to trace origin of pattern.Jacques Pienaar2019-06-014-0/+35
| | | | | | -- PiperOrigin-RevId: 249734666
* Make TupleOf take a list of allowed types.Geoffrey Martin-Noble2019-06-014-17/+77
| | | | | | | | | | This better matches other container types. Seems better to do that, even though tuples are a little different, since they don't have a single element type. Also fixed its description to mention the element type. -- PiperOrigin-RevId: 249730341
* Add a new TestDialect directory in tests/. This directory defines a fake ↵River Riddle2019-06-0110-36/+224
| | | | | | | | 'TestDialect' that allows for the use of FileCheck to test things that aren't currently used anywhere else in tree. As a first order, this should simplify the tests used for tablegen components revolving around operation constraints/patterns. -- PiperOrigin-RevId: 249724328
* Rename Float/Integer to AnyFloat/AnyIntegerGeoffrey Martin-Noble2019-06-012-8/+8
| | | | | | | | This emphasizes that it is potentially less constrained than you might desire (especially dialects will frequently not support all bit widths), and better matches the other type names, especially the container types. -- PiperOrigin-RevId: 249718409
* Fix Linalg tiling for the partial tile case.Nicolas Vasilache2019-06-016-317/+298
| | | | | | | | | | | | | | | | | | | | This CL prepares for mixing lowering of tiled linalg operations to loops with load and store operations. In particular it is necessary to capture partial tile information in views. This CL makes slice ops during Linalg tiling properly stop at partial tile boundaries by implementing `min` with a `cmpi` and `select` over values of index type. To be consistent with lowering to loops, the implementation of tiling also drops specifics of accessing values via ranges and instead uses ranges of the form `[0, dim(view), 1]` for creating view slices. This simplifies the code for the implementation of tiling and utils. This also allows removing restrictions around needing a View or SliceOp defined in the current function context (as well as all it RangeOps). The restriction removal is tested by making the dot test operate directly on views. The above is still subject to folding of the linalg.dim operation left for a future CL. At this time, mixing tiling and lowering to loops all the way to execution is not yet functional because affine.for does not allow arbitrarily defined values of index type as its operands. The previously introduced linalg.range_intersection was not sufficient to capture the necessary information and still required dealing with max quantities. A followup CL will remove linalg.range_intersection. -- PiperOrigin-RevId: 249698823
* Remove a stale declaration in FunctionAttr.River Riddle2019-06-011-4/+0
| | | | | | -- PiperOrigin-RevId: 249697345
* Added the ability to run a mapping function across the values of an elementsRob Suderman2019-06-012-0/+211
| | | | | | | | | attr. This supports both the SplatElementsAttr and DenseElementsAttr for both float and integer inputs / outputs. -- PiperOrigin-RevId: 249681056
OpenPOWER on IntegriCloud