- Feb 08, 2021
-
-
Tres Popp authored
Now the context is the first, rather than the last input. This better matches the rest of the infrastructure and makes it easier to move these types to being declaratively specified. Differential Revision: https://reviews.llvm.org/D96111
-
- Feb 05, 2021
-
-
Lei Zhang authored
These patterns move vector.bitcast ops to be before insert ops or after extract ops where suitable. With them, bitcast will happen on smaller vectors and there are more chances to share extract/insert ops. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D96040
-
Lei Zhang authored
Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D96041
-
Lei Zhang authored
This patch introduces a few more straightforward patterns to convert vector ops operating on 1-4 element vectors to their corresponding SPIR-V counterparts. This patch also enables converting vector<1xT> to T. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D96042
-
Lei Zhang authored
This patch adds patterns to use vector.shape_cast to cast away leading 1-dimensions from a few vector operations. It allows exposing more canonical forms of vector.transfer_read, vector.transfer_write, vector_extract_strided_slice, and vector.insert_strided_slice. With this, we can have more opportunity to cancelling extract/insert ops or forwarding write/read ops. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D95873
-
Nicolas Vasilache authored
-
Nicolas Vasilache authored
Differential Revision: https://reviews.llvm.org/D96116
-
Nicolas Vasilache authored
Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D96094
-
River Riddle authored
This makes ignoring a result explicit by the user, and helps to prevent accidental errors with dropped results. Marking LogicalResult as no discard was always the intention from the beginning, but got lost along the way. Differential Revision: https://reviews.llvm.org/D95841
-
- Feb 04, 2021
-
-
Diego Caballero authored
Reviewed By: mehdi_amini, rriddle Differential Revision: https://reviews.llvm.org/D95906
-
Mehdi Amini authored
-
Nicolas Vasilache authored
This revision takes advantage of recent extensions to vectorization to refactor contraction detection into a bona fide Linalg interface. The mlit-linalg-ods-gen parser is extended to support adding such interfaces. The detection that was originally enabling vectorization is refactored to serve as both a test on a generic LinalgOp as well as to verify ops that declare to conform to that interface. This is plugged through Linalg transforms and strategies but it quickly becomes evident that the complexity and rigidity of the C++ class based templating does not pay for itself. Therefore, this revision changes the API for vectorization patterns to get rid of templates as much as possible. Variadic templates are relegated to the internals of LinalgTransformationFilter as much as possible and away from the user-facing APIs. It is expected other patterns / transformations will follow the same path and drop as much C++ templating as possible from the class definition. Differential revision: https://reviews.llvm.org/D95973
-
Alexander Belyaev authored
Differential Revision: https://reviews.llvm.org/D96024
-
Nicolas Vasilache authored
This op is subsumed by rank-reducing SubViewOp and has become useless. Differential revision: https://reviews.llvm.org/D95317
-
Alex Zinenko authored
Historically, the Vector to LLVM dialect conversion subsumed the Standard to LLVM dialect conversion patterns. This was necessary because the conversion infrastructure did not have sufficient support for reconciling type conversions. This support is now available. Only keep the patterns related to the Vector dialect in the Vector to LLVM conversion and require type casts operations to be inserted if necessary. These casts will be removed by following conversions if possible. Update integration tests to also run the Standard to LLVM conversion. There is a significant amount of test churn, which is due to (a) unnecessarily strict tests in VectorToLLVM and (b) many patterns actually targeting Standard dialect ops instead of LLVM dialect ops leading to tests actually exercising a Vector->Standard->LLVM conversion. This churn is a good illustration of the reason to make the conversion partial: now the tests only check the code in the Vector to LLVM conversion and will not be randomly broken by changes in Standard to LLVM conversion. Arguably, it may be possible to extract Vector to Standard patterns into a separate pass, but given the ongoing splitting of the Standard dialect, such pass will be short-lived and will require further refactoring. Depends On D95626 Reviewed By: nicolasvasilache, aartbik Differential Revision: https://reviews.llvm.org/D95685
-
Nicolas Vasilache authored
This revision defines a Linalg contraction in general terms: 1. Has 2 input and 1 output shapes. 2. Has at least one reduction dimension. 3. Has only projected permutation indexing maps. 4. its body computes `u5(u1(c) + u2(u3(a) * u4(b)))` on some field (AddOpType, MulOpType), where u1, u2, u3, u4 and u5 represent scalar unary operations that may change the type (e.g. for mixed-precision). As a consequence, when vectorization of such an op occurs, the only special behavior is that the (unique) MulOpType is vectorized into a `vector.contract`. All other ops are handled in a generic fashion. In the future, we may wish to allow more input arguments and elementwise and constant operations that do not involve the reduction dimension(s). A test is added to demonstrate the proper vectorization of matmul_i8_i8_i32. Differential revision: https://reviews.llvm.org/D95939
-
Nicolas Vasilache authored
This separation improves the layering and paves the way for more interfaces coming up in the future. Differential revision: https://reviews.llvm.org/D95941
-
- Feb 03, 2021
-
-
Lei Zhang authored
We should be check whether lb + step >= ub to determine whether this is a single iteration. Previously we were checking lb + lb >= ub. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D95440
-
- Feb 02, 2021
-
-
Lei Zhang authored
This patch adds basic op definition, parser/printer, and verifier. Reviewed By: ThomasRaoux Differential Revision: https://reviews.llvm.org/D95825
-
Lei Zhang authored
We should be check whether lb + step >= ub to determine whether this is a single iteration. Previously we were checking lb + lb >= ub. Differential Revision: https://reviews.llvm.org/D95440
-
Benjamin Kramer authored
-
Nicolas Vasilache authored
This revision unifies Linalg vectorization and paves the way for vectorization of Linalg ops with mixed-precision operations. The new algorithm traverses the ops in the linalg block in order and avoids recursion. It uses a BlockAndValueMapping to keep track of vectorized operations. The revision makes the following modifications but is otherwise NFC: 1. vector.transfer_read are created eagerly and may appear in a different order than the original order. 2. a more progressive vectorization to vector.contract results in only the multiply operation being converted to `vector.contract %a, %b, %zero`, where `%zero` is a constant of the proper type. Later vector canonicalizations are assumed to rewrite vector.contract %a, %b, %zero + add to a proper accumulate form. Differential revision: https://reviews.llvm.org/D95797
-
MaheshRavishankar authored
Add printer and parser hooks for a custom directive that allows parsing and printing of idioms that can represent a list of values each of which is either an integer or an SSA value. For example in `subview %source[%offset_0, 1] [4, %size_1] [%stride_0, 3]` each of the list (which represents offset, size and strides) is a mix of either statically know integer values or dynamically computed SSA values. Since this is used in many places adding a custom directive to parse/print this idiom allows using assembly format on operations which use this idiom. Differential Revision: https://reviews.llvm.org/D95773
- Feb 01, 2021
-
-
Hanhan Wang authored
This is the last revision to migrate using SimplePadOp to PadTensorOp, and the SimplePadOp is removed in the patch. Update a bit in SliceAnalysis because the PadTensorOp takes a region different from SimplePadOp. This is not covered by LinalgOp because it is not a structured op. Also, remove a duplicated comment from cpp file, which is already described in a header file. And update the pseudo-mlir in the comment. This is as same as D95615 but fixing one dep in CMakeLists.txt Different from D95671, the fix was applied to run target. Reviewed By: mravishankar Differential Revision: https://reviews.llvm.org/D95785
-
Hanhan Wang authored
This is the last revision to migrate using SimplePadOp to PadTensorOp, and the SimplePadOp is removed in the patch. Update a bit in SliceAnalysis because the PadTensorOp takes a region different from SimplePadOp. This is not covered by LinalgOp because it is not a structured op. Also, remove a duplicated comment from cpp file, which is already described in a header file. And update the pseudo-mlir in the comment. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D95671
-
- Jan 29, 2021
-
-
Tres Popp authored
This segfault could occur from out of bounds accesses when simplifying tensor.extract with a constant index and a tensor created by tensor.from_elements. This IR is not necesarilly invalid as it might conditionally be never executed. Differential Revision: https://reviews.llvm.org/D95535
-
- Jan 28, 2021
-
-
MaheshRavishankar authored
Differential Revision: https://reviews.llvm.org/D94531
-
Hanhan Wang authored
This reverts commit 1e790b74. Differential Revision: https://reviews.llvm.org/D95636
-
Hanhan Wang authored
This is the last revision to migrate using SimplePadOp to PadTensorOp, and the SimplePadOp is removed in the patch. Update a bit in SliceAnalysis because the PadTensorOp takes a region different from SimplePadOp. This is not covered by LinalgOp because it is not a structured op. Also, remove a duplicated comment from cpp file, which is already described in a header file. And update the pseudo-mlir in the comment. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D95615
-
Alex Zinenko authored
It is no longer necessary to also convert other "standard" ops along with the complex dialect: the element types are now built-in integers or floating point types, and the top-level cast between complex and struct is automatically inserted and removed in progressive lowering. Reviewed By: herhut Differential Revision: https://reviews.llvm.org/D95625
-
Hanhan Wang authored
This revision creates a build method of PadTensorOp which can be mapped to SimplePad op. The verifier is updated to accept a static custom result type, which has the same semantic as SimplePadOp. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D95555
-
Nicolas Vasilache authored
The subview verifier in the rank-reduced case is plainly skipping verification when the resulting type is a memref with empty affine map. This is generally incorrect. Instead, form the actual expected rank-reduced MemRefType that takes into account the projections of 1's dimensions. Then, check the canonicalized expected rank-reduced type against the canonicalized candidate type. Differential Revision: https://reviews.llvm.org/D95316
-
Nicolas Vasilache authored
This revision adds a layer of SFINAE to the composable codegen strategy so it does not have to require statically defined ops but instead can also be used with OpInterfaces, Operation* and an op name string. A linalg.matmul_i8_i8_i32 is added to the .tc spec to demonstrate how all this works end to end. Differential Revision: https://reviews.llvm.org/D95600
-
Nicolas Vasilache authored
This revision improves the usage of the codegen strategy by adding a few flags that make it easier to control for the CLI. Usage of ModuleOp is replaced by FuncOp as this created issues in multi-threaded mode. A simple benchmarking capability is added for linalg.matmul as well as linalg.matmul_column_major. This latter op is also added to linalg. Now obsolete linalg integration tests that also take too long are deleted. Correctness checks are still missing at this point. Differential revision: https://reviews.llvm.org/D95531
-
- Jan 27, 2021
-
-
Tres Popp authored
Differential Revision: https://reviews.llvm.org/D95430
-
Nicolas Vasilache authored
OffsetSizeAndStrideOpInterface now have the ability to specify only a leading subset of offset, sizes, strides operands/attributes. The size of that leading subset must be limited by the corresponding entry in `getArrayAttrMaxRanks` to avoid overflows. Missing trailing dimensions are assumed to span the whole range (i.e. [0 .. dim)). This brings more natural semantics to slice-like op on top of subview and is a simplifies to removing all uses of SliceOp in dependent projects. Differential revision: https://reviews.llvm.org/D95441
-
MaheshRavishankar authored
Differential Revision: https://reviews.llvm.org/D95305
-
- Jan 26, 2021
-
-
Alexander Belyaev authored
-