53 Commits

Author SHA1 Message Date
Jordan Rupprecht
9576a100ae
[bazel] Port #152474: RemarkEngine (#154792) 2025-08-21 16:29:50 +00:00
Jordan Rupprecht
86f74c4d01
[bazel] Use rules_cc everywhere and reformat (#149584)
We already use cc rules from `@rules_cc//cc:defs.bzl` in a few files,
but this uses it everywhere. Done automatically by running `buildifier
--lint=fix
--warnings=native-cc-binary,native-cc-library,native-cc-test,load` over
all the files. I also ran `buildifier` once more to ensure there wasn't
any missing formatting, so that caused a few unrelated diffs.
2025-07-29 16:30:25 -05:00
Jordan Rupprecht
bc605f4ce8
[bazel] Port #151150: Move InitAll*** implementation into static library (#151183)
And prune deps when splitting
2025-07-29 12:25:32 -05:00
Benjamin Kramer
7e77aaebfb [bazel] Add missing dependency for 4af96a9d83335b3b59f3441af47c879c7a9eb183 2025-06-23 13:37:45 +02:00
Jorge Gorbe Moya
0eae457be3 [bazel] Add missing deps for 9ca46640062a6c0b955d16ad6f88305b534af8a3 2025-05-09 15:23:43 -07:00
Christian Sigg
9fe6f6a0d4
[bazel] Change gentbl_cc_library(tbl_outs) to dicts (#134349)
Follow up from https://github.com/llvm/llvm-project/pull/134271
2025-04-07 14:23:22 +02:00
Christian Sigg
083f80ff6b [mlir][bazel] Remove implementation from LinalgInterfaces target.
Move LinalgInterfaces.cpp from LinalgInterfaces to LinalgDialect target.

This allows TensorDialect to use header-only RelayoutOpInterface without introducing a hidden dependency on LinalgDialect (producing an `no-allow-shlib-undefined` error if a target depends on TensorDialect but not LinalgDialect).

Also reverts d64f177a2f because it's no longer needed.
2025-02-18 20:49:39 +01:00
Christian Sigg
d64f177a2f
[mlir][bazel] Fix no-allow-shlib-undefined errors.
The BUILD file changes in https://github.com/llvm/llvm-project/pull/127544 adds `LinalgInterfaces` which is incomplete without `LinalgDialect`.

For now, just add the `LinalgDialect` as dependency to tests which do not otherwise depend on it (but depend on `LinalgInterfaces` through e.g. `TensorDialect`).

This is a temporary solution until the dependency of `TensorDialect` is trimmed to just the `linalg::RelayoutOpInterface`, but not the other linalg interfaces. See https://github.com/llvm/llvm-project/pull/127544#pullrequestreview-2622065243.
2025-02-18 12:59:15 +01:00
Jakub Kuderski
b2f1d06986
[mlir][amdgpu] Improve Chipset version utility (#106169)
* Fix an OOB access
* Add comparison operators
* Add documentation
* Add unit tests
2024-08-28 09:55:38 -04:00
Keith Smiley
72c729f354
[bazel] Add support for --incompatible_disallow_empty_glob (#85999)
This bazel flag, that should be flipped in an upcoming release
https://github.com/bazelbuild/bazel/pull/15327, fails if globs have no
matches. This helps find libraries where you are accidentally not
including files because of typos. This change removes the various globs
that were not matching anything, and uncovered some targets that were
doing nothing because their source files were deleted. There are a few
cases where globs were intentionally optional in the case of loops that
expanded to different potential options, so those now use `allow_empty =
True`. This allows downstream consumers to also flip this flags for
their own builds, where previously this would fail in LLVM instead.

The downside to this change is that if files are added in these
relatively standard locations, manual work will have to be done to add
this patterns back. If folks prefer we could instead add `allow_empty =
True` to every glob.
2024-03-22 09:51:20 -07:00
Christian Sigg
83e5a12392
[mlir][bazel] Don't expose interface headers from //mlir:IR. (#85867)
Move 3 interface headers in `//mlir:IR` from `hdrs` to `srcs`.

Header files should not be added to multiple targets, but this is hard
to avoid because CMake is less strict with headers. But we should at
least avoid exposing them as headers by multiple targets because it
confuses tooling.
2024-03-21 12:21:44 +01:00
Jordan Rupprecht
e4f71959ec [bazel][NFC] Reformat w/ buildifier 2024-03-14 18:18:06 -07:00
Christian Sigg
c448bd8b04 [bazel][mlir] Add missing dependencies to //mlir/unittests/... targets. 2024-02-15 13:56:16 +01:00
Alex Zinenko
b32001a232 [mlir] update bazel for transform debug extension 2024-01-12 13:53:14 +00:00
Benjamin Kramer
fa981f57dd [bazel] Port 46708a5bcba28955b2ddeddf5c0e64398223642b 2023-12-09 11:39:34 +01:00
Adrian Kuegel
08d7d1ef9a [mlir][Bazel] Add missing dependencies after aa0208d1bc52e45dc0032f41e58b50d3134d1089 2023-10-20 08:52:14 +00:00
Mikhail Goncharov
141ca548e3 [bazel] fix build for 479057887fbc8bfef17c86694f78496c54550f21
for real
2023-10-10 10:13:08 +02:00
Mikhail Goncharov
962a049d64 [bazel] fix build for 479057887fbc8bfef17c86694f78496c54550f21 2023-10-10 10:09:14 +02:00
Christian Sigg
22f81b4cf4
[mlir][bazel] Fix after ef8c26b772 2023-10-06 15:06:53 +02:00
Christian Sigg
79c33d23c3
[mlir][bazel] Fix after ef8c26b772 2023-10-06 15:01:59 +02:00
Christian Sigg
1cd14adb25
[mlir][bazel] Fix after ef8c26b772 2023-10-06 14:43:45 +02:00
Christian Sigg
1c8c365de2
[mlir][bytecode] Check that bytecode source buffer is sufficiently aligned. (#66380)
Before this change, the `ByteCode` test failed on CentOS 7 with
devtoolset-9, because strings happen to be only 8 byte aligned. In
general though, strings have no alignment guarantee.

Increase resource alignment in test to 32 bytes. 
Adjust test to sufficiently align buffer.
Add test to check error when buffer is insufficiently aligned.
2023-09-17 13:46:01 +02:00
Oleg Shyshkov
85370b3068 [mlir][bazel] Fix build. 2023-09-15 10:32:21 +02:00
Nicolas Vasilache
52556c8e35 [mlir][Linalg] NFC - Retire LinalgToLLVM pass 2023-07-26 20:26:07 +02:00
Adrian Kuegel
3c83afb68b [mlir][Bazel] Adjust BUILD file for changes in 5e118f933b6590cecd7f1afb30845a1594bc4a5d 2023-05-02 08:37:44 +02:00
Emilio Cota
2e7d200210 [bazel][mlir] Fold :Observers and :BreakpointManagers into :Debug
To avoid circular deps.

While at it, add missing dep on CAPIIR.
2023-04-25 01:16:07 -04:00
Haojian Wu
17c6de3f1b [bazel] Fix bazel build for 7f069f5ef4fee00520ed0c350dca42c3c4b72b61 2023-04-22 13:59:45 +02:00
Adrian Kuegel
16b192f497 [mlir][Bazel] Adjust BUILD files to 0e9523efda8a4ad95ecb1d5b5e65e10bcc3711f5 2023-03-21 15:00:23 +01:00
Adrian Kuegel
6f8e7835f2 [mlir][Bazel] Adjustments for fa51c1753a274fbb7a71d8fe91fd4e5caf2fa4d3
Fix bazel build.

Differential Revision: https://reviews.llvm.org/D145903
2023-03-13 09:29:27 +01:00
Goran Flegar
d866f87f88 [bazel] Fix build after 28d04c5 2023-03-06 17:40:19 +01:00
Jordan Rupprecht
658bf08f67 [NFC][bazel] Enable layering_check for mlir/unittests 2023-01-19 03:40:59 -08:00
Jordan Rupprecht
f57557de70 [bazel] Update gtest move to third-party
a11cd0d94ed3cabf0998a0289aead05da94c86eb moved googletest to third-party.

This creates a corresponding BUILD file in third-party/unittest, moved from the chunk in llvm/BUILD.bazel.

We must refine the .bazelignore which is setup to ignore the benchmarking library so that we don't ignore the new dir here.
2022-11-09 20:48:11 -08:00
Jakub Kuderski
abc362a107 [mlir][arith] Change dialect name from Arithmetic to Arith
Suggested by @lattner in https://discourse.llvm.org/t/rfc-define-precise-arith-semantics/65507/22.

Tested with:
`ninja check-mlir check-mlir-integration check-mlir-mlir-spirv-cpu-runner check-mlir-mlir-vulkan-runner check-mlir-examples`

and `bazel build --config=generic_clang @llvm-project//mlir:all`.

Reviewed By: lattner, Mogball, rriddle, jpienaar, mehdi_amini

Differential Revision: https://reviews.llvm.org/D134762
2022-09-29 11:23:28 -04:00
Groverkss
8c867f7827 [MLIR][Presburger] Improve unittest parsing
This patch adds better functions for parsing MultiAffineFunctions and
PWMAFunctions in Presburger unittests.

A PWMAFunction can now be parsed as:

```
PWMAFunction result = parsePWMAF({
    {"(x, y) : (x >= 10, x <= 20, y >= 1)", "(x, y) -> (x + y)"},
    {"(x, y) : (x >= 21)", "(x, y) -> (x + y)"},
    {"(x, y) : (x <= 9)", "(x, y) -> (x - y)"},
    {"(x, y) : (x >= 10, x <= 20, y <= 0)", "(x, y) -> (x - y)"},
});
```

which is much more readable than the old format since the output can be
described as an AffineMap, instead of coefficients.

This patch also adds support for parsing divisions in MultiAffineFunctions
and PWMAFunctions which was previously not possible.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D133654
2022-09-15 19:28:49 +01:00
Haojian Wu
6c9d2ee490 Revert "Fix bazel build after 84d07d021333f7b5716f0444d5c09105557272e0."
This reverts commit 10250c5a2a2ca6be683ff940d776648a2d5968e3 as the
related patch is being reverted.
2022-09-15 20:02:27 +02:00
Haojian Wu
10250c5a2a Fix bazel build after 84d07d021333f7b5716f0444d5c09105557272e0. 2022-09-15 13:52:46 +02:00
Christian Sigg
69778121e4 [bazel] NFC: Move licenses declaration from package to function.
The `licences` attribute is deprecated, see https://docs.bazel.build/versions/4.0.0/be/common-definitions.html#common-attributes.
2022-09-05 10:47:06 +02:00
Benjamin Kramer
bb3d14ec8b [bazel] Stop building PassGenTest.cpp.inc, it was removed in 13ed6958df40b85fcc80250bb3f819863904ecee 2022-08-30 11:01:33 +02:00
Adrian Kuegel
9ef41ecb2a [mlir][Bazel] Fix bazel build. 2022-08-24 10:13:53 +02:00
Alexander Belyaev
4825614a46 [mlir] Update bazel build. 2022-07-26 16:28:29 +02:00
Weverything
de43f93a82 [bazel] Add new rule for c60b897d22b2feab3282c4fc2b390bc87560c7de 2022-07-25 20:29:01 -07:00
Alex Zinenko
333ee218ce [mlir] Transform dialect: separate dependent and generated dialects
In the Transform dialect extensions, provide the separate mechanism to
declare dependent dialects (the dialects the transform IR depends on)
and the generated dialects (the dialects the payload IR may be
transformed into). This allows the Transform dialect clients that are
only constructing the transform IR to avoid loading the dialects
relevant for the payload IR along with the Transform dialect itself,
thus decreasing the build/link time.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D130289
2022-07-25 09:59:53 +00:00
Matthias Springer
858be16670 [mlir][memref] Fix layout map computation in inferRankReducedResultType
Differential Revision: https://reviews.llvm.org/D128160
2022-06-21 10:08:26 +02:00
Mogball
d883a02a7c [mlir][ods] Remove StructAttr
Depends on D127373

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D127375
2022-06-21 01:10:05 +00:00
Benjamin Kramer
389c0b81d3 [bazel] Port 95aff23e2921 2022-06-03 20:43:23 +02:00
Adrian Kuegel
7733a61fbc [mlir][Bazel] Also fix mlir/unittests/BUILD.bazel. 2022-03-17 09:42:06 +01:00
Alex Zinenko
59814a8c99 [mlir] more Bazel changes for 23aa5a744666 2022-03-02 16:16:14 +01:00
Mehdi Amini
4e58cb18d3 Remove spurious includes and dependencies from Bazel files (NFC)
Differential Revision: https://reviews.llvm.org/D119526
2022-02-11 07:57:17 +00:00
Benjamin Kramer
355acf2bef [bazel] Port 755dc07d69ed
Still a fair bit of spaghetti in the unittest rules
2022-01-19 00:57:22 +01:00
Mogball
32e8b30d6e [mlir] Add unit test for disabling canonicalizer patterns (NFC) 2021-12-22 21:07:06 +00:00