Commit Graph

261 Commits

Author SHA1 Message Date
Matthias Springer e448c793c6 [mlir][bufferize][NFC] Move std BufferizableOpInterfaceImpl to std dialect
Also reimplement `std-bufferize` in terms of BufferizableOpInterface-based bufferization. The old `std.select` bufferization pattern is no longer needed and deleted.

Differential Revision: https://reviews.llvm.org/D118559
2022-01-30 22:12:14 +09:00
Matthias Springer 19efe141f7 [mlir][bufferize][NFC] Move scf BufferizableOpInterface impl to scf dialect
Differential Revision: https://reviews.llvm.org/D118557
2022-01-30 21:53:33 +09:00
Matthias Springer 7a9765e8a8 Update BUILD.bazel.
This should have been done as part of D118483.
2022-01-30 21:49:49 +09:00
wren romano b85ed4e0e1 [mlir][sparse] Adding standard pipeline for tests.
Addresses https://bugs.llvm.org/show_bug.cgi?id=52409 aka https://github.com/llvm/llvm-project/issues/51751

Reviewed By: aartbik, mehdi_amini

Differential Revision: https://reviews.llvm.org/D117919
2022-01-28 15:11:12 -08:00
Jordan Rupprecht 282c83c323 [libc] Add missing sqrt deps for layering checks 2022-01-28 12:11:27 -08:00
Tue Ly ad4ee2d778 [libc] Refactor sqrt implementations and add tests for generic sqrt implementations.
Re-apply https://reviews.llvm.org/D118173 with fix for aarch64.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D118433
2022-01-28 13:39:03 -05:00
Adrian Kuegel f40475c7fd [mlir] Move SCF utils implementations to SCF/Utils.
BEGIN_PUBLIC
[mlir] Move SCF utils implementations to SCF/Utils.
END_PUBLIC
2022-01-28 11:54:27 +01:00
Adrian Kuegel c962b3fdf8 [mlir][Bazel][cmake] Add missing dependency.
After 2c7b0685e1 this dependency is needed.
2022-01-28 08:20:24 +01:00
Siva Chandra Reddy 4beba3a32a [libc] Revert "Refactor sqrt implementations and add tests for generic sqrt implementations."
This reverts commit 21c4c82c20.
2022-01-27 21:06:14 +00:00
Tue Ly 21c4c82c20 [libc] Refactor sqrt implementations and add tests for generic sqrt implementations.
Refactor sqrt implementations:
- Move architecture specific instructions from `src/math/<arch>` to `src/__support/FPUtil/<arch>` folder.
- Move generic implementation of `sqrt` to `src/__support/FPUtil/generic` folder and add it as a header library.
- Use `src/__support/FPUtil/sqrt.h` for architecture/generic selections.
- Add unit tests for generic implementation of `sqrt`.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D118173
2022-01-27 11:54:54 -05:00
Matthias Springer 075e3fdda1 [mlir][bufferize] Move arith BufferizableOpInterface impl to arith dialect
Also switch the implementation of `-arith-bufferize` to BufferizableOpInterface.

Differential Revision: https://reviews.llvm.org/D118325
2022-01-28 01:40:22 +09:00
Adrian Kuegel 199c2d63fd [mlir][Bazel] Add TestMemRef target.
Needed after D118285

Differential Revision: https://reviews.llvm.org/D118330
2022-01-27 09:54:01 +01:00
Adrian Kuegel a911a69408 [mlir][Bazel] Add missing dependency to ArithmeticTransforms. 2022-01-27 09:31:55 +01:00
Benjamin Kramer f32dccb9a4 [bazel] Port 480cd4cb 2022-01-26 23:24:45 +01:00
Jordan Rupprecht e7cf109587 [bazel] Enable layering_check for MLIR test directory
This would have enabled me to notice the MLIR test file needed updating too, preventing the test file of 2074eef5db from being necessary.

layering_check is already enabled in mlir/BUILD.bazel. I don't know why I didn't see the other breakage there.

Differential Revision: https://reviews.llvm.org/D118125
2022-01-26 13:37:42 -08:00
jonmeow 4691f00a63 Initialize terminfo.bzl linkopts to None
The underlying issue here is that line 125 checks if linkopts was assigned (by line 120) but it's not initialized, so that becomes a crash. This was noticed by someone trying to use Docker, so no terminfo library installed.

