| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
For some reason, even though D150822 passed the buildbot, it failed to
catch this test
Reviewed By: anlunx
Differential Revision: https://reviews.llvm.org/D150830
|
|
|
|
|
|
|
|
| |
The GPU tests weren't updated when rebasing D150330, so this patch fixes that.
Reviewed By: anlunx
Differential Revision: https://reviews.llvm.org/D150822
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is part of the migration of towards the new STEA syntax/design. In particular, this commit includes the following changes:
* Renaming compiler-internal functions/methods:
* `SparseTensorEncodingAttr::{getDimLevelType => getLvlTypes}`
* `Merger::{getDimLevelType => getLvlType}` (for consistency)
* `sparse_tensor::{getDimLevelType => buildLevelType}` (to help reduce confusion vs actual getter methods)
* Renaming external facets to match:
* the STEA parser and printer
* the C and Python bindings
* PyTACO
However, the actual renaming of the `DimLevelType` itself (along with all the "dlt" names) will be handled in a separate commit.
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D150330
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `irdl.any_of` operation represent a constraint that is satisfied
if any of its subconstraint is satisfied.
For instance, in the following example:
```
%0 = irdl.is f32
%1 = irdl.is f64
%2 = irdl.any_of(f32, f64)
```
`%2` can only be satisfied by `f32` or `f64`.
Note that the verification algorithm required by `irdl.any_of` is
non-trivial, since we want that the order of arguments of
`irdl.any_of` to not matter. For this reason, our registration
algorithm fails if two constraints used by `any_of` might be
satisfied by the same `Attribute`. This is approximated by checking
the possible `Attribute` bases of each constraints.
Depends on D145734
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D145735
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a representation for firstprivate clause modeled on the
private representation added in D150622.
The firstprivate recipe operation has an additional mandatory
region representing a sequences of operations needed to copy
the initial value to the created private copy.
Depends on D150622
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D150729
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently privatization is not well represented in the OpenACC dialect. This
patch is a prototype to model privatization with a dedicated operation that
declares how the private value is created and destroyed.
The newly introduced operation is `acc.private.recipe` and it declares
an OpenACC privatization. The operation requires one mandatory and
one optional region.
1. The initializer region specifies how to create and initialize a new
private value. For example in Fortran, a derived-type might have a
default initialization. The region has an argument that contains the
value that need to be privatized. This is useful if the type is not
a known at compile time and the private value is needed to create its
copy.
2. The destroy region specifies how to destruct the value when it reaches
its end of life. It takes the privatized value as argument.
A same privatization can be used for multiple operand if they have the same
type and do not require a specific default initialization.
Example:
```mlir
acc.private.recipe @privatization_f32 : f32 init {
^bb0(%0: f32):
// init region contains a sequence of operations to create and initialize the
// copy if needed.
} destroy {
^bb0(%0: f32):
// destroy region contains a sequences of operations to destruct the created
// copy.
}
// The privatization symbol is then used in the corresponding operation.
acc.parallel private(@privatization_f32 -> %a : f32) {
}
```
Reviewed By: razvanlupusoru, jeanPerier
Differential Revision: https://reviews.llvm.org/D150622
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These patterns touches the structure generated from tiling so it
affects later steps like bufferization and vector hoisting.
Instead of putting them in canonicalization, this commit creates
separate entry points for them to be called explicitly.
This is NFC regarding the functionality and tests of those patterns.
It also addresses two TODO items in the codebase.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D150702
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update operations in Transform dialect extensions defined in the Affine,
GPU, MemRef and Tensor dialects to use the more generic
`TransformHandleTypeInterface` type constraint instead of hardcoding
`PDL_Operation`. See
https://discourse.llvm.org/t/rfc-type-system-for-the-transform-dialect/65702
for motivation.
Remove the dependency on PDLDialect from these extensions.
Update tests to use `!transform.any_op` instead of `!pdl.operation`.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D150781
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 65429b9af6a2c99d340ab2dcddd41dab201f399c.
Broke several projects, see https://reviews.llvm.org/D144509#4347562 onwards.
Also reverts follow-up commit "[OpenMP] Compile assembly files as ASM, not C"
This reverts commit 4072c8aee4c89c4457f4f30d01dc9bb4dfa52559.
Also reverts fix attempt "[cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump"
This reverts commit 7d47dac5f828efd1d378ba44a97559114f00fb64.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds verification on registered IRDL operations, types,
and attributes.
This is done through an interface implemented by operations from the
`irdl` dialect, which translate the operations into `Constraint`.
This interface is then use in the `registerDialect` function to
generate verifiers for the entire operation/type/attribute.
Depends on D145733
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D145734
|
|
|
|
|
|
|
|
|
|
|
| |
The revision marks the overflow arithmetic intrinsics
and the freeze operation as pure. This change enables
inlining and possible other optimizations for these
operations.
Reviewed By: Dinistro
Differential Revision: https://reviews.llvm.org/D150679
|
|
|
|
|
|
|
|
| |
Add the saturation arithmetic intrinsics to the LLVM dialect.
Reviewed By: Dinistro
Differential Revision: https://reviews.llvm.org/D150676
|
|
|
|
|
|
|
|
|
|
|
|
| |
As we are moving on with new design for the private clause representation,
the reduction clause will aslo get remodeled. In order to new clash with
a new dedicated reduction operation, this patch rename the current
ReductionOp to ReductionOperator. It might just become obsolete once the new
design is in place.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D150711
|
|
|
|
|
|
| |
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D149564
|
|
|
|
|
|
| |
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D150692
|
|
|
|
|
|
|
|
| |
function calls
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D150477
|
|
|
|
|
|
|
|
|
|
|
|
| |
createOffloadEntriesAndInfoMetadata into OMPIRBuilder's finalize and initialize
This allows the generation of OpenMP offload metadata for the OpenMP
dialect when lowering to LLVM-IR and moves some of the shared logic
between the OpenMP Dialect and Clang into the IRBuilder.
Reviewers: jsjodin, jdoerfert, kiranchandramohan
Differential Revision: https://reviews.llvm.org/D148370
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split Linalg vectorization tests from "vectorization.mlir" across more
specialised test files:
* vectorize-tensor-extract.mlir - tests for tensor.extract with no
masking,
* vectorize-tensor-extract-masked.mlir - tests for tensor.extract with
masking,
* vectorization-masked.mlir - all other tests that use masking,
* vectorisation.mlir - the remaining tests.
Differential Revision: https://reviews.llvm.org/D149843
|
|
|
|
|
|
|
|
| |
Just add the trait as acc.yield is a return like op.
Reviewed By: razvanlupusoru, jeanPerier
Differential Revision: https://reviews.llvm.org/D150617
|
|
|
|
|
|
|
|
|
|
| |
The revision adds LLVM's is constant intrinsic.
Depends on D150643
Reviewed By: Dinistro
Differential Revision: https://reviews.llvm.org/D150660
|
|
|
|
|
|
| |
This is for consistency with other dialects.
Differential Revision: https://reviews.llvm.org/D150659
|
| |
|
|
|
|
|
|
|
|
|
| |
The revision adds the LLVM expect and expect.with.probability
intrinsics.
Reviewed By: Dinistro, ftynse
Differential Revision: https://reviews.llvm.org/D150643
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ModuleTranslation
There is memory explosion when converting the body or initializer region of a large global variable, e.g. a constant array.
For example, when translating a constant array of 100000 strings:
```
llvm.mlir.global internal constant @cats_strings() {addr_space = 0 : i32, alignment = 16 : i64} : !llvm.array<100000 x ptr<i8>> {
%0 = llvm.mlir.undef : !llvm.array<100000 x ptr<i8>>
%1 = llvm.mlir.addressof @om_1 : !llvm.ptr<array<1 x i8>>
%2 = llvm.getelementptr %1[0, 0] : (!llvm.ptr<array<1 x i8>>) -> !llvm.ptr<i8>
%3 = llvm.insertvalue %2, %0[0] : !llvm.array<100000 x ptr<i8>>
%4 = llvm.mlir.addressof @om_2 : !llvm.ptr<array<1 x i8>>
%5 = llvm.getelementptr %4[0, 0] : (!llvm.ptr<array<1 x i8>>) -> !llvm.ptr<i8>
%6 = llvm.insertvalue %5, %3[1] : !llvm.array<100000 x ptr<i8>>
%7 = llvm.mlir.addressof @om_3 : !llvm.ptr<array<1 x i8>>
%8 = llvm.getelementptr %7[0, 0] : (!llvm.ptr<array<1 x i8>>) -> !llvm.ptr<i8>
%9 = llvm.insertvalue %8, %6[2] : !llvm.array<100000 x ptr<i8>>
%10 = llvm.mlir.addressof @om_4 : !llvm.ptr<array<1 x i8>>
%11 = llvm.getelementptr %10[0, 0] : (!llvm.ptr<array<1 x i8>>) -> !llvm.ptr<i8>
%12 = llvm.insertvalue %11, %9[3] : !llvm.array<100000 x ptr<i8>>
... (ignore the remaining part)
}
```
where `@om_1`, `@om_2`, ... are string global constants.
Each time an operation is converted to LLVM, a new constant is created.
When it comes to `llvm.insertvalue`, a new constant array of 100000 elements is created and the old constant array (input) is not destroyed.
This causes memory explosion. We observed that, on a system with 128 GB memory, the translation of 100000 elements got killed due to using up all the memory.
On a system with 64 GB, 65536 elements was enough to cause the translation killed.
This patch fixes the issue by checking generated constants and destroyed them if there is no use.
By the fix, the translation of 100000 elements only takes about 1.6 GB memory, and finishes without any error.
Reviewed By: ftynse, kiranchandramohan
Differential Revision: https://reviews.llvm.org/D148487
|
| |
|
|
|
|
| |
Address review comment from https://reviews.llvm.org/D148947
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This revision modifies the mem2reg interfaces and algorithm to be more
omfortable to use as a pattern. The motivation behind this is that
currently the pattern needs to be applied to the scope op of the region
in which allocators should be promoted. However, a more natural way to
apply the pattern would be to apply it on the allocator directly. This
is not only clearer but easier to parallelize.
This revision changes the mem2reg pattern to operate this way. This
required restraining the interfaces to only mutate IR using
RewriterBase, as the previously used escape hatch is not granular enough
to match on the region that is modified only. This has the unfortunate
cost of preventing batching allocator promotion and making the block
argument adding logic more complex. Because batching no longer made any
sense, I made the internal analyzer/promoter decoupling private again.
This also adds statistics to the mem2reg infrastructure.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D150432
|
|
|
|
|
|
|
|
|
|
|
| |
All ops now support explicit type specification, update types to use
`!transform.any_op` instead of `!pdl.operation` for consistency.
Depends On D144515
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D150592
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Types have been introduced a while ago and provide for better
readability and transform-time verification. Use them in the ops from
the structured transform dialect extension.
In most cases, the types are appended as trailing functional types or a
derived format of the functional type that allows for an empty right
hand size without the annoying `-> ()` syntax (similarly to `func.func`
declaration that may omit the arrow). When handles are used inside mixed
static/dynamic lists, such as tile sizes, types of those handles follow
them immediately as in `sizes [%0 : !transform.any_value, 42]`. This
allows for better readability than matching the trailing type.
Update code to remove hardcoded PDL dependencies and expunge PDL from
structured transform op code.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D144515
|
|
|
|
|
|
|
|
|
| |
Representing matmuls as a sum of outer products is central to various
matrix extensions (e.g. Arm's SME). This test demonstrates how to use
Linalg's vectoriser and Vector's lowerings to represent `linalg.matmul`
as a chain of `vector.outerproduct` Ops.
Differential Revision: https://reviews.llvm.org/D150457
|
|
|
|
|
|
|
|
|
|
|
| |
The revision adds a flag to mlir translate that suppresses
any non-error diagnostics. The flag is useful when importing
LLVM IR to LLVM dialect, which produces a lot of
warnings due to dropped metadata and debug intrinsics.
Reviewed By: Dinistro
Differential Revision: https://reviews.llvm.org/D150547
|
|
|
|
|
|
| |
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D150628
|
|
|
|
|
|
|
|
| |
Consecutive element-wise negate should be canonicalized as no-op.
Reviewed By: eric-k256
Differential Revision: https://reviews.llvm.org/D150518
|
| |
|
|
|
|
|
|
|
|
| |
This allows `index` vectors to be converted to SPIR-V.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D150616
|
|
|
|
|
|
|
|
| |
dialect
This is part of an on-going migration to adopt Properties inside MLIR.
Differential Revision: https://reviews.llvm.org/D148976
|
|
|
|
|
|
| |
This is part of an on-going migration to adopt Properties inside MLIR.
Differential Revision: https://reviews.llvm.org/D148939
|
|
|
|
|
|
|
|
| |
dialect
This is part of an on-going migration to adopt Properties inside MLIR.
Differential Revision: https://reviews.llvm.org/D148938
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds QuantizationDialect to the dependent dialects of TOSA
This fixes the intermittent bug when creating uniform quantized type when none was parsed in.
LLVM ERROR: can't create type 'mlir::quant::UniformQuantizedType' because storage uniquer isn't initialized: the dialect was likely not loaded, or the type wasn't added with addTypes<...>() in the Dialect::initialize() method.
This happens, for example, in convert-tfl-uint8 pass when trying to create uniform quantized type i8 with zero-point=-128 to convert from ui8 type.
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I204248a45fd728d0cec8dc20214cb0b74de81e7b
Reviewed By: eric-k256
Differential Revision: https://reviews.llvm.org/D149354
|
|
|
|
|
| |
The Python bindings test aren't using properties yet, this is a bit
of a hack to support this here, but hopefully it'll be temporary.
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D150596
|
|
|
|
|
|
|
|
|
| |
getDiscardableAttrDictionary() when possible
This also speeds up some benchmarks in compiling simple fortan file by 2x!
Fixes #62687
Differential Revision: https://reviews.llvm.org/D150540
|
|
|
|
|
|
| |
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D150172
|
|
|
|
|
|
|
|
| |
This patch fixes:
mlir/lib/Dialect/MemRef/Utils/MemRefUtils.cpp:45:2: error: extra ';'
outside of a function is incompatible with C++98
[-Werror,-Wc++98-compat-extra-semi]
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sparse compiler now has two prototype strategies for GPU acceleration:
* CUDA codegen: this converts sparsified code to CUDA threads
* CUDA libgen: this converts pre-sparsified code to cuSPARSE library calls
This revision introduces the first steps required for the second approach.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D150170
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D150543
|
|
|
|
|
|
|
|
|
| |
This commit adds lowering of lib func
call to support erf in rocdl.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D150355
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Structured fusion proceeds by iteratively finding the next suitable
producer to be fused into the loop. Therefore, it shouldn't matter if
the same producer is listed multiple times (e.g., it is used as multiple
operands). Adjust the implementation of the transform op to support this
case.
Also fix the checking code in the interpreter to actually respect the
TransformOpInterface indication that repeated payload is allowed, it
seems to have been accidentally dropped in one of the refactorings.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D150561
|
|
|
|
|
|
| |
Block arguments and yielded values are not equivalent if there are not enough block arguments. This fixes #59442.
Differential Revision: https://reviews.llvm.org/D145575
|
|
|
|
|
|
| |
This is useful for debugging.
Differential Revision: https://reviews.llvm.org/D143314
|