1874 Commits

Author SHA1 Message Date
Guillaume Chatelet
aa6e7a61c5
[libc][NFC] Remove integer_utils.h (#84466)
Its sole user is `BigInt` so moving `full_mul` inside UInt.h.
2024-03-08 14:16:42 +01:00
Dmitry Chernenkov
4d478bcb4f [bazel] Add support_uint dep in libc unittest 2024-03-08 11:54:19 +00:00
Christian Sigg
005e182ecb
[clang][bazel] Fix BUILD after da00c60dae0040185dc45039c4397f6e746548e9
Second attempt. This also reverts 50633868538d4fd6875a7de57804b3dde5c86108.
2024-03-08 11:55:19 +01:00
Christian Sigg
5063386853
[clang][bazel] Fix BUILD after da00c60dae0040185dc45039c4397f6e746548e9 2024-03-08 11:47:38 +01:00
Christian Sigg
dd547d5cca
[mlir][bazel] Fix BUILD after 5669660f37ef1800f4a7852577364b024d75e3d8
Second attempt.
2024-03-08 11:39:59 +01:00
Christian Sigg
419e8da2da
[mlir][bazel] Fix BUILD after 5669660f37ef1800f4a7852577364b024d75e3d8 2024-03-08 11:37:10 +01:00
Tina Jung
0ddb122147
[mlir][emitc] Arith to EmitC conversion: constants (#83798)
* Add a conversion from `arith.constant` to `emitc.constant`.
* Drop the translation for `arith.constant`s.
2024-03-08 09:16:10 +01:00
Boian Petkantchin
fb582b6ace
[mlir] Implement Mesh's ShardingInterface for Linalg ops (#82284)
Allows linalg structured operations to be handled during spmdization and
sharding propagation.

There is only support for projected permutation indexing maps.
2024-03-07 17:05:44 -08:00
Benjamin Kramer
4f85f620b6 [bazel] Port 3714f937b835c06c8c32ca4f3f61ba2317db2296 2024-03-07 20:54:02 +01:00
Guillaume Chatelet
c103d573e7
[libc] Fix forward missing BigInt specialization of mask_leading_ones / mask_trailing_ones (#84325)
#84299 broke the arm32 build, this patch fixes it forward.
2024-03-07 20:00:05 +01:00
Guillaume Chatelet
245d669f1d
[reland][libc] Remove UB specializations of type traits for BigInt (#84299)
Note: This is a reland of #84035.

The standard specifies that it it UB to specialize the following traits:
 - `std::is_integral`
 - `std::is_unsigned`
 - `std::make_unsigned`
 - `std::make_signed`

This patch:
 - Removes specializations for `BigInt`
 - Transforms SFINAE for `bit.h` functions from template parameter to
   return type (This makes specialization easier).
 - Adds `BigInt` specialization for `bit.h` functions.
 - Fixes code depending on previous specializations.
2024-03-07 11:41:35 +01:00
Marius Brehler
c40146c214
[mlir][EmitC] Add Arith to EmitC conversions (#84151)
This adds patterns and a pass to convert the Arith dialect to EmitC. For
now, this covers arithemtic binary ops operating on floating point
types.

It is not checked within the patterns whether the types, such as the
Tensor type, are supported in the respective EmitC operations. If
unsupported types should be converted, the conversion will fail anyway
because no legal EmitC operation can be created. This can clearly be
improved in a follow up, also resulting in better error messages.
Functions for such checks should not solely be used in the conversions
and should also be (re)used in the verifier.
2024-03-07 11:34:11 +01:00
Guillaume Chatelet
27844cb2fa
Revert "[libc] Remove UB specializations of type traits for BigInt" (#84297)
Reverts llvm/llvm-project#84035

Several bots are failing:
 - https://lab.llvm.org/buildbot/#/builders/223/builds/37522
 - https://lab.llvm.org/buildbot/#/builders/162/builds/51978
 - https://lab.llvm.org/buildbot/#/builders/163/builds/52560
 - https://lab.llvm.org/buildbot/#/builders/250/builds/19619
2024-03-07 11:06:50 +01:00
Guillaume Chatelet
84f483dbee
[libc] Remove UB specializations of type traits for BigInt (#84035)
The standard specifies that it it UB to specialize the following traits:
 - `std::is_integral`
 - `std::is_unsigned`
 - `std::make_unsigned`
 - `std::make_signed`

This patch:
 - Removes specializations for `BigInt`
 - Transforms SFINAE for `bit.h` functions from template parameter to
   return type (This makes specialization easier).
 - Adds `BigInt` specialization for `bit.h` functions.
 - Fixes code depending on previous specializations.
2024-03-07 11:01:09 +01:00
mmilanifard
51e23545e7
Revert "Adding missing dependencies to BUILD.bazel" (#84251)
Reverts llvm/llvm-project#84235
With changes in #84238 these dependencies are not required.
2024-03-06 20:43:22 -06:00
Ingo Müller
395bc7909e
[mlir][bazel] Don't set MLIR_ENABLE_NVPTXCOMPILER on if_cuda_available. (#84238)
was available. However, it turns out that the NVPTX compiler is not part
of every CUDA distribution, so `if_cuda_available` may evaluate to true
without that compiler being present, which breaks the build. This PR
thus sets the macro to 0 always (which was the behavior before #84007).
2024-03-06 23:36:21 +01:00
mmilanifard
1ed15cd5de
Adding missing dependencies to BUILD.bazel (#84235)
Build fix after (#84007).
2024-03-06 16:18:13 -05:00
Benjamin Kramer
2b184c8f64 [bazel] Add missing dependencies for 2542d34522784e27850a17a8c39a1ad4b43622ab 2024-03-06 21:10:39 +01:00
Ingo Müller
099045a045
[mlir][nvvm] Expose MLIR_NVPTXCOMPILER_ENABLED in mlir-config.h. (#84007)
This is another follow-up of #83004, which made the same change for
`MLIR_CUDA_CONVERSIONS_ENABLED`. As the previous PR, this PR commit
exposes mentioned CMake variable through `mlir-config.h` and uses the
macro that is introduced with the same name. This replaces the macro
`MLIR_NVPTXCOMPILER_ENABLED`, which the CMake files previously defined
manually.
2024-03-06 14:14:53 +01:00
Ingo Müller
be15a6b3b6
[mlir][opt] Expose MLIR_ENABLE_DEPRECATED_GPU_SER... in mlir-config.h. (#84006)
This is another follow-up of #83004, which made the same change for
`MLIR_CUDA_CONVERSIONS_ENABLED`. As the previous PR, this PR commit
exposes mentioned CMake variable through `mlir-config.h` and uses the
macro that is introduced with the same name. This replaces the macro
`MLIR_ENABLE_DEPRECATED_GPU_SERIALIZATION`, which the CMake files
previously defined manually.
2024-03-06 14:14:07 +01:00
Ingo Müller
d70254a623
[mlir][nvvm] Add missing include to llvm-config.h. (#83998)
This is another follow-up of #83004. `NVVM/Target.cpp` uses the macro
`MLIR_NVPTXCOMPILER_ENABLED`, which is defined in `llvm-config.h` but
did not include that file, yielding a warning when compiled with
`-Wundef`. This PR adds the include.

~~This is another follow-up of #83004, which made the same change for
`MLIR_CUDA_CONVERSIONS_ENABLED`. As the previous PR, this PR commit
exposes mentioned CMake variable through `mlir-config.h` and uses the
macro that is introduced with the same name. This replaces the macro
`MLIR_NVPTXCOMPILER_ENABLED`, which the CMake files previously defined
manually.~~
2024-03-06 10:13:12 +01:00
Ingo Müller
f3be842728
[mlir] Expose MLIR_ROCM_CONVERSIONS_ENABLED in mlir-config.h. (#83977)
This is a follow up of #83004, which made the same change for
`MLIR_CUDA_CONVERSIONS_ENABLED`. As the previous PR, this PR commit
exposes mentioned CMake variable through `mlir-config.h` and uses the
macro that is introduced with the same name. This replaces the macro
`MLIR_ROCM_CONVERSIONS_ENABLED`, which the CMake files previously
defined manually.
2024-03-05 15:37:14 +01:00
Jordan Rupprecht
d016712b2c
[bzl] Remove obsolete output_to_genfiles = True (#83944)
The [bazel docs](https://bazel.build/rules/lib/globals/bzl#rule)
discourage setting this. The comments about being necessary for headers
or genrules seem to be obsolete, at least for the LLVM tree itself.

The effect of this is that generated files will go to `bazel-bin`
instead of `bazel-genfiles`.

One external use was fixed here:
32bb3b0613.
2024-03-04 21:00:04 -08:00
Joseph Huber
c996023f9a
[libc] Provide an implementation of the 'stdint.h' header (#83353)
Summary:
I've noticed one problem is that the user includes `stdint.h` the
compiler will do `#include_next <stdint.h>` potentially into a
conflicting implementation on systems with multiple headers installed.
The `clang` header is standards compliant and works with `clang` and
`gcc` which are both of our targets, so I simply copied it here. This
has the effect of including `stdint.h` on clang / LLVM libc behaving the
same as `-ffreestanding`.
2024-03-04 12:23:11 -06:00
Ingo Müller
c6565f22be
[mlir][bazel] Remove defines of obsolete MLIR_GPU_TO_CUBIN_PASS_ENABLE. (#83006)
This macro is obsolete since the landing of #82486 but was forgotten to
be removed from the BUILD files.
2024-03-04 10:27:02 +01:00
Guillaume Chatelet
53bd411e51
[libc][NFC] rename float.h macro file to types.h (#83190) 2024-02-29 10:28:53 +01:00
Fangrui Song
d1f04443b1 [Bazel] Port clangInstallAPI changes #82293 and #82552 2024-02-28 12:49:15 -08:00
Ingo Müller
9e14320695 [bazel] Fix breakage from 915fce040271c77df1ff9b2c8797c441cec0d18d.
That commit (from #82189) introduces a new dependency but does not
declare it in the BUILD files.
2024-02-28 13:59:04 +00:00
Ingo Müller
5f2097dbed
[mlir] Expose MLIR_CUDA_CONVERSIONS_ENABLED in mlir-config.h. (#83004)
That macro was not defined in some cases and thus yielded warnings if
compiled with `-Wundef`. In particular, they were not defined in the
BUILD files, so the GPU targets were broken when built with Bazel. This
commit exposes mentioned CMake variable through mlir-config.h and uses
the macro that is introduced with the same name. This replaces the macro
MLIR_CUDA_CONVERSIONS_ENABLED, which the CMake files previously defined
manually.
2024-02-28 14:48:40 +01:00
Mikhail Goncharov
a4fff36b6c [bazel] Add "include/" for libc includes
for 04e8653f189bf3d65680c7fb3b3033ad82903ee9 #83199
2024-02-28 09:33:27 +01:00
Michael Jones
8e3b60540c
[libc] Add fixed point support to printf (#82707)
This patch adds the r, R, k, and K conversion specifiers to printf, with
accompanying tests. They are guarded behind the
LIBC_COPT_PRINTF_DISABLE_FIXED_POINT flag as well as automatic fixed
point support detection.
2024-02-27 11:03:20 -08:00
Guillaume Chatelet
ac86a76ed5
[libc][NFC] Delete unused file (#82980)
Indentified in
https://github.com/llvm/llvm-project/pull/77741#pullrequestreview-1893531270
2024-02-26 15:24:12 +01:00
Aart Bik
1c2456d659
[mlir][sparse] remove very thin header file from sparse runtime support (#82820) 2024-02-23 12:37:36 -08:00
tsitdikov
e09e0d52a0
Users/tsitdikov (#82757)
Fix Test ARM SME library and build rule.
2024-02-23 12:54:15 +00:00
tsitdikov
6ac2c0488f
Add TestArmSME dependency to mlir-opt library.
TestArmSME was added in e132643474, now we need to add dependency on it.
2024-02-23 11:57:14 +00:00
tsitdikov
e132643474
Add build rule for MLIRArmSMETestPasses
MLIRArmSMETestPasses was added in b39f5660a4, we need to add a build rule for it as well.
2024-02-23 11:47:40 +00:00
Jorge Gorbe Moya
3b20fb336d [bazel] add missing dep after 5b079af169cd04b457465fd7ca31714efeefe6d9 2024-02-22 11:43:34 -08:00
Adrian Kuegel
bc1c86b810 [mlir][Bazel] Also remove SerializeToCubin target. 2024-02-22 07:24:46 +00:00
Adrian Kuegel
6676f67e31 [mlir][Bazel] Remove stub target which is not needed anymore. 2024-02-22 07:20:47 +00:00
Oleksandr "Alex" Zinenko
91f1161133
[mlir] expose transform interpreter to Python (#82365)
Transform interpreter functionality can be used standalone without going
through the interpreter pass, make it available in Python.
2024-02-21 11:01:00 +01:00
Jorge Gorbe Moya
d39d5ccbc0 [bazel] fix build after 4c6043de0b837d23699424d875057d00956d80ac 2024-02-20 10:18:20 -08:00
Tomás Longeri
44436a9c6b
Update Bazel build after b334664 (#82091) 2024-02-17 09:14:44 +01:00
lntue
f01ed3bc88
[libc][stdfix] Add round functions for fixed point types. (#81994) 2024-02-16 12:45:26 -05:00
Guillaume Chatelet
a80a01fc25
[reland][libc][NFC] Use user defined literals to build 128 and 256 bit constants (#81998)
- #81835
- Fix for platforms where uint64_t is not available
2024-02-16 16:40:26 +01:00
Haojian Wu
9e5da05da7 [bazel] Add a missing dependency for __support_fixed_point lib 2024-02-16 13:50:50 +01:00
Haojian Wu
bfda580b08 [bazel] Port for 0eedc85baad495fa916d1da7b20db93a29b443e1 and 82a4a41614f4943e6b2e85bbc8cb8507d2236524 2024-02-16 13:29:13 +01:00
Boian Petkantchin
dc3258c617
[mlir][mesh] Add all-slice operation (#81218)
This op is the inverse of all-gather. It is useful to have an explicit
concise representation instead of having a blob of slicing logic.

Add lowering for the op that slices from the tensor based on the
in-group process index.

Make resharding generate an all-slice instead of inserting the slicing
logic directly.
2024-02-15 13:03:58 -08:00
Guillaume Chatelet
a1d4c69344
Revert "[reland][libc][NFC] Use user defined literals to build 128 and 256 bit constants" (#81882)
Reverts llvm/llvm-project#81835
This is breaking arm32 which does not support 64 bit types.
2024-02-15 18:31:46 +01:00
Guillaume Chatelet
513e4dc1af
[reland][libc][NFC] Use user defined literals to build 128 and 256 bit constants (#81835)
This is a reland of #81746
2024-02-15 14:36:58 +01:00
Christian Sigg
fcb5a98eb8 Revert "[bazel][mlir] Remove unused BUILD dependencies. (#81836)"
This reverts commit 32fcfcdc4cc1d68116438f761897953894d65fb1.
2024-02-15 14:14:07 +01:00