Commit Graph

589 Commits

Author SHA1 Message Date
Guillaume Chatelet e2d7975843 [libc][NFC] Use STL case for bitset and simplify implementation 2022-08-19 21:39:14 +00:00
Guillaume Chatelet d769cd8cdc [reland][libc][NFC] Use STL case for bit 2022-08-19 21:26:26 +00:00
Guillaume Chatelet 175560fc21 Revert "[libc][NFC] Use STL case for bit"
This reverts commit 7ba14b8611.
2022-08-19 21:17:48 +00:00
Guillaume Chatelet 7ba14b8611 [libc][NFC] Use STL case for bit 2022-08-19 21:10:27 +00:00
John Ericson e941b031d3 Revert "[cmake] Use `CMAKE_INSTALL_LIBDIR` too"
This reverts commit f7a33090a9.

Unfortunately this causes a number of failures that didn't show up in my
local build.
2022-08-18 22:46:32 -04:00
John Ericson f7a33090a9 [cmake] Use `CMAKE_INSTALL_LIBDIR` too
We held off on this before as `LLVM_LIBDIR_SUFFIX` conflicted with it.
Now we return this.

`LLVM_LIBDIR_SUFFIX` is kept as a deprecated way to set
`CMAKE_INSTALL_LIBDIR`. The other `*_LIBDIR_SUFFIX` are just removed
entirely.

I imagine this is too potentially-breaking to make LLVM 15. That's fine.
I have a more minimal version of this in the disto (NixOS) patches for
LLVM 15 (like previous versions). This more expansive version I will
test harder after the release is cut.

Reviewed By: sebastian-ne, ldionne, #libc, #libc_abi

Differential Revision: https://reviews.llvm.org/D130586
2022-08-18 15:33:35 -04:00
David Blaikie ed342d9d29 Add missing bazel dep 2022-08-18 07:13:19 +00:00
Arthur Eubanks 77ce95a83b [bazel] Add --config=ci
To speedup builds/tests.
2022-08-17 09:10:47 -07:00
Arthur Eubanks 76b1e8365a [bazel] Use lld in --config=generic_clang
This should give us faster links.

Differential Revision: https://reviews.llvm.org/D131723
2022-08-12 11:45:28 -07:00
Arthur Eubanks 3f2f23cca9 [bazel] Remove --config=rbe
RBE is currently broken due to the RBE container being too old and not supporting C++17.
The bots have already stopped using --config=rbe.

Differential Revision: https://reviews.llvm.org/D131722
2022-08-12 11:45:02 -07:00
Alex Zinenko a60ed95419 [mlir][transform] failure propagation mode in sequence
Introduce two different failure propagation mode in the Transform
dialect's Sequence operation. These modes specify whether silenceable
errors produced by nested ops are immediately propagated, thus stopping
the sequence, or suppressed. The latter is useful in end-to-end
transform application scenarios where the user cannot correct the
transformation, but it is robust enough to silenceable failures. It
can be combined with the "alternatives" operation. There is
intentionally no default value to avoid favoring one mode over the
other.

Downstreams can update their tests using:

  S='s/sequence \(%.*\) {/sequence \1 failures(propagate) {/'
  T='s/sequence {/sequence failures(propagate) {/'
  git grep -l transform.sequence | xargs sed -i -e "$S"
  git grep -l transform.sequence | xargs sed -i -e "$T"

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D131774
2022-08-12 15:31:22 +00:00
Benjamin Kramer 170ec0e418
[bazel] Port 3e119c0efd 2022-08-12 14:52:49 +02:00
Krasimir Georgiev 603edb93bc [bazel] Add WindowsDriver as a dep of OrcJIT (llvmorg-16-init-1433-g7260cdd2e13a) 2022-08-11 11:17:27 +02:00
Benjamin Kramer 2d2ad02f43 [bazel] Switch to C++17
LLVM switched to C++17 in b1356504e6
2022-08-06 21:48:10 +02:00
Benjamin Kramer d6eea96b8e [bazel] Port 1c5a50e328 2022-08-06 16:08:48 +02:00
Benjamin Kramer e0807b0d7e [bazel] Add missing dependency after 713f85d595 2022-08-06 11:34:24 +02:00
Tue Ly 131dda9acc [libc] Implement sincosf function correctly rounded to all rounding modes.
Refactor common range reductions and evaluations for sinf, cosf, and
sincosf.  Added exhaustive tests for sincosf.

Performance before the patch:
```
System LIBC reciprocal throughput : 30.205
LIBC reciprocal throughput        : 30.533

System LIBC latency : 67.961
LIBC latency        : 61.564
```
Performance after the patch:
```
System LIBC reciprocal throughput : 30.409
LIBC reciprocal throughput        : 20.273

System LIBC latency : 67.527
LIBC latency        : 61.959
```