Reviewed By: GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D118270
2022-01-26 11:03:26 -08:00
Adrian Kuegel 1a6e60d01f [Bazel] Update config.h to add the new define. 2022-01-26 18:30:38 +01:00
Adrian Kuegel b61c878fc5 [mlir][Bazel] Remove unnecessary dependencies
Differential Revision: https://reviews.llvm.org/D118221
2022-01-26 10:55:40 +01:00
Adrian Kuegel a83e9266b9 [mlir][Bazel] Update BUILD.bazel file 2022-01-25 12:33:42 +01:00
Benjamin Kramer 2074eef5db [bazel] Adjust dependencies after a70aa7bb
These are all picked up transitively, but fail with
--features=layering_check, which enforces header dependencies.
2022-01-25 11:49:45 +01:00
Jordan Rupprecht 71cb5ed03c [bazel] Update MLIR deps
I believe this is due to D117839, D117848, maybe others.

Latest build failure: https://buildkite.com/llvm-project/upstream-bazel-rbe/builds/18053
2022-01-24 21:24:36 -08:00
Clint Caywood 57eb5033cd [libc] Add bazel definition for hypot/hypotf.
Patch by Clint Caywood.

Differential Revision: https://reviews.llvm.org/D118053
2022-01-24 09:54:23 -08:00
Matthias Springer b00ee46b5e [mlir][bufferize][NFC] Implement BufferizableOpInterface on bufferization ops directly
No longer go through an external model. Also put BufferizableOpInterface into the same build target as the BufferizationDialect. This allows for some code reuse between BufferizationOps canonicalizers and BufferizableOpInterface implementations.

Differential Revision: https://reviews.llvm.org/D117987
2022-01-25 01:23:26 +09:00
Matthias Springer 49e3700069 [mlir][tensor] Move BufferizableOpInterface impl to tensor dialect
This is in preparation of unifying the existing bufferization with One-Shot bufferization.

A subsequent commit will replace `tensor-bufferize`'s implementation with the BufferizableOpInterface-based implementation and move over missing test cases.

Differential Revision: https://reviews.llvm.org/D117984
2022-01-24 23:54:49 +09:00
Alexander Belyaev fd0c6f5391 [mlir] Move linalg::PadTensorOp to tensor::PadOp.
RFC: https://llvm.discourse.group/t/rfc-move-linalg-padtensorop-to-tensor-padop/5785

Differential Revision: https://reviews.llvm.org/D117892
2022-01-21 20:02:39 +01:00
Tres Popp 99b5a8049b Match bazel config with cmake after f29256a64 2022-01-21 09:50:05 +01:00
Matthias Springer 7a1579ac67 [mlir][bufferization] Move one-shot bufferization to Bufferization dialect
This commit is the first step towards unifying core bufferization and One-Shot Bufferize.

This commit does not move over the implementations of BufferizableOpInterface yet. This will be done in separate commits. This change does also not move the unit tests yet. The tests will be moved together with op interface implementations and split into separate files.

Differential Revision: https://reviews.llvm.org/D117641
2022-01-20 18:21:20 +09:00
Matthias Springer cd0a923b4c [mlir][linalg][bufferize][NFC] Move analysis-related code to Comprehensive Bufferize
The code in `BufferizableOpInterface`'s header/source no longer contains any analysis code. This makes it easier to run the bufferization with a different analysis or without any analysis.

Differential Revision: https://reviews.llvm.org/D117478
2022-01-19 22:25:36 +09:00
Benjamin Kramer 579c4921c0 [bazel] Fix the python bindings for 7ceffae18c
Also run buildifier.
2022-01-19 14:21:21 +01:00
Benjamin Kramer 73cc8dd2d7 [bazel] Port 7ceffae18c 2022-01-19 14:14:36 +01:00
Matthias Springer b44defa5a5 [mlir][linalg][bufferize] Generalize destination-passing style detection
If not allow-return-memref, raise an error if a new memory allocation is returned/yielded from a block. We do not check for new allocations directly, but for ops that yield/return values that are not equivalent to values that are defined outside of the current of the block.

Note: We still need to check that scf.for yield values and bbArgs are aliasing to ensure that getAliasingOpOperand/getAliasingOpResult is correct.

Differential Revision: https://reviews.llvm.org/D116687
2022-01-19 18:21:29 +09:00
Benjamin Kramer 355acf2bef [bazel] Port 755dc07d69
Still a fair bit of spaghetti in the unittest rules
2022-01-19 00:57:22 +01:00
Mogball 7294d7dae7 [mlir] Fix bazel build of GPU dialect 2022-01-18 22:41:04 +00:00
Mogball aae5125550 [mlir] Replace StrEnumAttr -> EnumAttr in core dialects
Removes uses of `StrEnumAttr` in core dialects

Reviewed By: mehdi_amini, rriddle

Differential Revision: https://reviews.llvm.org/D117514
2022-01-18 17:15:00 +00:00
Stella Laurenzo b93eded7b9 [bazel] Separate capi_deps from deps in mlir_c_api_cc_library.
This is important because *Objects targets need to only depend on other *Objects targets, not on the unsuffixed CAPI rules. Depending on how it is linked in the current setup, it can cause duplicate symbols.

