Commit Graph

1018 Commits

Author SHA1 Message Date
Goran Flegar
d866f87f88 [bazel] Fix build after 28d04c5 2023-03-06 17:40:19 +01:00
Jordan Rupprecht
ebb94ecb95 [bazel] Fix errno dep location: libc_function_deps -> deps 2023-03-03 12:59:56 -08:00
Jordan Rupprecht
fc840808e6 [bazel] Add errno dep to stdlib tests
In addition run buildifier.
2023-03-03 12:55:03 -08:00
Michael Jones
04a9c62554 [libc] move stdlib and stdio to new errno pattern
Fixes https://github.com/llvm/llvm-project/issues/61071

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D145191
2023-03-03 11:15:36 -08:00
Siva Chandra Reddy
204587a3cb [libc][NFC] Switch use of errno in src/unistd and src/sys to libc_errno.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D145096
2023-03-02 17:15:10 +00:00
Haojian Wu
f75e45093d [bazel] Add missing dep for llvm-c-test 2023-03-02 11:01:54 +01:00
Haojian Wu
91676abf6a [bazel] Port for f7ca013332 2023-03-02 10:38:41 +01:00
Nicolas Vasilache
613c9b93fe Fix Bazel build post c888a0ce88 2023-03-01 08:14:08 -08:00
Michael Jones
cb3c41c285 [libc] Refactor string to float return values
The internal implementation of the string to float function previously
used pointer arguments for returning several values. Additionally it
set errno in several unexpected places. Now all of that goes through
return structs. For readability I also moved the function away from raw
pointer arithmetic towards proper indexing. I also added support for
rounding modes.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D144597
2023-02-28 10:50:43 -08:00
Nicolas Vasilache
2f07d627a1 [mlir][Linalg] Refactor HoistPadding and add support for hoisting in the absence of packing loops.
This revision cleans up the implementation of hoist padding and extends it to also work in the
absence of packing loops.
This allows better composition when hoisting the padded result of a DPS operation.

A systematic usage of RewriterBase is applied to the implementation.

Depends on: D144856

Differential Revision: https://reviews.llvm.org/D144855
2023-02-28 05:21:57 -08:00
Haojian Wu
06faa47ecc [mlir] Fix the missing mlir test BUILD.bazel for 3948f0a0b5 2023-02-28 10:15:28 +01:00
Haojian Wu
639fc00b2d [mlir] Port bazel for 3948f0a0b5 2023-02-28 09:32:30 +01:00
Haojian Wu
8877d8f5ca [mlir] Port bazel for 115711c19c 2023-02-27 16:51:15 +01:00
Haojian Wu
0264ca431d [bazel] Port Bazel for e7950fceb1 2023-02-27 11:33:45 +01:00
Michal Terepeta
52786141f9 [MLIR][Vector] Add a dependency on :DataLayoutInterfaces
Reviewed By: tpopp

Differential Revision: https://reviews.llvm.org/D144631
2023-02-23 12:11:22 +01:00
Aaron Siddhartha Mondal
a81bdc614a [bazel] Remove unused dependency on libxml2
The Bazel configs don't set `LLVM_ENABLE_LIBXML2`, so this was never usable to
begin with.

On systems without static `libxml2.a` this made `lld` runtime-dependent on an
unused, non-hermetic `libxml2.so`.

Reviewed By: MaskRay, GMNGeoffrey

Differential Revision: https://reviews.llvm.org/D143351
2023-02-23 01:52:02 +01:00
Nicolas Vasilache
c624027633 [mlir][linalg][TransformOps] Connect hoistRedundantVectorTransfers
Connect the hoistRedundantVectorTransfers functionality to the transform
dialect.

Authored-by: Quentin Colombet <quentin.colombet@gmail.com>

Differential Revision: https://reviews.llvm.org/D144260
2023-02-20 01:50:29 -08:00
Tue Ly
4d5fd9b79f [libc][bazel] Fix missing dependency in test/src/stdlib targets. 2023-02-18 10:16:13 -05:00
Tue Ly
df82394e7a [libc][bazel] Export .bzl files for libc/test and libc/test/src/math. 2023-02-17 11:03:04 -05:00
Pranav Kant
f83e6c6d7a [Bazel][mlir] Fix build errors
Fallback from https://reviews.llvm.org/D143925

