Commit Graph

1185 Commits

Author SHA1 Message Date
Benjamin Chetioui
7e9f0f1fa8 [bazel] Port BUILD rules for 92cc30aca7. 2023-05-09 10:21:07 +00:00
Hanhan Wang
25cc5a71b3 [mlir][vector] Generalize vector.transpose lowering to n-D vectors
The existing vector.transpose lowering patterns only triggers if the
input vector is 2D. The revision extends the pattern to handle n-D
vectors which are effectively 2-D vectors (e.g., vector<1x4x1x8x1).

It refactors a common check about 2-D vectors from X86Vector
lowering to VectorUtils.h so it can be reused by both sides.

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D149908
2023-05-08 10:48:26 -07:00
Aaron Siddhartha Mondal
762c709911 [bazel] Make labels to third-party dependencies explicit
Prefix occurrences of `//utils/bazel` with an explicit `@llvm-raw`.

This change lets us reuse code from `configure.bzl` in future compatibility patches for the bzlmod
module system.

The llvm-project overlay will be made available as an `@llvm-project-overlay` (name WIP) module in
the Bazel Central Registry. This means that we will have an `@llvm-project-overlay` workspace in
addition to the `@llvm-raw` and `@llvm-project` workspaces currently involved in the build. To keep
future patches to the existing build files as small as possible, the explicit naming proposed in this
change appears to be the simplest way to not confuse the module workspace resolution.

This is not a functional change to the current WORKSPACE build. It is a foundation for future patches.

GitHub Issue in the BCR: https://github.com/bazelbuild/bazel-central-registry/issues/206
GitHub Issue in LLVM: https://github.com/llvm/llvm-project/issues/55924

Reviewed By: csigg

Differential Revision: https://reviews.llvm.org/D136496
2023-05-07 16:02:19 +02:00
Aaron Siddhartha Mondal
68697ac274 [bazel] Fix missing deps for layering check
Reviewed By: #bazel_build, stellaraccident

Differential Revision: https://reviews.llvm.org/D150058
2023-05-07 05:56:59 +02:00
Benjamin Kramer
d2540186eb [bazel] Add missing dependency for b8e878da5c 2023-05-05 23:33:41 +02:00
Wenzhi Cui
aa4f921b14 Update BUILD.bazel for Mem2Reg deps.
Reviewed By: csigg

Differential Revision: https://reviews.llvm.org/D149930
2023-05-05 11:47:17 +02:00
Adrian Kuegel
f248fc375f [mlir][Bazel] Update BUILD.bazel file for cc4703745f
Differential Revision: https://reviews.llvm.org/D149823
2023-05-04 10:46:21 +02:00
Matthias Springer
7610087056 [mlir][memref] Add helper to make alloca ops independent
Add a helper function that makes dynamic sizes of `memref.alloca` ops independent of a given set of values. This functionality can be used to make dynamic allocations hoistable from loops.

Differential Revision: https://reviews.llvm.org/D149316
2023-05-04 14:18:46 +09:00
Wenzhi Cui
af202eaa9d Update BUILD file for bazel.
llvm::CodeGen was missing so add them to deps

Reviewed By: csigg

Differential Revision: https://reviews.llvm.org/D149720
2023-05-03 08:09:50 +02:00
Michael Jones
4888256125 [libc][bazel] static link test targets
This solves issues caused by the symbols for internal components being
marked as hidden. When dynamically linked, the tests of internal
components, such as printf_parser_test, fail due to the symbols being
unavailable.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D149674
2023-05-02 14:55:46 -07:00
NAKAMURA Takumi
ea2b79d48d Try to fix CodeGenTypes issues in mlir 2023-05-03 00:58:57 +09:00
NAKAMURA Takumi
631bfdbee5 Switch llvm/CodeGen/MachineValueType.h to the generated one
Prune `SupportTests/MVTTest` since it is no longer needed.

Depends on D148769

Differential Revision: https://reviews.llvm.org/D148770
2023-05-03 00:13:20 +09:00
NAKAMURA Takumi
5d71ec6e44 Split out CodeGenTypes from CodeGen for LLT/MVT
This reduces dependencies on `llvm-tblgen` so much.

`CodeGenTypes` depends on `Support` at the moment.
Be careful to append deps on this, since Targets' tablegens
depend on this.

Depends on D149024

Differential Revision: https://reviews.llvm.org/D148769
2023-05-03 00:13:20 +09:00
NAKAMURA Takumi
9cfeba5b12 Restore CodeGen/LowLevelType from Support
This is rework of;
  - D30046 (LLT)

Since I have introduced `llvm-min-tblgen` as D146352, `llvm-tblgen`
may depend on `CodeGen`.

`LowLevlType.h` originally belonged to `CodeGen`. Almost all userse are
still under `CodeGen` or `Target`. I think `CodeGen` is the right place
to put `LowLevelType.h`.

`MachineValueType.h` may be moved as well. (later, D149024)

I have made many modules depend on `CodeGen`. It is consistent but
inefficient. It will be split out later, D148769