Reviewed By: orex

Differential Revision: https://reviews.llvm.org/D130901
2022-08-05 09:58:01 -04:00
Jeff Bailey 3b631e47fe [libc] Trivial implementation of std::optional
This class has only the minimum functionality in it to provide what the
TZ variable parsing needs.  In particular, the standard makes guarantees
about how trivial the destructors are, throws an expception if it's used
incorrectly, etc.  There are also missing features.

Tested:
Trivial testsuite added, and use in development.

Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D129920
2022-08-05 02:51:44 +00:00
Adrian Kuegel bc32896e9f [llvm][Bazel] Exclude TrainingLoggerTest.cpp from build.
It requires a google protobuf dependency.
2022-08-04 08:48:17 +02:00
Sriraman Tallam 3e43d0cde7 This patch fixes these errors while building BOLT.
Compiling llvm/llvm-project/bolt/include/bolt/Passes/RegReAssign.h failed:
...: error: invalid application of 'sizeof' to an incomplete type 'llvm::bolt::BinaryFunctionCallGraph'

static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
error: type 'llvm::bolt::BinaryBasicBlock *' cannot be used prior to '::' because it has no members

using NodeRef = typename GraphType::UnknownGraphTypeError;
BinaryDomTree.h:31:14: error: no template named 'DomTreeGraphTraitsBase'

: public DomTreeGraphTraitsBase<bolt::BinaryDomTreeNode,

Differential Revision: https://reviews.llvm.org/D130402
2022-08-02 11:23:37 -07:00
Adrian Kuegel 6c66b089bc [mlir][Bazel] Fix typo in file name. 2022-08-02 09:27:20 +02:00
Adrian Kuegel b0cfbda04e [mlir][Bazel] Add missing dependency. 2022-08-02 09:23:03 +02:00
Adrian Kuegel 9183d40313 [mlir][Bazel] Add yet another missing dependency. 2022-08-02 09:15:43 +02:00
Adrian Kuegel 0b41c610f6 [mlir][Bazel] Add missing dependency. 2022-08-02 09:10:18 +02:00
Adrian Kuegel e031dea5be [mlir][Bazel] Update bazel build after 14d79afeae
Differential Revision: https://reviews.llvm.org/D130965
2022-08-02 09:03:27 +02:00
Adrian Kuegel 78ad3e4cb5 [mlir][Bazel] Remove reference to deleted header. 2022-08-02 08:34:48 +02:00
Stephan Herhut 0e5ac92ce2 [mlir][bazel] Fix bazel build files
This adds a missing dependency on builtin dialect td files.

Differential Revision: https://reviews.llvm.org/D130890
2022-08-01 12:03:43 +02:00
Guillaume Chatelet 49eb58063f [libc][NFC] Use STL case for utility
Migrating all private STL code to the standard STL case but keeping it under the CPP namespace to avoid confusion.

Differential Revision: https://reviews.llvm.org/D130771
2022-08-01 09:27:37 +00:00
Guillaume Chatelet 91eb0b6584 [libc][NFC] Use STL case for limits
Migrating all private STL code to the standard STL case but keeping it under the CPP namespace to avoid confusion.

Differential Revision: https://reviews.llvm.org/D130762
2022-08-01 09:18:25 +00:00
Guillaume Chatelet 3f3bbd7370 [libc][NFC] Use STL case for functional
Migrating all private STL code to the standard STL case but keeping it under the CPP namespace to avoid confusion.

Differential Revision: https://reviews.llvm.org/D130760
2022-08-01 09:10:59 +00:00
Guillaume Chatelet d3d498fbf6 Reland [libc][NFC] Use STL case for array
This is a reland of https://reviews.llvm.org/D130773
2022-08-01 08:47:27 +00:00
Guillaume Chatelet de00bd573e Revert "[libc][NFC] Use STL case for array"
This reverts commit 7add0e5fdc.
2022-08-01 08:44:52 +00:00
Guillaume Chatelet 7add0e5fdc [libc][NFC] Use STL case for array
Migrating all private STL code to the standard STL case but keeping it under the CPP namespace to avoid confusion.

Differential Revision: https://reviews.llvm.org/D130773
2022-08-01 08:43:05 +00:00
NAKAMURA Takumi a0943a2e19 [Bazel] Add JITLink/COFFOptions.td (llvmorg-16-init-398-g88181375a3db) 2022-08-01 07:07:13 +09:00
Tue Ly 2ff187fbc9 [libc] Implement cosf function that is correctly rounded to all rounding modes.
Implement cosf function that is correctly rounded to all rounding
modes.