Differential Revision: https://reviews.llvm.org/D144212
2023-02-16 20:17:39 +00:00
Michael Jones
dccd1d736c [libc][bazel] add string to float targets
This patch adds atof, strtof, strtod, and strtold to the bazel build, as
well as their tests.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D144140
2023-02-16 11:22:08 -08:00
Pranav Kant
9a2cb3a692 Fix bazel build
Fallback from 66b3f4a407
2023-02-16 01:31:19 +00:00
Tue Ly
66b3f4a407 [libc][bazel] Add missing dependency for stdlib tests. 2023-02-15 18:03:43 -05:00
Aart Bik
c3ca29080c [mlir] bazel fix
Reviewed By: olegshyshkov

Differential Revision: https://reviews.llvm.org/D144124
2023-02-15 10:35:49 -08:00
Guillaume Chatelet
b67ee5d505 [reland][libc] Separate memcpy implementations per arch
As x86_64 implementations is likely to grow up to a point where it's no more manageable to have all implementations in the same file.
2023-02-15 14:40:07 +00:00
Matthias Springer
c645eb0d03 [mlir][memref] Bufferize memref.tensor_store op
This change adds the BufferizableOpInterface implementation for memref.tensor_store.

Differential Revision: https://reviews.llvm.org/D144080
2023-02-15 15:26:57 +01:00
Guillaume Chatelet
7a282bd2aa [bazel] Fix missing dependency in clang-tools-extra/clang-tidy:llvmlibc 2023-02-15 13:54:45 +00:00
Guillaume Chatelet
15b90805bc Revert "[libc] Separate memcpy implementations per arch"
This is patch is still breaking downstream users...
This reverts commit 97e441dc6c.
2023-02-15 13:29:07 +00:00
Guillaume Chatelet
97e441dc6c [libc] Separate memcpy implementations per arch
As x86_64 implementations is likely to grow up to a point where it's no more manageable to have all implementations in the same file.
2023-02-15 13:22:01 +00:00
Jathu Satkunarajah
f702822371 [bazel] create a clang-tidy binary target
Create a binary target for clang-tidy. Tested by running:

```
$ bazel build --config=generic_clang @llvm-project//clang-tools-extra/...
$ bazel test --config=generic_clang @llvm-project//clang-tools-extra/...
$ bazel run --config=generic_clang @llvm-project//clang-tools-extra/clang-tidy -- --help
```

Reviewed By: #bazel_build, aaronmondal

Differential Revision: https://reviews.llvm.org/D143804
2023-02-15 13:56:06 +01:00
Guillaume Chatelet
c3228714cc [libc][NFC] Make tuning macros start with LIBC_COPT_
Rename preprocessor definitions that control tuning of llvm libc.

Differential Revision: https://reviews.llvm.org/D143913
2023-02-15 10:00:16 +00:00
Benjamin Kramer
7d9cf97f80 [bazel][mlir][examples] Add missing dependency for 72429a42ac 2023-02-15 10:33:49 +01:00
Adrian Kuegel
41628d050a [mlir][Bazel] Add missing dependencies for 72429a42ac 2023-02-15 08:30:57 +01:00
Adrian Kuegel
d7ca25342f [mlir][Bazel] Add dependency needed for e9b82a5c 2023-02-15 07:37:26 +01:00
wren romano
f708a549b8 [mlir][sparse] Factoring out SparseTensorType class
This change adds a new `SparseTensorType` class for making the "dim" vs "lvl" distinction more overt, and for abstracting over the differences between sparse-tensors and dense-tensors.  In addition, this change also adds new type aliases `Dimension`, `Level`, and `FieldIndex` to make code more self-documenting.