Besides, I had to isolate MVT and LLT in modmap, since
`llvm::PredicateInfo` clashes between `TableGen/CodeGenSchedule.h`
and `Transforms/Utils/PredicateInfo.h`.
(I think better to introduce namespace llvm::TableGen)

Depends on D145937, D146352, and D148768.

Differential Revision: https://reviews.llvm.org/D148767
2023-05-03 00:13:19 +09:00
NAKAMURA Takumi
2df215f7a6 [Bazel] Update for D148308 (riscv-sifive) 2023-05-03 00:13:19 +09:00
Adrian Kuegel
3c83afb68b [mlir][Bazel] Adjust BUILD file for changes in 5e118f933b 2023-05-02 08:37:44 +02:00
NAKAMURA Takumi
243e8f8d23 Introduce llvm-min-tblgen to build public header files
`llvm-min-tblgen` is capable of building `llvm/include/llvm`;

- `-gen-attrs`
- `-gen-directive-*`
- `-gen-intrinsics-*`
- `-gen-riscv-target-def`

`llvm-min-tblgen` is built and used only when `llvm-tblgen` is built in-tree.
This is not installed.

`llvm-tblgen` is built with complete set and may be installed.
`check-llvm` uses not `llvm-min-tblgen` but `llvm-tblgen`.

`LLVM_TABLEGEN_PROJECT` overrides the definition of `tablegen(project)`.
`LLVM_HEADERS` is used as the overridden prefix for LLVM header generators.

If `EXPORT` is not specified in `add_tablegen`, its tablegen is treated as internal.

Let `llvm-tblgen` depend on `intrinsics_gen`

Depends on D149072

Differential Revision: https://reviews.llvm.org/D146352
2023-05-02 11:32:22 +09:00
Christian Sigg
896af9e48d [bazel] Fix layering check after 0610e2f
`BytecodeWriter.h` is now included in `IR.h`, and the corresponding dependency should be moved to `header_deps`. This change fixes Google's internal build, which seems to have a stricter layering check than bazel's, but it's still the right thing to do.

Differential Revision: https://reviews.llvm.org/D149576
2023-05-01 12:46:39 +02:00
Alex Brachet
e161fcde06 [llvm-gsymutil] Add gsymutil to llvm driver build
Differential Revision: https://reviews.llvm.org/D149283
2023-04-28 15:15:16 +00:00
Matthias Springer
77124386fe [mlir][tensor] Add transform to make tensor.pad loop-independent
Add a transform to make `tensor.pad` and `tensor.empty` ops independent of SCF loop IVs. Such ops can then be hoisted.

E.g.:
```
scf.for %iv = %lb to %ub step %step {
  %high = affine.apply affine_map<(d0)[s0] -> (s0 - d0)> (%i)[%ub]
  %p = tensor.pad %t low[5] high[%high] ...
  ...
}
```
Is transformed to:
```
%high_new = affine.apply affine_map<()[s0, s1] -> (-s0 + s1)> ()[%lb, %ub]
%p_hoistable = tensor.pad %t low[5] high[%high_new]
%dim = tensor.dim %t, %c0
%size = affine.apply affine_map<(d0)[s0, s1] -> (-d0 + s0 + s1 + 5)>(%iv)[%ub, %dim]
%slice = tensor.extract_slice %p_hoistable [0] [%size] [1]
```

Differential Revision: https://reviews.llvm.org/D143910
2023-04-28 11:46:32 +09:00
Mikhail Goncharov
8babf8f343 [bazel][mlir] fix build for transform utils 2023-04-27 12:03:20 +02:00
Mikhail Goncharov
25462d14b1 [bazel][mlir] update build for mem2reg f88f8fd0bc
Differential Revision: https://reviews.llvm.org/D149326
2023-04-27 10:59:53 +02:00
Jorge Gorbe Moya
15ca90070a [bazel][NFC] Run buildifier on libc/libc_build_rules.bzl. 2023-04-26 17:02:05 -07:00
Michael Jones
d94fe97280 [libc][bazel] add file printf targets and support
This patch adds targets for printf and fprintf to the bazel build.
Additionally, it adds support for the build system to specify where
files should be written for testing purposes. This was necessary to
enable the fprintf test under bazel.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D147008
2023-04-26 14:30:48 -07:00
Emilio Cota
c450515895 [bazel][mlir] fix for d3f9388ff 2023-04-26 13:48:11 -04:00
Alex Brachet
a44fffb823 [llvm-gsymutil] Switch to OptTable
Differential Revision: https://reviews.llvm.org/D148775
2023-04-26 17:35:34 +00:00
Jorge Gorbe Moya
404c63184e [bazel] Fix //libc:errno deps after d9f033146b. 2023-04-25 16:14:41 -07:00
Alex Zinenko
135d29c3f5 [mlir] reorgnize Linalg TransformOps files. NFC
Mirror the separation between LinalgTransformOps and LinalgMatchOps in
headers. Create a separate pair of files for the extension.

