Commit Graph

1755 Commits

Author SHA1 Message Date
Matthias Springer
b9fe461e73
[mlir][transform] LISH: Add transform op (#70630)
Add a transform op for loop-invariant subset hoisting. Delete the old
transform op from the Linalg dialect.
2023-11-05 11:40:51 +09:00
Jorge Gorbe Moya
671741bb9c [bazel] update utils/bazel/llvm_configs/llvm-config.h.cmake after 3fe69bab11 2023-11-03 16:30:58 -07:00
Dmitry Chernenkov
23ad865e10 [Bazel][clang] Fix build for Upstream APINotesOptions 2023-11-02 14:07:33 +00:00
Jorge Gorbe Moya
243588df15 [bazel] add missing dependency to //clang:ast after 1c6c01fbde 2023-11-01 11:53:18 -07:00
Matthias Springer
1df6504ac2
[mlir][vector] LISH: Implement SubsetOpInterface for transfer_read/write (#70629)
- Implement `SubsetOpInterface`, `SubsetExtractionOpInterface`,
`SubsetInsertionOpInterface` for `vector.transfer_read` and
`vector.transfer_write`.
- Move all tensor subset hoisting test cases from `Linalg` to
`loop-invariant-subset-hoisting.mlir`. (Removing 1 duplicate test case.)
2023-11-01 12:19:30 +09:00
Matthias Springer
ff614a5729
[mlir][Interfaces] LISH: Add helpers for hyperrectangular subsets (#70628)
The majority of subset ops operate on hyperrectangular subsets. This
commit adds a new optional interface method
(`getAccessedHyperrectangularSlice`) that can be implemented by such
subset ops. If implemented, the other `operatesOn...` interface methods
of the `SubsetOpInterface` do not have to be implemented anymore.

The comparison logic for hyperrectangular subsets (is
disjoint/equivalent) is implemented with `ValueBoundsOpInterface`. This
makes the subset hoisting more powerful: simple cases where two
different SSA values always have the same runtime value can now be
supported.
2023-11-01 11:29:00 +09:00
Matthias Springer
2164a449dc
[mlir][Transforms] Add loop-invariant subset hoisting (LISH) transformation (#70619)
Add a loop-invariant subset hoisting pass to `mlir/Interfaces`. This
pass hoist loop-invariant tensor subsets (subset extraction and subset
insertion ops) from loop-like ops. Extraction ops are moved before the
loop. Insertion ops are moved after the loop. The loop body operates on
newly added region iter_args (one per extraction-insertion pair).

This new pass will be improved in subsequent commits (to support more
cases/ops) and will eventually replace
`Linalg/Transforms/SubsetHoisting.cpp`. In contrast to the existing
Linalg subset hoisting, the new pass is op interface-based
(`SubsetOpInterface` and `LoopLikeOpInterface`).
2023-11-01 10:57:17 +09:00
Matthias Springer
1abd8d1a8d
[mlir][Interfaces] Add SubsetOpInterface and SubsetExtractionOpInterface (#70617)
There is currently an op interface for subset insertion ops
(`SubsetInsertionOpInterface`), but not for subset extraction ops. This
commit adds `SubsetExtractionOpInterface` to `mlir/Interfaces`, as well
as a common dependent op interface: `SubsetOpInterface`.

- `SubsetOpInterface` is for ops that operate on tensor subsets. It
provides interface methods to check if two subset ops operate on
equivalent or disjoint subsets. Ops that implement this interface must
implement either `SubsetExtractionOpInterface` or
`SubsetInsertionOpInterface`.
- `SubsetExtractionOpInterface` is for ops that extract from a tensor at
a subset. E.g., `tensor.extract_slice`, `tensor.gather`,
`vector.transfer_read`. Current implemented only on
`tensor.extract_slice`.
- `SubsetInsertionOpInterface` is for ops that insert into a destination
tensor at a subset. E.g., `tensor.insert_slice`,
`tensor.parallel_insert_slice`, `tensor.scatter`,
`vector.transfer_write`. Currently only implemented on
`tensor.insert_slice`, `tensor.parallel_insert_slice`.

Other changes:
- Rename `SubsetInsertionOpInterface.td` to `SubsetOpInterface.td`.
- Add helper functions to `ValueBoundsOpInterface.cpp` for checking
whether two slices are disjoint.

The new interfaces will be utilized by a new "loop-invariant subset
hoisting"
transformation. (This new transform is roughly
what `Linalg/Transforms/SubsetHoisting.cpp` is doing, but in a generic
and interface-driven way.)
2023-11-01 10:26:31 +09:00
Adrian Kuegel
1b4371759e [mlir][Bazel] Add missing dependency after 4ce93d531d 2023-10-31 13:34:22 +00:00
Matthias Springer
a8d0c86174
[mlir][Interfaces][NFC] Move SubsetInsertionOpInterface to mlir/Interfaces (#70615)
`SubsetInsertionOpInterface` is an interface for ops that insert into a
destination tensor at a subset. It is currently used by the
bufferization framework to support efficient
`tensor.extract_slice/insert_slice` bufferization and to drive "empty
tensor elimination".

This commit moves the interface to `mlir/Interfaces`. This is in
preparation of adding a new "loop-invariant subset hoisting"
transformation to
`mlir/Transforms/Utils/LoopInvariantCodeMotionUtils.cpp`, which will
utilize `SubsetInsertionOpInterface`. (This new transform is roughly
what `Linalg/Transforms/SubsetHoisting.cpp` is doing, but in a generic
and interface-driven way.)
2023-10-30 13:42:44 +09:00
Benjamin Kramer
a68ce6cc01 [bazel] Add missing depdendency for a5a908654e 2023-10-29 10:56:43 +01:00
Johannes Reifferscheid
9db8f99b61 [Bazel] Fixes for 96e040a. 2023-10-26 13:41:26 +02:00
Johannes Reifferscheid
0c6759b576 [Bazel] Fixes for ec6da06. 2023-10-26 10:33:59 +02:00
Benjamin Kramer
28a8f1b901 [bazel] Add missing dependency 2023-10-25 16:43:23 +02:00
Benjamin Kramer
08e765372e [bazel] Port 078ae8cd64 2023-10-25 16:39:50 +02:00
michaelrj-google
b4e552999d
[libc] Fix printf long double inf, bitcast in msan (#70067)
These bugs were found with the new printf long double fuzzing. The long
double inf vs nan bug was introduced when we changed to
get_explicit_exponent. The bitcast msan issue hadn't come up previously,
but isn't a real bug, just a poisoning confusion.
2023-10-24 15:41:54 -07:00
Benjamin Kramer
8edcfa0d00 [bazel] Add missing dependencies for ba8ae9866b 2023-10-24 16:45:50 +02:00
Adrian Kuegel
cdf713cdb9 [mlir][Bazel] Add missing dependency. 2023-10-23 05:30:16 +00:00
Finn Plummer
5aee156b2a
Reland: "[mlir][index][spirv] Add conversion for index to spirv" (#69790)
Due to an issue when lowering from scf to spirv as there was no
conversion pass for index to spirv, we are motivated to add a conversion
pass from the Index dialect to the SPIR-V dialect. Furthermore, we add
the new conversion patterns to the scf-to-spirv conversion.

Fixes https://github.com/llvm/llvm-project/issues/63713

---------

Co-authored-by: Jeremy Kun <jkun@google.com>
2023-10-21 20:36:28 -04:00
Adrian Kuegel
08d7d1ef9a [mlir][Bazel] Add missing dependencies after aa0208d1bc 2023-10-20 08:52:14 +00:00
Adrian Kuegel
c7be4e6db9 [mlir][Bazel] Add missing dependency after d871daea81 2023-10-20 06:37:15 +00:00
Emilio Cota
f6818528f7 [bazel][mlir] fixes for a2288a89 2023-10-19 18:35:13 -04:00
Ingo Müller
3517b67ef0 Reapply "[mlir][transform] Support symlinks in module loading. Reorganize tests. (#69329)"
This reverts commit c122b9727a but fixes
tests that were added between submitting #69329 for review and landing
it for the first time.
2023-10-19 09:04:49 +00:00
Ingo Müller
c122b9727a Revert "[mlir][transform] Support symlinks in module loading. Reorganize tests. (#69329)"
This reverts commit f681225700. That
commit changed the organization of the tests of the transform dialect
interpreter but did not take into account some tests that were added in
the meantime.
2023-10-19 08:51:15 +00:00
Ingo Müller
f681225700
[mlir][transform] Support symlinks in module loading. Reorganize tests. (#69329)
A recent commit (#69190) broke the bazel builds. Turns out that Bazel
uses symlinks for providing the test files, which the path expansion of
the module loading mechanism did not handle correctly. This PR fixes
that.

It also reorganizes the tests better: It puts all `.mlir` files that are
included by some other test into a common `include` folder. This greatly
simplifies the definition of the dependencies between the different
`.mlir` files in Bazel's `BUILD` file. The commit also adds a comment to
all included files why these aren't tested themselves direclty and uses
the `%{fs-sep}` expansion for paths more consistently. Finally, it
uncomments all but one of the tests excluded in Bazel because they seem
to run now. (The remaining one includes a file that it itself a test, so
it would have to live *in* and *outside* of the `include` folder.)
2023-10-19 10:45:33 +02:00
Peiming Liu
761c9dd927
[mlir][sparse] implementating stageSparseOpPass as an interface (#69022) 2023-10-17 10:54:44 -07:00
Dmitry Chernenkov
12bf4231eb [Bazel] Fix dependencies for clang codegen 2023-10-17 12:36:11 +00:00
Dmitry Chernenkov
90576084c1 [Bazel] fix typo 2023-10-17 11:58:43 +00:00
Dmitry Chernenkov
4434253f0f [Bazel] disable preload-library.mlir test 2023-10-17 11:54:35 +00:00
Aart Bik
233c3e6c53
[mlir][sparse] remove sparse2sparse path in library (#69247)
This cleans up all external entry points that will have to deal with
non-permutations, making any subsequent refactoring much more local to
the lib files.
2023-10-16 14:45:57 -07:00
Lei Zhang
3049ac44e6
[mlir][vector] Enable transfer op hoisting with dynamic indices (#68500)
Recent changes (https://github.com/llvm/llvm-project/pull/66930)
disabled vector transfer ops hoisting with view-like intermediate ops.
The recommended way is to fold subview ops into transfer op indices
before invoking hoisting. That would mean now we see transfer op indices
involving dynamic values, instead of static constant values before with
subview ops. Therefore hoisting won't kick in anymore. This breaks
downstream users.

To fix it, this commit enables hoisting transfer ops with dynamic
indices by using `ValueBoundsConstraintSet` to prove ranges are disjoint
in `isDisjointTransferIndices`. Given that utility is used in many
places including op folders, right now we introduce a flag to it and
only set as true for "heavy" transforms in hoisting and load-store
forwarding.
2023-10-15 16:37:54 -07:00
Balaji V. Iyer
28b27c1b10
[ArmSVE][NVVM][Bazel] Added Features to BUILD.bazel file (#68949)
Added VectorOps support for ArmSVE in BUILD.bazel
Added BasicPtxBuilderInterface support for NVVM in build.bazel
2023-10-13 07:47:36 +02:00
Mikhail Goncharov
f5c34126d4
[bazel] add llvm/HipStdPar (#68883)
for 0ce6255a50
2023-10-12 14:24:19 +02:00
Mikhail Goncharov
7a18b3ce65 [bazel] update llvm-config.h.cmake
after 28bb2193f6
2023-10-12 10:20:45 +02:00
Mikhail Goncharov
97cd39ff09 [bazel] fix linter complains for libc bazel 2023-10-12 10:00:20 +02:00
Adrian Kuegel
ff16c9878c [mlir][Bazel] Don't duplicate files in data and test attribute.
Followup fix for 1bf0870934
2023-10-12 05:37:33 +00:00
Balaji V. Iyer
e80cdf0ef9
[Affine][Bazel] Added AffineOps to BUILD.bazel file (#68842)
Added AffineOps and correct dependencies to the BUILD.bazel file.
2023-10-12 07:24:42 +02:00
Nicolas Vasilache
1bf0870934
[mlir][Transform] Create a transform interpreter and a preloader pass (#68661)
This revision provides the ability to use an arbitrary named sequence op
as
the entry point to a transform dialect strategy.

It is also a step towards better transform dialect usage in pass
pipelines
that need to preload a transform library rather thanparse it on the fly.

The interpreter itself is significantly simpler than its testing
counterpart
by avoiding payload/debug root tags and multiple shared modules.

In the process, the NamedSequenceOp::apply function is adapted to allow
it
being an entry point.

NamedSequenceOp is **not** extended to take the PossibleTopLevelTrait at
this
time, because the implementation of the trait is specific to allowing
one
top-level dangling op with a region such as SequenceOp or
AlternativesOp.
In particular, the verifier of PossibleTopLevelTrait does not allow for
an
empty body, which is necessary to declare a NamedSequenceOp that gets
linked
in separately before application.

In the future, we should dispense with the PossibleTopLevelTrait
altogether
and always enter the interpreter with a NamedSequenceOp.

Lastly, relevant TD linking utilities are moved to
TransformInterpreterUtils
and reused from there.
2023-10-11 14:56:09 -07:00
Adrian Kuegel
9620053272 [mlir][Bazel] Adjustments for 8c67c48591 2023-10-11 05:39:33 +00:00
Adrian Kuegel
8b3e150bbb [mlir][Bazel] Fix wrong dependency path. 2023-10-11 05:28:33 +00:00
Balaji V. Iyer
e9ca1665c9
[Mesh][Bazel] Added MeshOps to BUILD.bazel file (#68759)
Added MeshOps and correct dependencies to the BUILD.bazel file.
2023-10-11 07:25:17 +02:00
Guillaume Chatelet
0e1481439f
[libc][bazel] Define libc namespace in a separate file and drop the release flag (#68563)
The `release` flag is misleading and its semantics are not well defined.
Originally this was meant to allow for different `LIBC_NAMESPACE`
depending on whether the code was considered stabled and released or
unstable. It appears that we may have a canary environment that is
neither released or dev. As a consequence we move the `LIBC_NAMESPACE`
definition to its own file and each environment can override this file
with whatever makes sense.
2023-10-10 15:41:34 +02:00
Mikhail Goncharov
141ca548e3 [bazel] fix build for 479057887f
for real
2023-10-10 10:13:08 +02:00
Mikhail Goncharov
962a049d64 [bazel] fix build for 479057887f 2023-10-10 10:09:14 +02:00
Balaji V. Iyer
3684f6a887
[OpenACC][Bazel] Added OpenACCOpsInterfaces to BUILD.bazel file (#68639)
Added OpenACCOpsInterfaces and correct dependencies to the BUILD.bazel
file.
2023-10-09 15:10:47 -07:00
Juergen Ributzka
eb601430d3
[llvm][objdump] Remove support for printing the embedded Bitcode section in MachO files. (#68457)
It's no longer possible to submit bitcode apps to the Apple App Store.
The tools
used to create xar archived bitcode sections inside MachO files have
been
discontinued. Additionally, the xar APIs have been deprecated since
macOS 12,
so this change removes unnecessary code from objdump and all
dependencies on
libxar.

This fixes rdar://116600767
2023-10-09 15:03:29 -07:00
JoelWee
648046db15
[mlir][bazel] Fix after 7bbfd2a 2023-10-09 11:35:41 +01:00
Benjamin Kramer
2fc5649ccf [bazel] Add missing dependency for 5d2a7101b7 2023-10-07 09:55:23 +02:00
Aart Bik
d3af65358d
[mlir][sparse] introduce MapRef, unify conversion/codegen for reader (#68360)
This revision introduces a MapRef, which will support a future
generalization beyond permutations (e.g. block sparsity). This revision
also unifies the conversion/codegen paths for the sparse_tensor.new
operation from file (eg. the readers). Note that more unification is
planned as well as general affine dim2lvl and lvl2dim (all marked with
TODOs).
2023-10-06 13:42:01 -07:00
Christian Sigg
22f81b4cf4
[mlir][bazel] Fix after ef8c26b772 2023-10-06 15:06:53 +02:00
Christian Sigg
79c33d23c3
[mlir][bazel] Fix after ef8c26b772 2023-10-06 15:01:59 +02:00
Christian Sigg
1cd14adb25
[mlir][bazel] Fix after ef8c26b772 2023-10-06 14:43:45 +02:00
Christian Sigg
03bdfcc2ba
[mlir][bazel] Fix after 6a2071cc6a
Second try...
2023-10-06 14:04:07 +02:00
Christian Sigg
4e311ea20f
[mlir][bazel] Fix after 6a2071cc6a 2023-10-06 14:01:03 +02:00
Christian Sigg
185e16dba2
[mlir][bazel] Disable test added in 787689943d 2023-10-06 11:25:00 +02:00
Christian Sigg
59e75b7df2
[mlir][bazel] Sort targets list. 2023-10-05 11:14:12 +02:00
Christian Sigg
2f1c78014f
[mlir][bazel] Fix after d20fbc9007 2023-10-05 11:12:55 +02:00
Guray Ozen
29b33e8397 [bazel] fix typo 2023-10-05 11:08:46 +02:00
Guray Ozen
d20fbc9007
[MLIR][NVGPU] Introduce nvgpu.wargroup.mma.store Op for Hopper GPUs (#65441)
This PR introduces a new Op called `warpgroup.mma.store` to the NVGPU
dialect of MLIR. The purpose of this operation is to facilitate storing
fragmanted result(s) `nvgpu.warpgroup.accumulator` produced by
`warpgroup.mma` to the given memref.

An example of fragmentated matrix is given here :

https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#wgmma-64n16-d

The `warpgroup.mma.store` does followings:
1) Takes one or more `nvgpu.warpgroup.accumulator` type (fragmented
results matrix)
2) Calculates indexes per thread in warp-group and stores the data into
give memref.

Here's an example usage:
```
// A warpgroup performs GEMM, results in fragmented matrix
%result1, %result2 = nvgpu.warpgroup.mma ...

// Stores the fragmented result to memref
nvgpu.warpgroup.mma.store [%result1, %result2], %matrixD : 
    !nvgpu.warpgroup.accumulator< fragmented = vector<64x128xf32>>,
    !nvgpu.warpgroup.accumulator< fragmented = vector<64x128xf32>> 
    to memref<128x128xf32,3>
```
2023-10-05 10:54:13 +02:00
Benjamin Kramer
6cbf6f5d37 [bazel] Port 8d6d4f8321 2023-10-04 18:41:43 +02:00
Christian Sigg
73f8ec9edb
[mlir][bazel] Fix load() order. 2023-10-04 11:39:13 +02:00
Christian Sigg
c2ff180d5f
[mlir][bazel] Fix after afe400620f 2023-10-04 10:30:18 +02:00
Oleksandr "Alex" Zinenko
bc30b415ca
[mlir] enable python bindings for nvgpu transforms (#68088)
Expose the autogenerated bindings.

Co-authored-by: Martin Lücke <mluecke@google.com>
2023-10-03 14:52:52 +02:00
Guillaume Chatelet
dd65427408
[libc][bazel] Add a flag to configure LIBC_NAMESPACE (#68093) 2023-10-03 13:35:59 +02:00
Christian Sigg
2b5a6d774c
[mlir][bazel] Fix for f33afea260. 2023-10-03 10:40:02 +02:00
Haojian Wu
7fc25ae12c [bazel] Add missing deps. 2023-09-29 09:24:50 +02:00
Haojian Wu
535665ebf0 [bazel] Add build rules for new target added in 7ddf7d8783 2023-09-29 09:15:08 +02:00
lntue
da28593d71
[libc][math] Implement double precision expm1 function correctly rounded for all rounding modes. (#67048)
Implementing expm1 function for double precision based on exp function
algorithm:

- Reduced x = log2(e) * (hi + mid1 + mid2) + lo, where:
  * hi is an integer
  * mid1 * 2^-6 is an integer
  * mid2 * 2^-12 is an integer
  * |lo| < 2^-13 + 2^-30
- Then exp(x) - 1 = 2^hi * 2^mid1 * 2^mid2 * exp(lo) - 1 ~ 2^hi *
(2^mid1 * 2^mid2 * (1 + lo * P(lo)) - 2^(-hi) )
- We evaluate fast pass with P(lo) is a degree-3 Taylor polynomial of
(e^lo - 1) / lo in double precision
- If the Ziv accuracy test fails, we use degree-6 Taylor polynomial of
(e^lo - 1) / lo in double double precision
- If the Ziv accuracy test still fails, we re-evaluate everything in
128-bit precision.
2023-09-28 16:43:15 -04:00
Peiming Liu
9477aa227f
[bazel] fix bazel for (D152457) (#67706) 2023-09-28 09:59:30 -07:00
Martin Erhart
6a651c7f44 Revert "[mlir][bufferization] Don't clone on unknown ownership and verify function boundary ABI (#66626)"
This reverts commit aa9eb47da2.
It introduced a double free in a test case. Reverting to have some time
for fixing this and relanding later.
2023-09-28 09:14:46 +00:00
Martin Erhart
aa9eb47da2
[mlir][bufferization] Don't clone on unknown ownership and verify function boundary ABI (#66626)
Inserting clones requires a lot of assumptions to hold on the input IR, e.g., all writes to a buffer need to dominate all reads. This is not guaranteed by one-shot bufferization and isn't easy to verify, thus it could quickly lead to incorrect results that are hard to debug. This commit changes the mechanism of how an ownership indicator is materialized when there is not already a unique ownership present. Additionally, we don't create copies of returned memrefs anymore when we don't have ownership. Instead, we insert assert operations to make sure we have ownership at runtime, or otherwise report to the user that correctness could not be guaranteed.
2023-09-28 10:45:35 +02:00
Haojian Wu
8aa8604d29 [bazel] Fix build breakage after 315a407086 2023-09-28 09:36:32 +02:00
Haojian Wu
6bb4d9f93b [bazel] Fix the build breakage after e705b37a77 2023-09-28 09:23:43 +02:00
Peiming Liu
1fd2251bce
[bazel] fix bazel (#67601) 2023-09-27 13:20:33 -07:00
Jacques Pienaar
1a7e8b90f2
[mlir][tosa] Add scaffolding for bytecode version. (#67374)
This does not decide on any specific bytecode version or structure, but
adds the scaffolding to make it easy to add.
2023-09-26 11:55:30 -07:00
Peiming Liu
af8dc86cf1
[bazel] fix bazel (#67462) 2023-09-26 10:25:42 -07:00
Haojian Wu
1f64dc8f59 [bazel] Port for eaf15900ff 2023-09-25 13:44:01 +02:00
Haojian Wu
af199ee00d [bazel] Port for 75a71c27c1 2023-09-25 10:54:34 +02:00
Haojian Wu
3fc7af51ed [bazel] Mor port for 24e33b5945 2023-09-25 10:33:46 +02:00
Haojian Wu
11b89dd50b [bazel] Port for 24e33b5 2023-09-25 10:12:11 +02:00
michaelrj-google
a5a008ff4f
[libc] Refactor scanf reader to match printf (#66023)
In a previous patch, the printf writer was rewritten to use a single
writer class with a buffer and a callback hook. This patch refactors
scanf's reader to match conceptually.
2023-09-22 12:50:02 -07:00
Fangrui Song
d7359bcc76 [bazel] Port 8e87dc10b8 (RISCVPostLegalizerCombiner) 2023-09-22 11:04:40 -07:00
Haojian Wu
754ed8fc77 [bazel] Port for 22e2b805ef 2023-09-22 14:17:10 +02:00
Haojian Wu
c6eb9e2a58 [bazel] Port for 2388222695 2023-09-22 13:29:07 +02:00
Joseph Huber
e0be78be42
[libc] Template the printf / scanf parser class (#66277)
Summary:
The parser class for stdio currently accepts different argument
providers. In-tree this is only used for a fuzzer test, however, the
proposed implementation of the GPU handling of printf / scanf will
require custom argument handlers. This makes the current approach of
using a preprocessor macro messier. This path proposed folding this
logic into a template instantiation. The downside to this is that
because the implementation of the parser class is placed into an
implementation file we need to manually instantiate the needed templates
which will slightly bloat binary size. Alternatively we could remove the
implementation file, or key off of the `libc` external packaging macro
so it is not present in the installed version.
2023-09-21 17:02:26 -05:00
Alex Zinenko
12d1476588 [mlir] more bazel fixes for vector attributes 2023-09-21 11:18:15 +00:00
Oleksandr "Alex" Zinenko
d579471a98
[mlir][python] smaller scope for vector enumgen (#66992)
Don't generate enums from the main VectorOps.td file as that
transitively includes enums from Arith.

---------

Co-authored-by: Nicolas Vasilache <ntv@google.com>
2023-09-21 12:57:41 +02:00
NAKAMURA Takumi
fd4bac49ab [Bazel] Follow up for ac182deee8 (D76445), RISCVGenGlobalISel.inc
RISCVGenGlobalISel.inc should be generated with RISCVGISel.td,
or generated binary would differ.

Unfortunately, buildkite didn't catch the issue.
2023-09-21 12:13:12 +09:00
Peiming Liu
3d27d1152e
[mlir][sparse] Generates python bindings for SparseTensorTransformOps. (#66937) 2023-09-20 15:35:50 -07:00
Fangrui Song
08b10afc1e [bazel] Port D149368 mlir openmp 2023-09-20 11:53:59 -07:00
Fangrui Song
903a7e487b [bazel] Port 4fbb5f9350 2023-09-20 10:22:26 -07:00
Nicolas Vasilache
f557986d0e
[mlir] Bazel fixes for 1b8b556443 (#66929) 2023-09-20 18:52:41 +02:00
Martin Erhart
65341b09b0
[mlir][bufferization][NFC] Move memref specific implementation of AllocationOpInterface to memref dialect directory (#66637)
Follow-up on #65578
2023-09-20 14:49:52 +02:00
Martin Erhart
522c1d0eea
[mlir][gpu][bufferization] Implement BufferDeallocationOpInterface for gpu.terminator (#66880)
This is necessary to support deallocation of IR with gpu.launch
operations because it does not implement the RegionBranchOpInterface.
Implementing the interface would require it to support regions with
unstructured control flow and produced arguments/results.
2023-09-20 12:28:28 +02:00
Fangrui Song
a45502cdb2 [bazel] Port c649f29c24 (llvm-nm --line-numbers) 2023-09-19 15:59:05 -07:00
Haojian Wu
00ecef906b [bazel] Port for 571df0132d 2023-09-19 15:46:41 +02:00
Christian Sigg
b9a6b28a58
[mlir][bazel] Small adjustment to 7db4a6f278 2023-09-19 08:08:59 +02:00
Fangrui Song
7db4a6f278 [bazel] Port cbd475040f (mlir/lib/Dialect/MLProgram) 2023-09-18 18:47:21 -07:00
Fangrui Song
45735770ee [bazel] Port 8677aaa1a3 (RISCV pre-legalizer combiners) 2023-09-18 11:59:33 -07:00
Matthias Springer
a2bb365733 [mlir] Fix Bazel build 2023-09-18 16:29:21 +02:00
Matthias Springer
64839fbd45
[mlir][bufferization] Empty tensor elimination for materialize_in_destination (#65468)
This revision adds support for empty tensor elimination to
"bufferization.materialize_in_destination" by implementing the
`SubsetInsertionOpInterface`.

Furthermore, the One-Shot Bufferize conflict detection is improved for
"bufferization.materialize_in_destination".
2023-09-18 15:34:28 +02:00
Haojian Wu
5eabbde6d9 [bazel] Port for 88e3358f33 2023-09-18 08:58:07 +02:00
Christian Sigg
1c8c365de2
[mlir][bytecode] Check that bytecode source buffer is sufficiently aligned. (#66380)
Before this change, the `ByteCode` test failed on CentOS 7 with
devtoolset-9, because strings happen to be only 8 byte aligned. In
general though, strings have no alignment guarantee.

Increase resource alignment in test to 32 bytes. 
Adjust test to sufficiently align buffer.
Add test to check error when buffer is insufficiently aligned.
2023-09-17 13:46:01 +02:00
Guillaume Chatelet
2dbdc9fc85
[libc] Add invoke / invoke_result type traits (#65750) 2023-09-15 11:15:41 +02:00
Oleg Shyshkov
85370b3068 [mlir][bazel] Fix build. 2023-09-15 10:32:21 +02:00
Martin Erhart
08b7a71bcc
[mlir][bufferization] Define a pipeline for buffer deallocation (#66352)
Since ownership based buffer deallocation requires a few passes to be run in a somewhat fixed sequence, it makes sense to have a pipeline for convenience (and to reduce the number of transform ops to represent default deallocation).
2023-09-15 09:39:17 +02:00
Martin Erhart
3c81a0bea2 [mlir][bufferization] Fix BAZEL build 2023-09-14 12:57:49 +00:00
Martin Erhart
8160bce969
[mlir][bufferization][NFC] Introduce BufferDeallocationOpInterface (#66349)
This new interface allows operations to implement custom handling of ownership values and insertion of dealloc operations which is useful when an op cannot implement the interfaces supported by default by the buffer deallocation pass (e.g., because they are not exactly compatible or because there are some additional semantics to it that would render the default implementations in buffer deallocation invalid, or because no interfaces exist for this
kind of behavior and it's not worth introducing one plus a default implementation in buffer deallocation). Additionally, it can also be used to provide more efficient handling for a specific op than the interface based default
implementations can.
2023-09-14 13:58:30 +02:00
Oleg Shyshkov
bf8fd086d0 [llvm][mlir][bazel] Fix build. 2023-09-14 13:28:37 +02:00
Martin Erhart
01334d1abb
[mlir][bufferization] Add an ownership based buffer deallocation pass (#66337)
Add a new Buffer Deallocation pass with the intend to replace the old
one. For now it is added as a separate pass alongside in order to allow
downstream users to migrate over gradually. This new pass has the goal
of inserting fewer clone operations and supporting additional use-cases.
Please refer to the Buffer Deallocation section in the updated
Bufferization.md file for more information on how this new pass works.
2023-09-14 12:13:37 +02:00
Guillaume Chatelet
aee8f8784a
[libc][utils] cpp::always_false to enable static_assert(false) (#66209) 2023-09-14 10:28:43 +02:00
Martin Erhart
520407a7c8 Revert "[mlir][bufferization] Improve buffer deallocation pass"
This reverts commit 1bebb60a75.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:48 +00:00
Martin Erhart
792caac0f8 Revert "[mlir][bufferization][NFC] Introduce BufferDeallocationOpInterface"
This reverts commit 29d86175e6.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:47 +00:00
Martin Erhart
7995a4701d Revert "[mlir][bufferization] Define a pipeline for buffer deallocation"
This reverts commit f0c4663942.

This caused problems in downstream projects. We are reverting to give
them more time for integration.
2023-09-13 13:53:47 +00:00
Matthias Springer
8143307b33
[mlir][bufferization] Generalize tensor slice rules to subset ops (#65619)
This commit generalizes the special
tensor.extract_slice/tensor.insert_slice bufferization rules to tensor
subset ops.

Ops that insert a tensor into a tensor at a specified subset (e.g.,
tensor.insert_slice, tensor.scatter) can implement the
`SubsetInsertionOpInterface`.

Apart from adding a new op interface (extending the API), this change is
NFC. The only ops that currently implement the new interface are
tensor.insert_slice and tensor.parallel_insert_slice, and those ops were
are supported by One-Shot Bufferize.
2023-09-13 12:27:19 +02:00
Martin Erhart
f0c4663942 [mlir][bufferization] Define a pipeline for buffer deallocation
Since buffer deallocation requires a few passes to be run in a somewhat fixed
sequence, it makes sense to have a pipeline for convenience (and to reduce the
number of transform ops to represent default deallocation).

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D159432
2023-09-13 09:30:24 +00:00
Martin Erhart
29d86175e6 [mlir][bufferization][NFC] Introduce BufferDeallocationOpInterface
This new interface allows operations to implement custom handling of ownership
values and insertion of dealloc operations which is useful when an op cannot
implement the interfaces supported by default by the buffer deallocation pass
(e.g., because they are not exactly compatible or because there are some
additional semantics to it that would render the default implementations in
buffer deallocation invalid, or because no interfaces exist for this kind of
behavior and it's not worth introducing one plus a default implementation in
buffer deallocation). Additionally, it can also be used to provide more
efficient handling for a specific op than the interface based default
implementations can.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D158756
2023-09-13 09:30:23 +00:00
Martin Erhart
1bebb60a75 [mlir][bufferization] Improve buffer deallocation pass
Add a new Buffer Deallocation pass replacing the old one with the goal of
inserting fewer clone operations and supporting additional use-cases.
Please refer to the Buffer Deallocation section in the updated
Bufferization.md file for more information on how this new pass works.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D158421
2023-09-13 09:30:23 +00:00
Guillaume Chatelet
7329816285
[libc] Add is_object (#65749)
Add the is_object type traits.
Implementation comes from
https://en.cppreference.com/w/cpp/types/is_object
2023-09-12 10:35:22 +02:00
Guillaume Chatelet
a1f5a495e0
[libc] Add type_traits tests (#65956)
This is not exhaustive for now but it provides a placeholder for
`invoke_result` test mentioned in #65750.
2023-09-11 14:15:12 +00:00
Guillaume Chatelet
6632882a38
[libc][bazel] Add CPP tests (#65941)
This PR adds tests for the `src/__support/CPP` folder to the bazel build
system.
2023-09-11 11:52:05 +02:00
Dmitri Gribenko
5af556f6d8 [bazel] Add new TableGen output files for 46f3ade508 2023-09-08 16:01:28 +02:00
Dmitri Gribenko
a0022ccc72 Revert "[Bazel] Update "basic_attr_gen" (D141714, 46f3ade508)"
This reverts commit dbd548d062. The
correct target to update is ast_attr_gen.
2023-09-08 16:01:28 +02:00
Guillaume Chatelet
74971db140
[libc] Add is_scalar (#65740)
Adds the is_scalar traits based on implementation in
https://en.cppreference.com/w/cpp/types/is_scalar
2023-09-08 12:45:17 +00:00
Guillaume Chatelet
eebf8faf3e
[libc] Add is_member_pointer_v (#65631)
Implementation from
https://en.cppreference.com/w/cpp/types/is_member_pointer
2023-09-08 11:36:19 +02:00
NAKAMURA Takumi
dbd548d062 [Bazel] Update "basic_attr_gen" (D141714, 46f3ade508) 2023-09-08 10:17:58 +09:00
Dmitri Gribenko
b5fc4a8b2e [bazel] Add missing dependencies 2023-09-07 18:24:38 +02:00
Guillaume Chatelet
260036ab1e
[libc] move in_place_t in utility (#65623)
This is needed because `cpp::in_place_t` is also used by `cpp::expected`
https://en.cppreference.com/w/cpp/utility/in_place
2023-09-07 18:12:50 +02:00
Dmitri Gribenko
51e7ab28a7 [bazel] Add missing dependencies, remove headers that don't belong to the target 2023-09-07 18:03:48 +02:00
Dmitri Gribenko
26f71500f8 [bazel] Add missing dependencies for 8cd4ecfa 2023-09-07 17:50:27 +02:00
Guillaume Chatelet
8d18671d81
[libc][bazel] Fix missing dependencies for lseek (#65618)
Failure introduced in 8cd4ecfa60
2023-09-07 17:11:47 +02:00
Dmitri Gribenko
7bac6823bd [bazel] Add missing dependencies necessary for the recent MLIR changes 2023-09-07 16:03:21 +02:00
wenzhi-cui
5ccda55772
Fix AtomicInterfacesTdFiles missing deps/typos in Bazel (#65562) 2023-09-07 08:26:03 +02:00
Razvan Lupusoru
61278ec348
[openacc][openmp] Add dialect representation for acc atomic operations (#65493)
The OpenACC standard specifies an `atomic` construct in section 2.12 (of
3.3 spec), used to ensure that a specific location is accessed or
updated atomically. Four different clauses are allowed: `read`, `write`,
`update`, or `capture`. If no clause appears, it is as if `update` is
used.

The OpenMP specification defines the same clauses for `omp atomic`. The
types of expression and the clauses in the OpenACC spec match the OpenMP
spec exactly. The main difference is that the OpenMP specification is a
superset - it includes clauses for `hint` and `memory order`. It also
allows conditional expression statements. But otherwise, the expression
definition matches.

Thus, for OpenACC, we refactor and reuse the OpenMP implementation as
follows:
* The atomic operations are duplicated in OpenACC dialect. This is
preferable so that each language's semantics are precisely represented
even if specs have divergence.
* However, since semantics overlap, a common interface between the
atomic operations is being added. The semantics for the interfaces are
not generic enough to be used outside of OpenACC and OpenMP, and thus
new folders were added to hold common pieces of the two dialects.
* The atomic interfaces define common accessors (such as getting `x` or
`v`) which match the OpenMP and OpenACC specs. It also adds common
verifiers intended to be called by each dialect's operation verifier.
* The OpenMP write operation was updated to use `x` and `expr` to be
consistent with its other operations (that use naming based on spec).

The frontend lowering necessary to generate the dialect can also be
reused. This will be done in a follow up change.
2023-09-06 13:54:39 -07:00
NAKAMURA Takumi
cd25a50a8f [Bazel] Introduce //compiler-rt:profile
At the moment,

  - Provide only `profile`
  - Will invoke error unless the platform is linux

Differential Revision: https://reviews.llvm.org/D156095
2023-09-06 22:10:30 +09:00
Guillaume Chatelet
4acc3ffbb0 [reland][libc][NFC] split type_traits / utility in separate files (#65314)
`type_traits` and `utility` refer to each other in their
implementations. Also `type_traits` starts to become too big to be
manageable. This PR splits each function into individual files. FTR this
is [how libcxx handles large headers as
well](https://github.com/llvm/llvm-project/tree/main/libcxx/include/__type_traits).

The reland adds two missing functions : is_destructible_v and is_reference_v
2023-09-06 09:23:00 +00:00
Guillaume Chatelet
bcdbd0bd0b Revert "[libc][NFC] split type_traits / utility in separate files (#65314)"
This reverts commit b793c7e530.
It broke the libc-x86_64-debian-gcc-fullbuild-dbg build bot.
https://lab.llvm.org/buildbot/#/builders/250/builds/9776
2023-09-06 08:47:45 +00:00
Guillaume Chatelet
b793c7e530
[libc][NFC] split type_traits / utility in separate files (#65314)
`type_traits` and `utility` refer to each other in their
implementations. Also `type_traits` starts to become too big to be
manageable. This PR splits each function into individual files. FTR this
is [how libcxx handles large headers as
well](https://github.com/llvm/llvm-project/tree/main/libcxx/include/__type_traits).
2023-09-06 10:31:08 +02:00
Guillaume Chatelet
56426c6cdf
[libc] customizable namespace 1/4 (#65321)
This implements the first step of
https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079

Make required Bazel and CMake preparatory changes which define the var
for the customizable namespace and use it (pass it as a compile option
-DLIBC_NAMESPACE=<...>).

Differential Revision: https://reviews.llvm.org/D159112
2023-09-06 10:27:56 +02:00
Benjamin Kramer
1078627cf8 [bazel] Add missing dependency for e55e36de7a 2023-09-05 19:58:38 +02:00
Benjamin Kramer
e8144c7011 [bazel] Port bc45acbddc 2023-09-05 11:48:04 +02:00
Martin Erhart
8037deb7af [mlir][memref] Add pass to expand realloc operations, simplify lowering to LLVM
There are two motivations for this change:
1. It considerably simplifies adding support for the realloc operation to the
   new buffer deallocation pass by lowering the realloc such that no
   deallocation operation is inserted and the deallocation pass itself can
   insert that dealloc
2. The lowering is expressed on a higher level and thus easier to understand,
   and the lowerings of the memref operations it is composed of don't have to
   be duplicated in the MemRefToLLVM lowering (also see discussion in
   https://reviews.llvm.org/D133424)

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D159430
2023-09-05 08:58:40 +00:00
Christian Sigg
4ae0db4ee6
[bazel][mlir] Add missing file after @62e90db 2023-09-05 08:07:15 +02:00
Nicolas Vasilache
62e90db21b [mlir][Transform] Add an example of a preloaded reference lowering to LLVM
Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D159364
2023-09-04 16:20:24 +02:00
Adrian Kuegel
ba6af8f63c [mlir][Bazel] Adapt to 2ae5d1c790 2023-09-04 14:08:37 +02:00
Aart Bik
9ce445b8c7 [mlir][sparse] simplification of sparse runtime support lib
Incorporated two header files directly into other since
other parts were used (and it makes it hard to find the
definitions). Removed TODOs that are less likely to be done.

Reviewed By: yinying-lisa-li

Differential Revision: https://reviews.llvm.org/D159381
2023-09-01 14:00:19 -07:00
Hanhan Wang
c5dee18b63 [mlir][memref] Add support for erasing dead allocations.
Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D159135
2023-09-01 13:30:26 -07:00
Mehdi Amini
471004c5c9 Revert "[mlir][sparse] simplification of sparse runtime support lib"
This reverts commit 14c58cf5c3.

The gcc7 build is broken.
2023-09-01 11:50:14 -07:00
Aart Bik
14c58cf5c3 [mlir][sparse] simplification of sparse runtime support lib
Incorporated two header files directly into other since
other parts were used (and it makes it hard to find the
definitions). Removed TODOs that are less likely to be done.

Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D159330
2023-09-01 09:28:48 -07:00
Martin Erhart
34a35a8b24 [mlir] Move FunctionInterfaces to Interfaces directory and inherit from CallableOpInterface
Functions are always callable operations and thus every operation
implementing the `FunctionOpInterface` also implements the
`CallableOpInterface`. The only exception was the FuncOp in the toy
example. To make implementation of the `FunctionOpInterface` easier,
this commit lets `FunctionOpInterface` inherit from
`CallableOpInterface` and merges some of their methods. More precisely,
the `CallableOpInterface` has methods to get the argument and result
attributes and a method to get the result types of the callable region.
These methods are always implemented the same way as their analogues in
`FunctionOpInterface` and thus this commit moves all the argument and
result attribute handling methods to the callable interface as well as
the methods to get the argument and result types. The
`FuntionOpInterface` then does not have to declare them as well, but
just inherits them from the `CallableOpInterface`.
Adding the inheritance relation also required to move the
`FunctionOpInterface` from the IR directory to the Interfaces directory
since IR should not depend on Interfaces.

Reviewed By: jpienaar, springerm

Differential Revision: https://reviews.llvm.org/D157988
2023-08-31 11:28:23 +00:00
pvanhout
54d0cf58fb [TableGen] Remove & Replace old GICombiner Backend
The MatchTable-based GlobalISel Combiner backend is the new default. There are no in-tree users left of the old backend.

- Removed implementation of old MatchDAG-based Combiner, including tests, the backend itself and all supporting code.
- Renamed MatchTable backend to `GlobalISelCombinerEmitter.cpp` + removed "-matchtable" from its CL option.
    - no need to have a verbose name as it's the only backend left now.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D158710
2023-08-31 13:16:07 +02:00
Oleg Shyshkov
a84b09f894 [mlir][bazel] Fix bazel build for d774622. 2023-08-31 13:14:52 +02:00
Matthias Springer
6ecebb496c [mlir][bufferization] Support unstructured control flow
This revision adds support for unstructured control flow to the bufferization infrastructure. In particular: regions with multiple blocks, `cf.br`, `cf.cond_br`.

Two helper templates are added to `BufferizableOpInterface.h`, which can be implemented by ops that supported unstructured control flow in their regions (e.g., `func.func`) and ops that branch to another block (e.g., `cf.br`).

A block signature is always bufferized together with the op that owns the block.

Differential Revision: https://reviews.llvm.org/D158094
2023-08-31 12:55:53 +02:00
Martin Erhart
950f0944c9 [mlir][bufferization] Factor out bufferization.dealloc lowering into separate pass
Moves the lowering of `bufferization.dealloc` to memref into a separate pass,
but still registers the pattern in the conversion pass.  This is helpful when
some tensor values (and thus `to_memref` or `to_tensor` operations) still
remain, e.g., when the function boundaries are not converted, or when constant
tensors are converted to memref.get_global at a later point.

However, it is still recommended to perform all bufferization before
deallocation to avoid memory leaks as all memref allocations inserted after the
deallocation pass was applied, have to be handled manually.

Note: The buffer deallocation pass assumes that memref values defined by
`bufferization.to_memref` don't return ownership and don't have to be
deallocated. `bufferization.to_tensor` operations are handled similarly to
`bufferization.clone` operations with the exception that the result value is
not handled because it's a tensor (not a memref).

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D159180
2023-08-31 07:10:31 +00:00
Fangrui Song
c7dce0283b [Driver] Adjust -fsanitize=function & -mexecute-only interop after D158614
clangDriver depends on clangBasic, so clangBasic should not depend on
clangDriver, even just its header. Also remove clangBasic's dependency
on LLVMOption.

The issue can be seen through the bazel commit
d26dd681f9 which is reverted now.

Add hasFlagNoClaim and use it as we don't want to suppress
-Wunused-command-line-argument for -mexecute-only just because
-fsanitize= is specified.
2023-08-30 20:30:13 -07:00
Pranav Kant
39f6a31eaa [Bazel] Better fix for d26dd681
Don't use glob for specific files
2023-08-31 03:07:49 +00:00
Reid Kleckner
5bc514b74e [bazel] Remove the dependency on CodeGen from MCTargetDesc & Utils
This means llvm-mc should now build without depending on the target
CodeGen libraries.

Fix up a few includes in RISCV, AMDGPU, and X86 MCA to avoid transitive
deps on CodeGen.

Fixes #64166
2023-08-30 18:21:28 -07:00
Reid Kleckner
52abac26ef [bazel] Add missing dep from DwarfLinkerParallel to Object
llvm-dwarfutil now builds successfully with Bazel.
2023-08-30 16:26:44 -07:00
Pranav Kant
d26dd681f9 [Bazel] Fix build 2023-08-30 19:30:12 +00:00
Tue Ly
76bb278ebb [libc][math] Implement double precision exp10 function correctly rounded for all rounding modes.
Implement double precision exp10 function correctly rounded for all
rounding modes.  Using the same algorithm as double precision exp
(https://reviews.llvm.org/D158551) and exp2 (https://reviews.llvm.org/D158812)
functions.

Reviewed By: zimmermann6

Differential Revision: https://reviews.llvm.org/D159143
2023-08-30 08:43:50 -04:00
Aliia Khasanova
84072f7beb [bazel] Fix build files for adea7e7032 2023-08-29 19:32:13 +02:00
Aliia Khasanova
5f660839e4 Fix bazel build file for bbf0733030. 2023-08-29 09:52:52 +02:00
Tue Ly
eee564f20a [libc][bazel] Add missing math functions and tests (exp, exp2, erff) to bazel layout.
Add missing math functions and tests (exp, exp2, erff) to bazel layout.

Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D158989
2023-08-28 10:47:54 -04:00
Adrian Kuegel
e957bbe9e6 [mlir][Bazel] Add missing dependency after dc3dc97410 2023-08-28 07:57:38 +02:00
Tue Ly
b825808d8b [libc][bazel] Add missing triple_double header and target to bazel overlay.
Add missing triple_double header and target to bazel overlay.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D158877
2023-08-25 15:28:02 -04:00
Yijia Gu
2289c7f760 set correct mlir dir for td file 2023-08-23 21:42:02 -07:00
Yijia Gu
83cc73a3d4 add openmp python binding in bazel 2023-08-23 21:39:28 -07:00
Yijia Gu
7d889c044a fix format error in python/BUILD.bazel 2023-08-23 18:24:33 -07:00
Yijia Gu
ad7e6e90c2 update bazel for python binding 2023-08-23 17:50:29 -07:00
Krasimir Georgiev
4d4ed5b215 [bazel] keep args one-per-line
Allows more easily to manage custom additions and removals.
2023-08-23 08:44:13 +00:00
Benjamin Kramer
cb9b3ad50b [bazel] Port 23459f13fc 2023-08-22 12:16:35 +02:00
Christian Sigg
c78b6c059c [Bazel][mlir] Add more missing dependencies after 7c4e8c6 2023-08-22 08:02:00 +02:00
Christian Sigg
3eba48b84c [Bazel][mlir] Add missing dependencies after 7c4e8c6 2023-08-22 06:26:47 +02:00
Benjamin Kramer
b0ce19209f [bazel][libc] Add missing dependency for cd96aa7e10 2023-08-21 13:58:01 +02:00
Adrian Kuegel
45325a2de9 [mlir][Bazel] Add missing dependencies after 14de5a2a4f 2023-08-21 09:48:44 +02:00
Benjamin Kramer
e940926f3a [bazel] Make transitive OpBase.td inclusions visible to pdll tests 2023-08-19 20:02:02 +02:00
Benjamin Kramer
e51b21a1ff [bazel] Add new files from b448fe0c12 2023-08-19 19:56:24 +02:00
Dmitry Chernenkov
b7d304300a [Bazel] Add BitcodeConvenience.h 2023-08-18 12:25:01 +00:00
Dmitry Chernenkov
d2aff81285 [Bazel] Fix MLIR build 2023-08-18 09:40:34 +00:00
Dmitry Chernenkov
8f4a0b701f [Bazel] Fix for Enable multicall driver 2023-08-17 23:26:51 +00:00
Dmitry Chernenkov
c9f8aeec5f Revert "[Bazel] Fix for Enable multicall driver"
This reverts commit 4a235f65fa.
2023-08-17 08:33:52 +00:00
Dmitry Chernenkov
4a235f65fa [Bazel] Fix for Enable multicall driver 2023-08-17 07:56:24 +00:00
Adrian Kuegel
fb2264f269 [mlir][Bazel] Remove superfluous (?) strip_include_prefix settings.
Differential Revision: https://reviews.llvm.org/D157854
2023-08-14 13:07:36 +02:00
Johannes Reifferscheid
28f13124f8 [Bazel] [python bindings] Bindings for vendor GPU dialects
Reviewed By: olegshyshkov

Differential Revision: https://reviews.llvm.org/D157841
2023-08-14 10:55:36 +02:00
Angus Lees
87554d1c0e [bazel] Use binary_alias instead of symlinks for ld.lld and friends
Symlinks are poorly supported in Bazel+remote-exec.  Create the links from `ld.lld`,
`ld64.lld`, `lld-link`, `wasm-ld` to `lld` using LLVM's `binary_alias` instead.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D157830
2023-08-13 21:01:57 -07:00
Lei Zhang
1a38843f86 [mlir][spirv] Fix BUILD.bazel for the SPIRVConversion target 2023-08-12 19:58:45 -07:00
Benjamin Kramer
bb32e91f33 [bazel] Port 8ae074b195 2023-08-12 12:00:13 +02:00
Benjamin Kramer
88c2254440 [bazel] Add missing dependencies for b43068e870 2023-08-12 11:54:50 +02:00
Benjamin Kramer
a5425c2893 [bazel] Port 43752a2aa3 2023-08-12 11:48:34 +02:00
Benjamin Kramer
9a4bf6c3b9 [bazel] Port 6a0feb1503 2023-08-12 11:44:38 +02:00
Anlun Xu
d3e217d461 [bazel] Fix build
Differential Revision: https://reviews.llvm.org/D157758
2023-08-11 14:50:32 -07:00
Dmitri Gribenko
95fbe70a13 [bazel][libc] Add a missing dependency 2023-08-11 15:00:16 +02:00
Matthias Springer
1fdbbd158d [mlir][Conversion] Implement ConvertToLLVMPatternInterface for FuncDialect
Also a new pass option `ConvertToLLVMPass` to populate only patterns from the specified dialects. This is needed because the existing test cases expect that only ops from certain dialects are lowered. (E.g., "arith-to-llvm" expects that only "arith" ops are lowered but not "func" ops.)

Differential Revision: https://reviews.llvm.org/D157627
2023-08-11 10:05:30 +02:00
Adrian Kuegel
1040750193 [clang][Bazel] Add missing dependency after a563ced78b 2023-08-11 09:35:33 +02:00
Oleg Shyshkov
da947ea175 [mlir][bazel] Fix bazel build. 2023-08-11 08:17:09 +02:00
Nicolas Vasilache
920c461219 [mlir][Transform] Add support to drive conversions of func to LLVM with TD
This revision adds a `transform.apply_conversion_patterns.func.func_to_llvm` transformation.

It is unclear at this point whether this should be spelled out as a standalone transformation
or whether it should resemble `transform.apply_conversion_patterns.dialect_to_llvm "fun"`.

This is dependent on how we want to handle the type converter creation.
In particular the current implementation exhibits the fact that
`transform.apply_conversion_patterns.memref.memref_to_llvm_type_converter` was not rich enough
and did not match the LowerToLLVMOptions.

Keeping those options in sync across all the passes that lower to LLVM is very error prone.
Instead, we should have a single `to_llvm_type_converter`.

Differential Revision: https://reviews.llvm.org/D157553
2023-08-10 13:17:00 +00:00
Guillaume Chatelet
bc2b1193b5 [libc] add the CPP algorithm header for min/max
Reviewed By: jhuber6, sivachandra

Differential Revision: https://reviews.llvm.org/D157405
2023-08-10 08:00:18 +00:00
Jorge Gorbe Moya
6556e29025 [bazel] Add missing dep after 99475f5b4a 2023-08-09 10:10:52 -07:00
Matthias Springer
977cb4fdf8 [mlir][linalg][transform] PadOp: Add option to generate linalg.copy copy_back op
Three different options can be specified:
* `bufferization.copy_tensor` (default)
* `linalg.copy`
* `none` (no copy_back)

Differential Revision: https://reviews.llvm.org/D156173
2023-08-09 17:10:16 +02:00
Nicolas Vasilache
99475f5b4a [mlir][transform] Add NVGPU to NVVM conversion via transform.apply_conversion_patterns
Differential Revision: https://reviews.llvm.org/D157501
2023-08-09 14:09:57 +00:00