Although the diff is very large, the majority of the changes are mechanical in nature (e.g., changing types to use the new aliases, updating variable names to match, etc).  Along the way I also made many variables `const` when they could be; the majority of which required only adding the keyword.  A few places had conditional definitions of these variables, requiring actual code changes; however, that was only done when the overall change was extremely local and easy to extract.  All these changes are included in the current patch only because it would be too onerous to split them off into a separate patch.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D143800
2023-02-14 19:17:19 -08:00
Fangrui Song
a211d79cac [bazel] Port 26662ac010 2023-02-14 17:42:48 -08:00
Guillaume Chatelet
9a8d64a66a Revert "[libc] Separate memcpy implementations per arch"
Reverting as it broke downstream users.
This reverts commit 26541d4176.
2023-02-14 16:14:51 +00:00
Guillaume Chatelet
26541d4176 [libc] Separate memcpy implementations per arch
As x86_64 implementations is likely to grow up to a point where it's no more manageable to have all implementations in the same file.
2023-02-14 15:58:08 +00:00
Aart Bik
9700eb4fbf [bazel] build fix
Differential Revision: https://reviews.llvm.org/D143973
2023-02-13 19:31:55 -08:00
Jakub Kuderski
81566001e0 [mlir][tosa] Enable apply_scale unrolling
Make `tosa.apply_scale` implement `VectorUnrollOpInterface` so that we
can unroll it.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D143944
2023-02-13 17:02:23 -05:00
Tue Ly
7156d3b1fe [libc][bazel] Update math function unit tests' dependency computation. 2023-02-13 15:52:51 -05:00
Quentin Colombet
b838b62876 [mlir][MemRef][Transform] Don't apply multibuffer on "useless" allocs
`alloc`s that have users outside of loops are guaranteed to fail in
`multibuffer`.

Instead of exposing ourselves to that failure in the transform dialect,
filter out the `alloc`s that fall in this category.

To be able to do this filtering we have to change the `multibuffer`
transform op from `TransformEachOpTrait` to a plain `TransformOp`. This is
because `TransformEachOpTrait` expects that every successful `applyToOne`
returns a non-empty result.

Couple of notes:
- I changed the assembly syntax to make sure we only get `alloc` ops as
  input. (And added a test case to make sure we reject invalid inputs.)
- `multibuffer` can still fail pretty easily when you know its limitations.
  See the updated `op failed to multibuffer` test case for instance.
  Longer term, instead of leaking/coupling the actual implementation (in
  this case the checks normally done in `memref::multiBuffer`) with the
  transform dialect (the added check in `::apply`), we may want to refactor
  how we structure the underlying implementation. E.g., we could imagine a
  `canApply` method for all the implementations that we want to hook up in
  the transform dialect.
  This has some implications on how not to duplicate work between
  `canApply` and the actual implementation but I thought I throw that here
  to have us think about it :).

Differential Revision: https://reviews.llvm.org/D143747
2023-02-13 14:19:10 +01:00
Guillaume Chatelet
30f515a910 [libc] Fix LIBC_LOOP_NOUNROLL being a noop 2023-02-13 11:15:05 +00:00
Benjamin Kramer
c697119daf [bazel][libc] Add a few more missing dependency that show up when parsing headers 2023-02-12 13:08:36 +01:00
Tue Ly
f543614ce6 [libc] Update dependency for __support_fputil_nearest_integer in bazel overlay. 2023-02-11 10:49:01 -05:00
Tue Ly
4663d784dd [libc] Update macros/optimization.h build dependency for CMake and Bazel.
Update macros/optimization.h build dependency for CMake and Bazel.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D143805
2023-02-11 01:24:48 -05:00
Fangrui Song
9e57a5739d [bazel] Fix {clang,llvm}/unittests 2023-02-10 14:41:21 -08:00
Tue Ly
ae2d8b4971 [libc][math] Update exceptional cases for logf, log10f, log2f, log1pf.
Properly set floating point exceptions and add more exceptional
values for non-FMA x86-64 targets.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D143699
2023-02-10 14:08:50 -05:00
Benjamin Kramer
185dbf9d6f [bazel] Port 81a79ee446 2023-02-10 19:02:19 +01:00
Guillaume Chatelet
737e1cd161 [libc] Move likely/unlikely to the optimization header 2023-02-10 15:31:28 +00:00