Performance benchmark using perf tool from CORE-MATH project

(https://gitlab.inria.fr/core-math/core-math/-/tree/master) on Ryzen 1700:
Before this patch (not correctly rounded):
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh cosf
CORE-MATH reciprocal throughput   : 19.043
System LIBC reciprocal throughput : 26.328
LIBC reciprocal throughput        : 30.955

$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh cosf --latency
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH latency   : 49.995
System LIBC latency : 59.286
LIBC latency        : 60.174

```
After this patch (correctly rounded):
```
$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh cosf
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH reciprocal throughput   : 19.072
System LIBC reciprocal throughput : 26.286
LIBC reciprocal throughput        : 13.631

$ CORE_MATH_PERF_MODE="rdtsc" ./perf.sh cosf --latency
GNU libc version: 2.31
GNU libc release: stable
CORE-MATH latency   : 49.872
System LIBC latency : 59.468
LIBC latency        : 56.119
```

Reviewed By: orex, zimmermann6

Differential Revision: https://reviews.llvm.org/D130644
2022-07-29 21:08:31 -04:00
Guillaume Chatelet f72261508a [libc][NFC] Use STL case for type_traits
Migrating all private STL code to the standard STL case but keeping it under the CPP namespace to avoid confusion. Starting with the type_traits header.

Differential Revision: https://reviews.llvm.org/D130727
2022-07-29 09:57:03 +00:00
Daniele Vettorel e7c004854d Add `llvm-dwarfutil` to Bazel targets
Adds support for building the `llvm-dwarfutil` tool with Bazel

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D130720
2022-07-28 19:53:37 +00:00
Christian Sigg f983bdbdae [MLIR] Fix bazel build after 7356404ace. 2022-07-28 08:14:18 +02:00
Stella Laurenzo 7356404ace [mlir] Delete most of the ops from the quant dialect.
* https://discourse.llvm.org/t/rfc-removing-the-quant-dialect/3643/8
* Removes most ops. Leaves casts given final comment (can remove more in a followup).
* There are a few uses in Tosa keeping some of the utilities alive. In a followup, I will probably elect to just move simplified versions of them into Tosa itself vs having this quasi-library dependency.

Differential Revision: https://reviews.llvm.org/D120204
2022-07-27 17:50:42 -07:00
Tue Ly 15b9380dfd [libc] Change sinf range reduction to mod pi/16 to be shared with cosf.
Change `sinf` range reduction to mod pi/16 to be shared with `cosf`.

Previously, `sinf` used range reduction `mod pi`, but this cannot be used to implement `cosf` since the minimax algorithm for `cosf` does not converge due to critical points at `pi/2`.  In order to be able to share the same range reduction functions for both `sinf` and `cosf`, we change the range reduction to `mod pi/16` for the following reasons:
- The table size is sufficiently small: 32 entries for `sin(k * pi/16)` with `k = 0..31`.  It could be reduced to 16 entries if we treat the final sign separately, with an extra multiplication at the end.
- The polynomials' degrees are reduced to 7/8 from 15, with extra computations to combine `sin` and `cos` with trig sum equality.
- The number of exceptional cases reduced to 2 (with FMA) and 3 (without FMA).
- The latency is reduced while maintaining similar throughput as before.

Reviewed By: zimmermann6

Differential Revision: https://reviews.llvm.org/D130629
2022-07-27 12:23:36 -04:00
Benjamin Kramer 1f5144cdbb [bazel] Port 5caa941f68 2022-07-27 16:12:58 +02:00
NAKAMURA Takumi 3e0b557002 [Bazel] Bump to v16.0.0, corresponding to llvmorg-16-init 2022-07-27 22:41:53 +09:00
Alex Zinenko ea460b7ddb [mlir] update Bazel for e99fae8997 2022-07-27 09:42:07 +00:00
Alexander Belyaev 6cfaab5692 [mlir] Sort the libraties in BUILD.bazel. 2022-07-26 16:32:40 +02:00
Alexander Belyaev 4825614a46 [mlir] Update bazel build. 2022-07-26 16:28:29 +02:00
Benjamin Kramer 9484ddbfa1 [bazel] Port 628fbbef81 2022-07-26 15:36:15 +02:00
Dmitri Gribenko ed33d0878f [bazel] Run autoformatter on BUILD.bazel 2022-07-26 13:12:36 +02:00
Benjamin Kramer bf759e3b10 [bazel] Port 7a5cb15ea6 2022-07-26 12:53:38 +02:00
Weverything de43f93a82 [bazel] Add new rule for c60b897d22 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