Differential Revision: https://reviews.llvm.org/D117176
2022-01-14 06:08:01 +00:00
Denys Shabalin a8a2ee6331 [mlir] Introduce C API for PDL dialect types
This change introduces C API helper functions to work with PDL types.
Modification closely follow the format of the https://reviews.llvm.org/D116546.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D117221
2022-01-13 15:29:01 +01:00
natashaknk 310e9636ca [tosa][mlir] Support dynamic batch dimension for ops where the batch dim is explicit
Dynamic batch for rescale, gather, max_pool, avg_pool, conv2D and depthwise_conv2D. Split helper functions into a separate header file.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D117031
2022-01-12 14:16:50 -08:00
Chia-hung Duan c025fd8b0b [mlir] Update BUILD rule for MathDialect.
1773dddadf adds the dependency to
ArithmeticDialect.

Reviewed By: rdzhabarov, ftynse

Differential Revision: https://reviews.llvm.org/D117127
2022-01-12 18:11:31 +00:00
Matthias Springer 6c654b5198 [mlir][linalg][bufferize] Support std.select bufferization
This op is an example for how to deal with ops who's OpResult may aliasing with one of multiple OpOperands.

Differential Revision: https://reviews.llvm.org/D116868
2022-01-12 17:46:44 +09:00
James Y Knight 228dfc0927 Fix bazel build after f77d115cc1. 2022-01-11 19:32:29 +00:00
James Y Knight 0a6f1c5f97 Fix bazel build after 8503c688d5. 2022-01-11 17:42:49 +00:00
Matthias Springer 15c7e3ee15 [mlir][linalg][bufferize][NFC] Use RewritePatterns instead of custom traversal
This change simplifies BufferizableOpInterface and other functions. Overall, the API will get smaller: Functions related to custom IR traversal are deleted entirely. This will makes it easier to write BufferizableOpInterface implementations.

This is also in preparation of unifying Comprehensive Bufferize and core bufferization. While Comprehensive Bufferize could theoretically maintain its own IR traversal, there is no reason to do so, because all bufferize implementations in BufferizableOpInterface have to support partial bufferization anyway. And we can share a larger part of the code base between the two bufferizations.

Differential Revision: https://reviews.llvm.org/D116448
2022-01-07 00:56:54 +09:00
Chuanqi Xu bbce75e352 Update Bug report URL to Github Issues
Although we moved to Github Issues. The bug report message refers to
Bugzilla still. This patch tries to update these URLs.

Reviewed By: MaskRay, Quuxplusone, jhenderson, libunwind, libc++

Differential Revision: https://reviews.llvm.org/D116351
2022-01-06 17:33:25 +08:00
Alex Zinenko 95ddbed9b7 [mlir] Split out Python bindings for dialects into separate libs
Historically, the bindings for the Linalg dialect were included into the
"core" bindings library because they depended on the C++ implementation
of the "core" bindings. The other dialects followed the pattern. Now
that this dependency is gone, split out each dialect into a separate
Python extension library.

Depends On D116649, D116605

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D116662
2022-01-06 10:31:14 +01:00
Alex Zinenko 66d4090d9b [mlir] Introduce Python bindings for the quantization dialect
So far, only the custom dialect types are exposed.

The build and packaging is same as for Linalg and SparseTensor, and in
need of refactoring that is beyond the scope of this patch.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D116605
2022-01-05 16:26:31 +01:00
Alex Zinenko 9bcf13bf3e [mlir] Introduce C API for the Quantization dialect types
Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D116546
2022-01-05 16:20:29 +01:00
wren romano 85b8d03e12 [mlir][sparse] Factoring out Transforms/CodegenUtils.{cpp,h}
This moves a bunch of helper functions from `Transforms/SparseTensorConversion.cpp` into `Transforms/CodegenUtils.{cpp,h}` so that they can be reused by `Transforms/Sparsification.cpp`, etc.

See also the dependent D115010 which cleans up some corner cases in this change.

Reviewed By: aartbik, rriddle

Differential Revision: https://reviews.llvm.org/D115008
2022-01-04 16:11:47 -08:00
Alexander Belyaev c8e988fa78 [mlir] Fix bazel build after b4130e9ead.
b4130e9ead
2022-01-04 07:59:51 +01:00
Mogball 4943cda398 [mlir][arith] fixing dependencies on memref/arith 2021-12-30 20:39:22 +00:00
Fangrui Song 95c25fd52a [Bazel] Make mlir:MemRefOpsTdFiles depend on :ArithmeticOpsTdFiles 2021-12-30 11:47:54 -08:00