Commit Graph

2418 Commits

Author SHA1 Message Date
Dmitri Gribenko
5cbc421427 [bazel] Port 9c9d4b9e73 2024-12-04 10:33:15 +01:00
Augie Fackler
f6f16b5f54 [bazel] update for a0c4f854ca 2024-12-03 20:55:11 -05:00
Michael Jones
a0c4f854ca [libc] Change ctype to be encoding independent (#110574)
The previous implementation of the ctype functions assumed ASCII.
This patch changes to a switch/case implementation that looks odd, but
actually is easier for the compiler to understand and optimize.
2024-12-03 12:36:04 -08:00
Augie Fackler
e8b9e1354a [bazel] update config.h.cmake
for 4dafb091a0
reverts 1a1de2465d
2024-12-03 13:16:58 -05:00
Maksim Levental
61bf308cf2 Revert "[mlir python] Add nanobind support for standalone dialects." (#118517)
Reverts llvm/llvm-project#117922 because deps aren't met on some of the
post-commit build bots.
2024-12-03 09:26:33 -08:00
Peter Hawkins
afe75b4d5f [mlir python] Add nanobind support for standalone dialects. (#117922)
This PR allows out-of-tree dialects to write Python dialect modules
using nanobind instead of pybind11.

It may make sense to migrate in-tree dialects and some of the ODS Python
infrastructure to nanobind, but that is a topic for a future change.

This PR makes the following changes:
* adds nanobind to the CMake and Bazel build systems. We also add
robin_map to the Bazel build, which is a dependency of nanobind.
* adds a PYTHON_BINDING_LIBRARY option to various CMake functions, such
as declare_mlir_python_extension, allowing users to select a Python
binding library.
* creates a fork of mlir/include/mlir/Bindings/Python/PybindAdaptors.h
named NanobindAdaptors.h. This plays the same role, using nanobind
instead of pybind11.
* splits CollectDiagnosticsToStringScope out of PybindAdaptors.h and
into a new header mlir/include/mlir/Bindings/Python/Diagnostics.h, since
it is code that is no way related to pybind11 or for that matter,
Python.
* changed the standalone Python extension example to have both pybind11
and nanobind variants.
* changed mlir/python/mlir/dialects/python_test.py to have both pybind11
and nanobind variants.

Notes:
* A slightly unfortunate thing that I needed to do in the CMake
integration was to use FindPython in addition to FindPython3, since
nanobind's CMake integration expects the Python_ names for variables.
Perhaps there's a better way to do this.
2024-12-03 09:13:34 -08:00
Nick Desaulniers
68112f0f5b libc: fixup include path and bazel stale comments (#118510)
Downstream builders are having issues with this local include. Use a
fuller
path that's more standard throughout the codebase.

Also some of the comments in the bazel overlay are stale. Remove them.

Reported-by: Brooks Moses <bmoses@google.com>
2024-12-03 08:59:58 -08:00
Christian Sigg
6f55d7d22c [mlir][bazel] Port 79eb406a67 2024-11-28 11:54:32 +01:00
Christian Sigg
2585b6e8fa [mlir][bazel] Fix layering check failure. 2024-11-25 09:10:14 +01:00
Christian Sigg
b0bdbf4288 [mlir][bazel] Port 7498eaa9ab 2024-11-25 08:31:16 +01:00
Benjamin Kramer
c4d656a4e9 [bazel] Add missing dependencies for a0ef12c642 2024-11-24 11:27:37 +01:00
Benjamin Kramer
bd7d6c8066 [bazel] Port 776476c282 2024-11-24 11:21:04 +01:00
Mikhail Goncharov
b8eef18868 [bazel] port ecaf2c335c 2024-11-22 16:22:34 +01:00
Mikhail Goncharov
5bdee35544 [bazel] format utils/bazel/llvm-project-overlay/libc/libc_build_rules.bzl 2024-11-21 11:41:34 +01:00
Jeremy Kun
69cc3f096c Add mlir-query bazel rules (#116063)
I noticed there's no bazel query for `mlir-query`, unlike the other MLIR
tools, so adding one.
2024-11-20 20:24:24 -06:00
lntue
14667119bc [libc] Allow each function can have extra attributes by defining LLVM_LIBC_FUNCTION_ATTR_func macro. (#116160) 2024-11-20 17:50:00 -05:00
Haojian Wu
12cfa414a3 [bazel] Port for 08e7609692 2024-11-20 15:36:52 +01:00
Mikhail Goncharov
1bfcf89107 [bazel] port a8744066e9 2024-11-19 17:50:51 +01:00
Mikhail Goncharov
b64095c795 [bazel] port e370946978 2024-11-18 11:24:24 +01:00
Mikhail Goncharov
20c653c313 [bazel] port 63b926af5f 2024-11-18 11:00:33 +01:00
Daniel Thornburgh
95b680e4c3 [libc] Rename libc/src/__support/endian.h to endian_internal.h (#115950)
This prevents a conflict with the Linux system endian.h when built in
overlay mode for CPP files in __support.

This issue appeared in PR #106259.
2024-11-13 10:28:07 -08:00
Haojian Wu
716a095a80 [bazel] Port for 8cc616bc71 2024-11-13 15:59:29 +01:00
Haojian Wu
70d6789c7a [bazel] Port for 7302c8dbe7 2024-11-12 21:06:19 +01:00
Michael Jones
36cbc09e63 [libc][bazel] config macros is a support library (#115776)
Previously __support_macros_config was a cc_library, but making it a
libc_support_library makes things cleaner.
2024-11-11 14:16:53 -08:00
Haojian Wu
d1aa0da7e2 [bazel] Port for ffc7feadec 2024-11-11 09:00:43 +01:00
weiwei chen
fb4f426c81 [Bazel] Add a comment why an export file is needed. (#115556)
- [x] Add follow-up comment on why the export file is needed in
BUILD.bazel
2024-11-08 23:15:22 -05:00
Pranav Kant
cb98366ea4 [bazel][libc] Add exp10m1f (#115565) 2024-11-08 15:32:25 -08:00
Pranav Kant
0dbdb3251f [bazel] Remove mlir-spirv-cpu-runner after 0e39b1348e5fcadb129a6f113e… (#115533)
…5d708a526d8faa
2024-11-08 11:01:31 -08:00
weiwei chen
a749c98b49 [Baze] Add missing lldbDataFormatter.py back to BUILD.bazel. (#115519)
- [x] Add `utils/lldbDataFormatters.py` back.
2024-11-08 13:26:57 -05:00
Haojian Wu
2f243a5fb7 [bazel] Port for 0e39b1348e 2024-11-08 16:41:58 +01:00
JoelWee
0c0d7a6ec7 [MLIR] Fix bazel after 2f743ac 2024-11-07 10:51:00 +00:00
Pranav Kant
df0a56cdd9 [bazel] Fix AMXDialect (#115221) 2024-11-06 14:19:16 -08:00
Pranav Kant
ff533b94b7 [bazel] Add dep to BuiltinDialectTdFiles (#115217) 2024-11-06 13:33:13 -08:00
Michael Jones
aae5a38e4e [libc][bazel] Mark socket functions weak (#115088)
Downstream ther'es a user that needs the syscall wrappers to be weak. I
intend to set up a proper mechanism for just listing which functions
should be weak eventually, but for now this is necessary.
2024-11-06 10:29:07 -08:00
Pranav Kant
8dd9f206b5 [bazel] Fix mlir:VectorToSPIRV (#115188) 2024-11-06 09:56:50 -08:00
Alexey Samsonov
2f48765b45 [libc][bazel] Remove -mllvm --tail-merge-threshold=0 from Bazel. (#115061)
Follow-up on the `-mllvm --tail-merge-threshold=0` removal promised in
aeccc16497 (see
b2a9ea4420 commit message on why we don't
need this in Bazel, and will only keep in AArch64-specific compile flags
in CMake build).
2024-11-06 10:51:08 +01:00
Pranav Kant
c8221359f0 [bazel] Add dep on Analysis to fix build break (#115033) 2024-11-05 09:44:29 -08:00
Pranav Kant
8dfd9ff4b5 [bazel] Unbreak bazel bot (#115016)
Broken first by #114620
2024-11-05 08:23:46 -08:00
Pranav Kant
41312b011a [bazel] Add :support to ast target (#115014) 2024-11-05 08:20:18 -08:00
Dmitri Gribenko
21f8e8c918 [bazel][libc] Port 9cfe3028ca (part 2) 2024-11-05 12:35:02 +01:00
Pranav Kant
2d2371df0f [bazel][libc] Fix bazel build (#114917) 2024-11-04 19:10:57 -08:00
Vincent Lee
bb9ff32867 [bazel] Clean up unused exported files (#114620)
Some minor cleanup to the bazel files. These exported files are not
being referenced anymore in the tree, afaict, so let's clean them up.
Additionally, moved one of the filegroup targets higher to be consistent
with other filegroup usages where it's defined before first usage.
2024-11-04 15:22:38 -08:00
Benjamin Kramer
8528130a0c [bazel] Add missing dependency for 704808c275 2024-11-04 22:42:32 +01:00
Benjamin Kramer
89b948d0ab [bazel][lld] Port 9a450a0096 2024-11-03 18:27:59 +01:00
Benjamin Kramer
53ce5daf2c [bazel][mlir] Port a6e72f9392 2024-11-03 18:23:49 +01:00
Benjamin Kramer
1b1e325583 [bazel][libc] Port 33bdb53d86 2024-11-03 18:11:55 +01:00
Alexey Samsonov
33d636f0f6 [libc][bazel] Fix linter warning - remove unused load. (#114493)
This load is no longer necessary since PLATFORM_CPU_ARM64 was removed in
fa17977c31
2024-10-31 17:34:39 -07:00
Jorge Gorbe Moya
93d12d4881 Revert "[Bazel] Fix for 1bc58a258e2edb6221009a26d0f0037eda6c7c47" (#114444)
This reverts commit 5ce8a93ebb.

Commit 1bc58a258e was reverted in
a9a8351ef1, so the bazel fix is no longer
needed.
2024-10-31 11:21:04 -07:00
Dmitry Chernenkov
ca9f5b6c3e [Bazel] Fix for 0f8a6b7d03 2024-10-31 17:13:23 +00:00
Dmitry Chernenkov
5ce8a93ebb [Bazel] Fix for 1bc58a258e 2024-10-31 17:13:23 +00:00