| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Post clean-up after merger of kDynamicSize and kDynamicStrideOrOffset.
Differential Revision: https://reviews.llvm.org/D139929
|
|
|
|
| |
Fixes #59460
|
|
|
|
| |
AsyncToAsyncRuntime.cpp (NFC)
|
|
|
|
| |
AsyncToAsyncRuntime.cpp (NFC)
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces the initial bits to support vector masking
using the `vector.mask` operation. Vectorization changes should be
NFC for non-masked cases. We can't test masked cases directly until
we extend the Transform dialect to support masking.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D137690
|
|
|
|
|
|
|
|
| |
Since STEA isa Attribute, and that's just (a wrapper around) a pointer, the extra `const` and `&` aren't necessary for function arguments.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D139886
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moved to using helper lambdas to avoid code repetition. IR needed to be reordered to
accommodate which should be the only changes to the existing tests.
This changes the quantized test to target `i48` types to guarantee types are extended
correctly when necessary.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D136500
|
|
|
|
|
|
| |
This fixes an issue where rank-reducing + fusion would not interop properly.
Differential Revision: https://reviews.llvm.org/D139844
|
|
|
|
|
|
|
|
|
| |
Using `arith.mului_extended` makes it much simpler to emulate wide
integer multiplication.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D139776
|
|
|
|
|
|
|
|
|
|
|
| |
The structure of the code has changed a while ago and the code was not updated properly.
There is no test case for this because we do currently not have an op
that could trigger this bug.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D139838
|
|
|
|
|
|
|
|
| |
The op is not bufferizable but should be analyzable (for `EliminateEmptyTensors`, which uses the bufferization infrastructure).
Also improve debugging functionality and error messages.
Also adds a missing pass to the sparse pipeline. (tensor.empty should be replaced with bufferization.alloc_tensor, but it sometimes used to work without depending on how the tensor.empty is used. Now we always fail explicitly.)
|
|
|
|
|
|
|
|
|
|
| |
Now we have more convenient functions to construct silenceable errors
while emitting diagnostics, and the constructor is ambiguous as it
doesn't tell whether the logical error is silencebale or definite.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D137257
|
|
|
|
| |
transform.tile_reduction_xxx ops
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements the vectorization of tensor.extract for arbitrary
tensors. It basically extends https://reviews.llvm.org/D133786 by adding
support for n-D tensors (n >= 2). This is implemented by essentially
flattening the indices.
When benchmarking the vectorized code, we have observed that it is
slower than the scalar code. That's most likely due to sub-optimal (and,
in general slow) gather loads. More work is needed to identify an
implementation and/or a representation that would lead to better code.
In the meantime, the vectorization of n-D tensors (where n >= 2) has to
be explicitly enabled. This can be done either via:
* transfer dialect's `vectorize_nd_extract` attribute,
* dedicated bool argument in the `vectorize` method from
"Vectorization.cpp".
The second option was added to control the new functionality through
means other than the transfer dialect.
Related discussion: https://github.com/iree-org/iree/issues/9198
Differential Revision: https://reviews.llvm.org/D137660
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Harden the verifier to check that the block argument type matches the
operand type, when present. This was overlooked when transform dialect
types were introduced.
Fix the builders to preserve the insertion point before creating the
block, otherwise the insertion point is updated to be within the block
by `createBlock` and never reset to be after the sequence op itself,
leading all following operations to be created in the unexpected to
the caller place.
Reviewed By: chelini, springerm
Differential Revision: https://reviews.llvm.org/D139427
|
|
|
|
|
|
|
|
|
| |
This test case used to crash with a failed assertion:
```
AffineExpr.cpp:659 in AffineExpr simplifyMul(AffineExpr, AffineExpr): lhs.isSymbolicOrConstant() || rhs.isSymbolicOrConstant()
```
This was caused by combining two affine maps, which created a multiplication of two non-symbols.
|
|
|
|
|
|
|
|
|
| |
NFC. Refactor some affine fusion pass code for readability. Some of its
methods are too long. This is the first among some NFC changes before new
features/related updates are posted. Add missing code comments at a couple of
places.
Differential Revision: https://reviews.llvm.org/D139255
|
|
|
|
|
|
|
| |
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(Reland)
Reland D139447, D139471 With flang actually working
- FunctionOpInterface: make get/setFunctionType interface methods
This patch removes the concept of a `function_type`-named type attribute
as a requirement for implementors of FunctionOpInterface. Instead, this
type should be provided through two interface methods, `getFunctionType`
and `setFunctionTypeAttr` (*Attr because functions may use different
concrete function types), which should be automatically implemented by
ODS for ops that define a `$function_type` attribute.
This also allows FunctionOpInterface to materialize function types if
they don't carry them in an attribute, for example.
Importantly, all the function "helper" still accept an attribute name to
use in parsing and printing functions, for example.
- FunctionOpInterface: arg and result attrs dispatch to interface
This patch removes the `arg_attrs` and `res_attrs` named attributes as a
requirement for FunctionOpInterface and replaces them with interface
methods for the getters, setters, and removers of the relevent
attributes. This allows operations to use their own storage for the
argument and result attributes.
Reviewed By: jpienaar
Differential Revision: https://reviews.llvm.org/D139736
|
|
|
|
|
|
|
| |
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
|
|
|
|
|
| |
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
|
|
|
|
|
| |
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
|
|
|
|
|
| |
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extend D139688 with the signed version of the extended multiplication
op. Add conversion to the SPIR-V and LLVM dialects.
This was originally proposed in:
https://discourse.llvm.org/t/rfc-arith-add-extended-multiplication-ops/66869.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D139743
|
|
|
|
|
|
| |
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D139744
|
|
|
|
|
|
|
|
|
|
|
| |
Add conversion to the SPIR-V and LLVM dialects.
This was originally proposed in:
https://discourse.llvm.org/t/rfc-arith-add-extended-multiplication-ops/66869.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D139688
|
|
|
|
|
|
|
|
|
| |
Demote `arith.addui_extended` to `arith.addi` when the 'overflow'
result has no uses.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D139722
|
|
|
|
|
|
|
| |
In the process, numerous insertion point issues were found and fixed.
RAII on insertion points is now used more dilligently.
Differential Revision: https://reviews.llvm.org/D139714
|
|
|
|
|
|
|
|
|
| |
and "[mlir] Fix examples build"
This reverts commit fbc253fe81da4e1d6bfa2519e01e03f21d8c40a8 and
96cf183bccd7d1c3083f169a89a6af1f263b3aae.
Which I missed in the first revert in f3379feabe38fd3711b13ffcf6de4aab03b7ccdc.
|
|
|
|
|
|
|
|
| |
and "[flang] Fix flang after MLIR update"
This reverts commit dd74e6b6f4fb7a4685086a4895c1934e043f875b and
1897b67ae86470ad54f6baea6f220933d8053b5b due to ongoing test failures on flang
bots e.g. https://lab.llvm.org/buildbot/#/builders/179/builds/5050
|
|
|
|
|
|
| |
If an input bbArg is not used, its corresponding input operand is removed. If there are duplicate input operands or input operands that are also used as output operands, the duplicate input operands are removed. Output operands are never modified.
Differential Revision: https://reviews.llvm.org/D139709
|
|
|
|
|
|
|
|
| |
External functions have no body, so they cannot be analyzed. Assume conservatively that each tensor bbArg may be aliasing with each tensor result. Furthermore, assume that each function arg is read and written-to after bufferization. This default behavior can be controlled with `bufferization.access` (similar to `bufferization.memory_layout`) in test cases.
Also fix a bug in the dialect attribute verifier, which did not run for region argument attributes.
Differential Revision: https://reviews.llvm.org/D139517
|
|
|
|
|
|
|
|
| |
The attribute is translated into LLVM's function attribute 'readonly'. The attribute can be only used for pointers.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D139641
|
|
|
|
|
|
|
|
|
|
|
|
| |
To address https://github.com/llvm/llvm-project/issues/59394.
Reduction on negation of the output tensor is a non-sparsifiable kernel, it creates cyclic dependency.
This patch reject those cases instead of crashing.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D139659
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes the `arg_attrs` and `res_attrs` named attributes as a
requirement for FunctionOpInterface and replaces them with interface
methods for the getters, setters, and removers of the relevent
attributes. This allows operations to use their own storage for the
argument and result attributes.
Depends on D139471
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D139472
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch removes the concept of a `function_type`-named type attribute
as a requirement for implementors of FunctionOpInterface. Instead, this
type should be provided through two interface methods, `getFunctionType`
and `setFunctionTypeAttr` (*Attr because functions may use different
concrete function types), which should be automatically implemented by
ODS for ops that define a `$function_type` attribute.
This also allows FunctionOpInterface to materialize function types if
they don't carry them in an attribute, for example.
Importantly, all the function "helper" still accept an attribute name to
use in parsing and printing functions, for example.
Reviewed By: rriddle, lattner
Differential Revision: https://reviews.llvm.org/D139447
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D139650
|
|
|
|
|
|
| |
Reviewed By: aartbik, wrengr
Differential Revision: https://reviews.llvm.org/D139591
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Collapsing dimensions of size 1 with random strides (a.k.a.
non-contiguous w.r.t. collapsed dimensions) is a grey area that we'd
like to clean-up. (See https://reviews.llvm.org/D136483#3909856)
That said, the implementation in `memref-to-llvm` currently skips
dimensions of size 1 when computing the stride of a group.
While longer term we may want to clean that up, for now matches this
behavior, at least in the static case.
For the dynamic case, for this patch we stick to `min(group strides)`.
However, if we want to handle the dynamic cases correctly while allowing
non-truly-contiguous dynamic size of 1, we would need to `if-then-else`
every dynamic size. In other words `min(stride_i, for all i in group and
dim_i != 1)`.
I didn't implement that in this patch at the moment since
`memref-to-llvm` is technically broken in the general case for this. (It
currently would only produce something sensible for row major tensors.)
Differential Revision: https://reviews.llvm.org/D139329
|
|
|
|
|
|
|
| |
This is part of an effort to migrate from llvm::Optional to
std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
|
|
|
|
|
|
| |
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D139581
|
|
|
|
|
|
| |
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D139571
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal is to make the naming of the future `_extended` ops more
consistent. With unsigned addition, the carry value/flag and overflow
bit are the same, but this is not true when it comes to signed addition.
Also rename the second result from `carry` to `overflow`.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D139569
|
|
|
|
|
|
|
|
|
|
| |
At the moment, they are a part of EmptyOp::getCanonicalizationPatterns. When
extract_slice(tensor.empty) is rewritten as a new tensor.empty, it could
happen that we end up with two tensor.empty ops, since the original
tensor.empty can have two users. After bufferization such cases result in two
allocations.
Differential Revision: https://reviews.llvm.org/D139308
|
|
|
|
|
|
|
|
| |
The only way to do this with the current hoisting strategy is by
lowering Affine to Scf first, but that prevents further passes on
Affine.
Differential Revision: https://reviews.llvm.org/D137600
|
|
|
|
|
|
|
|
| |
annotated all dense result.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D139345
|
|
|
|
|
|
|
| |
This adds a tile_size parameter, when it is used the tiles are
cyclically distributed onto the threads of the scf.foreach_thread op.
Differential Revision: https://reviews.llvm.org/D139474
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D139540
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new function is a wrapper around the regular `getStridesAndOffset`
that offers a more compact way (as in writing less code) of getting the
relevant information.
This method is intended to be used only when it is known that the
LogicalResult of the regular `getStridesAndOffset` must be "succeeded".
This warpper will assert on that.
Differential Revision: https://reviews.llvm.org/D139529
|