Commit Graph

615 Commits

Author SHA1 Message Date
Wei Yi Tee d45c04da7c [llvm][ADT] Overload output stream operator `<<` for `StringMapEntry` and `StringMap`.
Printing support enables the production of more useful error messages in unit testing e.g. when using matchers such as `UnorderedElementsAre()` to inspect the contents of a `StringMap`.

Reviewed By: gribozavr2, sgatev, ymandel

Differential Revision: https://reviews.llvm.org/D132747
2022-08-31 17:37:58 +00:00
Siva Chandra Reddy ada51eed7e [bazel overlay][libc] Add unistd targets.
Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D133004
2022-08-31 14:29:50 +00:00
Benjamin Kramer 4b63507811 [bazel] Drop ConversionPassDetail, it shouldn't be needed after 67d0d7ac0a 2022-08-31 13:31:52 +02:00
Johannes Reifferscheid 23dec4a352 Move BufferViewFlowAnalysis to the Bufferization dialect.
It's only used from there, and this lets us remove the dependency from Analysis
to the Arith dialect.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D132928
2022-08-30 14:25:49 +02:00
Benjamin Kramer bb3d14ec8b [bazel] Stop building PassGenTest.cpp.inc, it was removed in 13ed6958df 2022-08-30 11:01:33 +02:00
Benjamin Kramer 9a9d027086 [bazel] Add missing dependency after 1b002d2768 2022-08-28 09:56:17 +02:00
Benjamin Kramer adb3a09b90 [bazel] Drop clang-offload-wrapper. It was deleted in 47166968db 2022-08-26 21:02:39 +02:00
Benjamin Kramer 766f5d8c3c [bazel] Port a235562c0a 2022-08-26 19:17:19 +02:00
Adrian Kuegel d0546fbea2 [mlir][Bazel] Fix wrong dependency to //llvm:Support 2022-08-26 09:06:40 +02:00
Adrian Kuegel 26b84eb143 [mlir][Bazel] Fix bazel build. 2022-08-26 09:04:50 +02:00
Guillaume Chatelet 9d239b37f7 [NFC][libc] Move Uint implementation to parent directory
Differential Revision: https://reviews.llvm.org/D132638
2022-08-25 12:42:06 +00:00
Mircea Trofin 5ce4c9aa04 [mlgo] Use TFLite for 'development' mode.
TLite is a lightweight, statically linkable[1], model evaluator, supporting a
subset of what the full tensorflow library does, sufficient for the
types of scenarios we envision having. It is also faster.

We still use saved models as "source of truth" - 'release' mode's AOT
starts from a saved model; and the ML training side operates in terms of
saved models.

Using TFLite solves the following problems compared to using the full TF
C API:

- a compiler-friendly implementation for runtime-loadable (as opposed
  to AOT-embedded) models: it's statically linked; it can be built via
  cmake;
- solves an issue we had when building the compiler with both AOT and
  full TF C API support, whereby, due to a packaging issue on the TF
  side, we needed to have the pip package and the TF C API library at
  the same version. We have no such constraints now.

The main liability is it supporting a subset of what the full TF
framework does. We do not expect that to cause an issue, but should that
be the case, we can always revert back to using the full framework
(after also figuring out a way to address the problems that motivated
the move to TFLite).

Details:

This change switches the development mode to TFLite. Models are still
expected to be placed in a directory - i.e. the parameters to clang
don't change; what changes is the directory content: we still need
an `output_spec.json` file; but instead of the saved_model protobuf and
the `variables` directory, we now just have one file, `model.tflite`.

The change includes a utility showing how to take a saved model and
convert it to TFLite, which it uses for testing.

The full TF implementation can still be built (not side-by-side). We
intend to remove it shortly, after patching downstream dependencies. The
build behavior, however, prioritizes TFLite - i.e. trying to enable both
full TF C API and TFLite will just pick TFLite.

[1] thanks to @petrhosek's changes to TFLite's cmake support and its deps!
2022-08-24 16:07:24 -07:00
Adrian Kuegel 9ef41ecb2a [mlir][Bazel] Fix bazel build. 2022-08-24 10:13:53 +02:00
Adrian Kuegel 23b3bcc7a6 [mlir][Bazel] Fix bazel build.
To avoid a dependency cycle, add BytecodeImplementation.h header to the
"IR" target.
2022-08-24 08:51:44 +02:00
Johannes Reifferscheid 27a1a85662 buffer-deallocation: consider aliases introduced by arith.select.
Currently, buffer deallocation considers arith.select to be
non-aliasing, which results in deallocs being inserted incorrectly. Since
arith.select doesn't implement any useful interfaces, this change just handles
it explicitly. Eventually this should probably be fixed properly, if this pass
is going to be used long term.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D132460
2022-08-23 14:37:02 +02:00
Matthias Springer c37ed7762e [tensor][bufferize] Use affine.apply instead of arith.addi in PadOp lowering
Affine exprs compose better than arith ops.

Differential Revision: https://reviews.llvm.org/D132456
2022-08-23 11:46:11 +02:00
Arthur Eubanks b04d01c009 [bazel][docs] Mention how to provide path to compiler
And some other cleanups/clarifications.

Reviewed By: saugustine

Differential Revision: https://reviews.llvm.org/D132396
2022-08-22 10:13:47 -07:00
Arthur Eubanks d5a57ab742 [bazel] Move some CI flags into .bazelrc 2022-08-22 10:12:29 -07:00
Arthur Eubanks 9a83f38408 [bazel] Add note about using -c opt for CI 2022-08-22 09:36:23 -07:00
Goran Flegar 59548fe873 [mlir] Fix compile errors with bytecode support 2022-08-22 17:59:51 +02:00
Guillaume Chatelet aa59c9810a [libc][NFC] Use STL case for string_view 2022-08-22 15:25:14 +00:00
Guillaume Chatelet c860fd3f25 [NFC][libc] Remove ArrayRef which is replaced with span 2022-08-22 10:52:28 +00:00
Goran Flegar 1d9b1427f4 [mlir][Bazel] Fix bazel build
Add fixes for https://reviews.llvm.org/D131747
2022-08-22 12:07:55 +02:00
Kazu Hirata 36357c967c Remove llvm::is_trivially_copyable (NFC)
This patch removes llvm::is_trivially_copyable as it seems to be dead.
Once I remove it, HAVE_STD_IS_TRIVIALLY_COPYABLE has no users, so this
patch removes the macro also.

The comment on llvm::is_trivially_copyable mentions GCC 4.9, but note
that we now require GCC 7.1 or higher.

Differential Revision: https://reviews.llvm.org/D132328
2022-08-21 10:39:19 -07:00
Anlun Xu 9a764ffeb6 [mlir][Bazel] Fix Bazel build
Differential Revision: https://reviews.llvm.org/D132264
2022-08-21 01:02:21 -07:00
John Ericson 3adda398ce [clang][lldb][cmake] Use new `*_INSTALL_LIBDIR_BASENAME` CPP macro
Use this instead of `*_LIBDIR_SUFFIX`, from which it is computed.

This gets us ready for D130586, in which `*_LIBDIR_SUFFIX` is
deprecated.

Differential Revision: https://reviews.llvm.org/D132300
2022-08-20 12:52:21 -04:00
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