Depends on D148017

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D148075
2023-04-25 22:44:01 +00:00
Jorge Gorbe Moya
3778574507 [bazel] Fix libc target deps after 7090c10273 2023-04-25 10:47:53 -07:00
Mikhail Goncharov
f39678dfbf [bazel] update build for MLIR test for c8d1388e6c 2023-04-25 14:37:57 +02:00
Emilio Cota
2e7d200210 [bazel][mlir] Fold :Observers and :BreakpointManagers into :Debug
To avoid circular deps.

While at it, add missing dep on CAPIIR.
2023-04-25 01:16:07 -04:00
Emilio Cota
301f4d884f [bazel][mlir] Build Debug/BreakpointManagers only from a single target
When writing 5f2b0892d "[bazel][mlir] BreakpointManager fixes for 7f069f5",
I did not notice that 17c6de3f1 "[bazel] Fix bazel build for 7f069f5ef.."
had added Debug/BreakpointManagers globs to the Debug target. But these
are already being built in the "BreakpointManagers" target; remove them
from "Debug".
2023-04-24 22:16:25 -04:00
Emilio Cota
5f2b0892d5 [bazel][mlir] BreakpointManager fixes for 7f069f5ef4 2023-04-24 18:08:07 -04:00
Jacques Pienaar
0911558005 [mlir] Dialect type/attr bytecode read/write generator.
Tool to help generate dialect bytecode Attribute & Type reader/writing.
Show usage by flipping builtin dialect.

It helps reduce boilerplate when writing dialect bytecode attribute and
type readers/writers. It is not an attempt at a generic spec mechanism
but rather practically focussing on boilerplate reduction while also
considering that it need not be the only in memory format and make it
relatively easy to change.

There should be some cleanup in follow up as we expand to more dialects.

Differential Revision: https://reviews.llvm.org/D144820
2023-04-24 11:53:58 -07:00
Mikhail Goncharov
be9c91843b [bazel] test files for IRDL 8ac8c922fb
Differential Revision: https://reviews.llvm.org/D149056
2023-04-24 14:04:48 +02:00
Alex Zinenko
61cddaa2da Drop MLIR Bazel dependency on LLVM Analysis
This is no longer necessary after f5425c128a and significatly
decreases the build time and the binary footprint.

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D149042
2023-04-24 08:10:08 +00:00
Mikhail Goncharov
d42ba4c2a6 [bazel] update for ba38640b99 2023-04-24 09:35:06 +02:00
Haojian Wu
c0c1281bb7 [bazel] Port for 8ac8c922fb 2023-04-23 23:54:29 +02:00
NAKAMURA Takumi
d01641b509 [Bazel] Rename LLVMTableGenGlobalISel to TableGenGlobalISel 2023-04-23 11:32:34 +09:00
Haojian Wu
17c6de3f1b [bazel] Fix bazel build for 7f069f5ef4 2023-04-22 13:59:45 +02:00
Aaron Siddhartha Mondal
58dbbb0d80 [bazel] Update Bazel version to 6.1.2.
Reviewed By: #bazel_build, MaskRay, akuegel, rupprecht

Differential Revision: https://reviews.llvm.org/D148862
2023-04-22 04:56:19 +02:00
Haojian Wu
357da2f597 [bazel] Fix the bazel build for the "analysis" target for a443b3d18e.
A followup of the fix 46f5aaa82c
2023-04-20 09:02:29 +02:00
NAKAMURA Takumi
46f5aaa82c [Bazel] Introduce "//clang:bundle_resources" for D146591 2023-04-20 08:45:37 +09:00
Adrian Kuegel
a91f44271b [clang][Bazel] Add missing dependency after 310ee08d5d 2023-04-19 07:56:28 +02:00
Aart Bik
ec42398e8a bazel patch for OpenACC changes
Reviewed By: razvanlupusoru, anlunx

Differential Revision: https://reviews.llvm.org/D148678
2023-04-18 18:43:22 -07:00
Siva Chandra Reddy
447d59e071 [libc][NFC] Move RoundingModeUtils to LibcFPTestHelpers.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D148602
2023-04-18 18:37:30 +00:00
Siva Chandra Reddy
e3645eadb8 [libc][NFC] Move ExecuteFunction test util to test/UnitTest.
Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D148611
2023-04-18 16:17:42 +00:00
Alex Brachet
c2423a3345 [clang-scan-deps] Add clang-scan-deps to llvm-driver build
Differential Revision: https://reviews.llvm.org/D148583
2023-04-18 15:02:23 +00:00
Guillaume Chatelet
b3c696fb86 [libc] Add debug messages to bcmp and memcmp tests 2023-04-18 13:35:34 +00:00
Matthias Springer
d5b631240a [mlir][Arith] ValueBoundsOpInterface: Reify with Arith ops
This revision adds an additional `reifyValueBounds` helper that reifies the IR with Arith ops instead of Affine ops. This is needed to support value bounds for integer types different from `index` in a subsequent revision.

Differential Revision: https://reviews.llvm.org/D146524
2023-04-18 16:54:56 +09:00