13 Commits

Author SHA1 Message Date
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
6e58efac16
[mlir][bazel] Export headers either from :Transforms or :TransformUtils (#86819)
Split them according to their implementation.

Ideally, header files should be used by only one target, but this is
hard because CMake is less strict with headers (no layering check). But
even with bazel, headers should only be exported once in the `hdrs`
attribute. Other targets may use them in the `srcs` attribute to avoid
circular dependencies.
2024-03-28 20:12:27 +01: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
Christian Sigg
43b291cbec [bazel][mlir] Add missing dependencies to toy BUILD targets. 2024-02-15 13:40:39 +01:00
Johannes Reifferscheid
0c6759b576 [Bazel] Fixes for ec6da06. 2023-10-26 10:33:59 +02:00
Martin Erhart
34a35a8b24 [mlir] Move FunctionInterfaces to Interfaces directory and inherit from CallableOpInterface
Functions are always callable operations and thus every operation
implementing the `FunctionOpInterface` also implements the
`CallableOpInterface`. The only exception was the FuncOp in the toy
example. To make implementation of the `FunctionOpInterface` easier,
this commit lets `FunctionOpInterface` inherit from
`CallableOpInterface` and merges some of their methods. More precisely,
the `CallableOpInterface` has methods to get the argument and result
attributes and a method to get the result types of the callable region.
These methods are always implemented the same way as their analogues in
`FunctionOpInterface` and thus this commit moves all the argument and
result attribute handling methods to the callable interface as well as
the methods to get the argument and result types. The
`FuntionOpInterface` then does not have to declare them as well, but
just inherits them from the `CallableOpInterface`.
Adding the inheritance relation also required to move the
`FunctionOpInterface` from the IR directory to the Interfaces directory
since IR should not depend on Interfaces.

Reviewed By: jpienaar, springerm

Differential Revision: https://reviews.llvm.org/D157988
2023-08-31 11:28:23 +00:00
Jordan Rupprecht
261b693afd [bazel][NFC] Add Dialect/Func/Extensions library and deps
Added in D120368
2023-06-09 17:04:41 -07:00
Mikhail Goncharov
b28614c4fc [bazel] format bazel files NFC 2023-06-09 12:13:07 +02:00
Matthias Springer
e66f2beba8 [mlir][IR][NFC] Move CastOpInterface helpers to mlir/Interfaces
These helpers should not be part of the IR build unit.

The interface is now implemented on `builtin.unrealized_conversion_cast` with an external model.

Also rename the CastOpInterfaces Bazel target name to CastInterfaces to be consistent with the CMake target name.

Differential Revision: https://reviews.llvm.org/D146972
2023-06-02 08:39:46 +02:00
Adrian Kuegel
16b192f497 [mlir][Bazel] Adjust BUILD files to 0e9523efda8a4ad95ecb1d5b5e65e10bcc3711f5 2023-03-21 15:00:23 +01:00
Benjamin Kramer
7d9cf97f80 [bazel][mlir][examples] Add missing dependency for 72429a42ac33564fa82449d99dc234da32a05498 2023-02-15 10:33:49 +01: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
Christian Sigg
70ac466676 [Bazel] Add lit tests to bazel builds.
Add BUILD.bazel files for most of the MLIR tests and lit tests itself.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D133455
2022-09-15 07:49:37 +02:00