summaryrefslogtreecommitdiffstats
path: root/mlir/unittests/IR
Commit message (Collapse)AuthorAgeFilesLines
* [mlir] Use getDenseElementBitwidth instead of Type::getElementTypeBitWidth.River Riddle2020-01-091-0/+10
| | | | | | | | Summary: Some data values have a different storage width than the corresponding MLIR type, e.g. bfloat is currently stored as a double. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D72478
* NFC: Replace ValuePtr with Value and remove it now that Value is value-typed.River Riddle2019-12-231-4/+4
| | | | | | ValuePtr was a temporary typedef during the transition to a value-typed Value. PiperOrigin-RevId: 286945714
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-234-52/+16
| | | | PiperOrigin-RevId: 286906740
* NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to ↵River Riddle2019-12-221-4/+4
| | | | | | | | | | Value being value-typed. This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics. PiperOrigin-RevId: 286844725
* Switch explicit create methods to match generated build's orderJacques Pienaar2019-09-281-2/+2
| | | | | | The generated build methods have result type before the arguments (operands and attributes, which are also now adjacent in the explicit create method). This also results in changing the create method's ordering to match most build method's ordering. PiperOrigin-RevId: 271755054
* NFC: Remove the explicit context from Operation::create and OperationState.River Riddle2019-08-261-1/+1
| | | | | | The context can easily be recovered from the Location in these situations. PiperOrigin-RevId: 265578574
* Add missing include file to StringExtrasTest.cppMahesh Ravishankar2019-07-301-1/+1
| | | | | | | Use of std::isupper and std::islower need <cctype> header file. Fix that and also fix the header of a file to match the file name. PiperOrigin-RevId: 260816852
* Add support for (de)serialization of SPIR-V Op DecorationsMahesh Ravishankar2019-07-302-0/+75
| | | | | | | | | | | | All non-argument attributes specified for an operation are treated as decorations on the result value and (de)serialized using OpDecorate instruction. An error is generated if an attribute is not an argument, and the name doesn't correspond to a Decoration enum. Name of the attributes that represent decoerations are to be the snake-case-ified version of the Decoration name. Add utility methods to convert to snake-case and camel-case. PiperOrigin-RevId: 260792638
* Fix the detection of boolean splat values in DenseElementsAttr for arrays ↵River Riddle2019-06-191-0/+11
| | | | | | with <=15 values. PiperOrigin-RevId: 253711372
* Add an overloaded 'get' method to DenseElementsAttr that accepts an ↵River Riddle2019-06-191-8/+4
| | | | | | initializer_list. PiperOrigin-RevId: 253234385
* Explicitly construct ArrayRef in AttributeTest.cppAlex Zinenko2019-06-191-4/+8
| | | | | | | | Some compilers find initializer list constructors from boolean literals ambiguous between ArrayRef<bool> and ArrayRef<Attribute>. Call the ArrayRef<bool> constructor explicitly to disambiguate. PiperOrigin-RevId: 253224859
* NFC: Fix a narrowing conversion from size_t to int64_t when constructing a ↵River Riddle2019-06-191-1/+1
| | | | | | VectorType. PiperOrigin-RevId: 253125435
* Refactor DenseElementsAttr to support auto-splatting the dense data on ↵River Riddle2019-06-192-0/+137
| | | | | | construction. This essentially means that we always auto-detect splat data and only store the minimum amount of data necessary. Support for parsing dense splats, and removing SplatElementsAttr(now that it is redundant) will come in followup cls PiperOrigin-RevId: 252720561
* Use TestDialect to test traits instead of unittest.Jacques Pienaar2019-06-012-132/+0
| | | | | | -- PiperOrigin-RevId: 249916947
* Move SDBM infrastructure into a new SDBM dialectAlex Zinenko2019-06-012-349/+0
| | | | | | | | | | | We now have sufficient extensibility in dialects to move attribute components such as SDBM out of the core IR into a dedicated dialect and make them optional. Introduce an SDBM dialect and move the code. This is a mostly non-functional change. -- PiperOrigin-RevId: 249244802
* Fix -Wsign-compare in OperationSupportTest.cppAlex Zinenko2019-06-011-5/+5
| | | | | | | | | A couple of warnings was produced when compiling this test due to comaprisons with a signed literal. Used unsigned literals instead. -- PiperOrigin-RevId: 249242970
* AffineExpr: factor uniqu'ing out of MLIRContext.cppAlex Zinenko2019-06-011-5/+5
| | | | | | | | | | | | | Affine expressions are designed as components of an attribute and are unique'd in the MLIRContext. When affine expressions were implemented, uniqu'ing objects in a context required to modify MLIRContext implementation. This is no longer the case as generic StorageUniquer has been introduced. Port the AffineExpr construction to use the new infrastructure by introducing an affineUniquer into the MLIRContext. -- PiperOrigin-RevId: 249207539
* Use FileCheck to test SDBMAlex Zinenko2019-05-201-127/+0
| | | | | | | | | | | | | SDBM has an output format representing the unterlying matrix and stripe expressions. Move the SDBM tests from unit testing framework to FileCheck-based tests, printing them to the standard output and using FileCheck to test the output. Tests that check the API proper (e.g. that SDBM expressions have a specific subtype) and that rely on non-syntatic properties (equality of the set of constraints) are not ported. -- PiperOrigin-RevId: 249006055
* Overload arithmetic operators for SDBM expressionsAlex Zinenko2019-05-201-66/+81
| | | | | | | | | | | | | | | | 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-201-0/+217
| | | | | | | | | | | | 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
* Don't fail verifying unranked shapes as being the same as this could be ↵Jacques Pienaar2019-05-201-4/+44
| | | | | | | | | | 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
* Add SameOperandsAndResultElementType trait.Jacques Pienaar2019-05-062-0/+92
| | | | | | | | 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
* Implement the conversion between SDBMExpr and AffineExprAlex Zinenko2019-05-061-0/+61
| | | | | | | | | | | | | 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
* Start building SDBM infrastructureAlex Zinenko2019-05-062-0/+183
| | | | | | | | | | | 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
* Rename the 'namePrefix' field in the Dialect class to 'name' and tidy ↵River Riddle2019-03-301-1/+1
| | | | | | | | some comments to make it clear that 'name' refers to the dialect namespace. -- PiperOrigin-RevId: 241103116
* Add build files and update README.Jacques Pienaar2019-03-301-0/+7
| | | | | | | | | * Add initial version of build files; * Update README with instructions to download and build MLIR from github; -- PiperOrigin-RevId: 241102092
* Assert that registered dialects have unique names. This creates a ↵River Riddle2019-03-291-0/+38
| | | | | | | | guarantee that the namespace of a dialect can be used a unique key. -- PiperOrigin-RevId: 241049578
* Replace remaining usages of the Instruction class with Operation.River Riddle2019-03-291-6/+6
| | | | PiperOrigin-RevId: 240777521
* Rename the Instruction class to Operation. This just renames the class, ↵River Riddle2019-03-291-26/+26
| | | | | | | | 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
* Add a unittests directory for MLIR and start adding tests for OperandStorage ↵River Riddle2019-03-291-0/+117
from InstructionSupport.h. PiperOrigin-RevId: 236911640
OpenPOWER on IntegriCloud