Commit Graph

1631 Commits

Author SHA1 Message Date
Benjamin Kramer
01893b5483 [bazel] Add a dependency missing from 68ea8a674c 2023-11-13 13:47:28 +01:00
Benjamin Kramer
68ea8a674c [bazel] Port a207e6307a 2023-11-13 13:43:53 +01:00
wenzhi-cui
858453dd71 Adds ":Support" to MLIRBindingsPythonCore deps (#72087)
Adds ":Support" to MLIRBindingsPythonCore deps
2023-11-13 07:34:16 +01:00
Oleg Shyshkov
5bffdc213f [mlir][bazel] Fix build for 00c3c73189 2023-11-11 10:47:00 +01:00
lntue
3f906f513e [libc][math] Add initial support for C23 float128 math functions, starting with copysignf128. (#71731) 2023-11-10 14:32:59 -05:00
Jerry-Ge
6e6352f4da [TOSA] Add TosaToMLProgram conversion (#69787)
This patch adds a new pass to lower TOSA StatefulOps to corresponding ML
Program ops (https://mlir.llvm.org/docs/Dialects/MLProgramOps/).

Signed-off-by: Jerry Ge <jerry.ge@arm.com>
2023-11-10 10:54:51 -08:00
doshimili
3153aa4c95 [libc] Adding a version of memset with software prefetching (#70857)
Software prefetching helps recover performance when hardware prefetching
is disabled. The 'LIBC_COPT_MEMSET_X86_USE_SOFTWARE_PREFETCHING' compile
time option allows users to use this patch.
2023-11-10 10:56:16 +01:00
Haojian Wu
d451721006 [bazel] Add missing deps for libc's exp2f_impl and exp10f_impl targets. 2023-11-10 10:04:19 +01:00
lntue
a0303d8923 [libc][bazel] Add powf target and fix bazel overlay. (#71464) 2023-11-07 08:27:02 -05:00
Haojian Wu
04790b98e2 [bazel] Fix the bazel build for 2400c54c37
The header file is removed now.
2023-11-07 10:15:42 +01:00
Haojian Wu
df1e39489e [bazel] Port for libc change bc7a3bd864 2023-11-07 10:04:00 +01:00
Guillaume Chatelet
87b00ef35a [libc][bazel] Prevent LIBC_NAMESPACE leakeage (#70455)
Right now `LIBC_NAMESPACE` definition is added to all rules that depend on any libc function. This have far-reaching effects which prevents llvm-libc development when the installed libc is itself llvm-libc.

This PR removes the `:libc_root` target entirely and consistently uses the provided libc BUILD actions for compilation and testing. This makes sure that we don't leak `LIBC_NAMESPACE` to our clients.
2023-11-06 16:55:56 +01:00
Adrian Kuegel
c39995a116 [mlir][Bazel] Adjust SPIRVTarget and add missing dependency. 2023-11-06 13:26:16 +00:00
Oleg Shyshkov
d53ff36740 [mlir][bazel] Fix build for d9dadfda85 2023-11-06 13:20:48 +01:00
Haojian Wu
8a0535fbbe [bazel] Fix the bazel build for mlir:SPIRVTarget target. 2023-11-06 13:18:32 +01:00
Oleg Shyshkov
72ad6cd29c [mlir][bazel] Fix build. 2023-11-06 10:50:56 +01:00
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