Commit Graph

9996 Commits

Author SHA1 Message Date
Mehdi Amini fd6ba1d2c0 Apply clang-tidy fixes for readability-container-size-empty in SCF.cpp (NFC) 2022-01-14 18:08:43 +00:00
Mehdi Amini 1c173c9442 Apply clang-tidy fixes for readability-identifier-naming in MathOps.cpp (NFC) 2022-01-14 18:08:42 +00:00
Mehdi Amini 3b6943e66c Apply clang-tidy fixes for performance-for-range-copy in PadOpInterchange.cpp (NFC) 2022-01-14 18:08:42 +00:00
Mehdi Amini 813156eaa9 Apply clang-tidy fixes for performance-unnecessary-value-param in MLIRGen.cpp (NFC) 2022-01-14 18:08:42 +00:00
Rahul Joshi 8067ced144 [MLIR] Introduce generic visitors.
- Generic visitors invoke operation callbacks before/in-between/after visiting the regions
  attached to an operation and use a `WalkStage` to indicate which regions have been
  visited.
- This can be useful for cases where we need to visit the operation in between visiting
  regions attached to the operation.

Differential Revision: https://reviews.llvm.org/D116230
2022-01-14 09:15:27 -08:00
Stephan Herhut aa3cabe3cb [mlir][memref] Fix memref.copy of scalar memref
Also fix a memory leak in the test while at it.

Differential Revision: https://reviews.llvm.org/D117314
2022-01-14 16:13:12 +01:00
Uday Bondhugula 05f6e93938 [MLIR] NFC. affine data copy generate utility return value cleanup
Clean up return value on affineDataCopyGenerate utility. Return the
actual success/failure status instead of the "number of bytes" which
isn't being used in the codebase in any way. The success/failure status
wasn't being sent out earlier.

Differential Revision: https://reviews.llvm.org/D117209
2022-01-14 19:37:05 +05:30
Matthias Springer 1eeffcdb7a [mlir][linalg][bufferize] Support custom insertion point for buffer copies
By default, copies are inserted right before the tensor OpOperand use. With this change, `bufferize` implementation can change the insertion point. This is needed for some ops where it would be illegal to insert a copy right before the use.

Differential Revision: https://reviews.llvm.org/D117291
2022-01-14 22:47:20 +09:00
Matthias Springer e58e401b79 [mlir][memref] Fold self copies
Fold `memref.copy %x, %x`.

Differential Revision: https://reviews.llvm.org/D117224
2022-01-14 22:44:22 +09:00
Matthias Springer 40f5f3d62d [mlir][linalg][bufferize] Use memref.copy instead of linalg.copy
Differential Revision: https://reviews.llvm.org/D117220
2022-01-14 22:29:05 +09:00
Stephan Herhut ab95ba704d [mlir][memref] Implement fast lowering of memref.copy
In the absence of maps, we can lower memref.copy to a memcpy.

Differential Revision: https://reviews.llvm.org/D116099
2022-01-14 14:22:15 +01:00
Matthias Springer 96acdfa0de [mlir][memref] Fold copy of cast
If the source/dest is a cast that does not change shape/element type, the cast can be skipped.

Differential Revision: https://reviews.llvm.org/D117215
2022-01-14 21:51:12 +09:00
Alex Zinenko bea16e72a7 [mlir] Fix invalid assertion in ModuleTranslation.cpp
LLVM dialect supports terminators with repeated successor blocks that take
different operands. This cannot be directly expressed in LLVM IR though since
it uses the number of the predecessor block to differentiate values in its PHI
nodes. Therefore, the translation to LLVM IR inserts dummy blocks to forward
arguments in case of repeated succesors with arguments. The insertion works
correctly. However, when connecting PHI nodes to their source values, the
assertion of the insertion having worked correctly was incorrect: it would only
trigger if repeated blocks were adjacent in the successor list (not guaranteed
by anything) and would not check if the successors have operands (no need for
dummy blocks in absence of operands since no PHIs are being created). Change
the assertion to only trigger in case of duplicate successors with operands,
and don't expect them to be adjacent.

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D117214
2022-01-14 12:56:33 +01:00
Adrian Kuegel cc79d603c9 [mlir] Use .empty() instead of checking size() == 0.
Based on a finding by ClangTidy readability-container-size-empty check.
2022-01-14 11:58:52 +01:00
Mehdi Amini 8d20d83dd7 Fix a comment in CMake (NFC) 2022-01-14 07:33:06 +00:00
Mehdi Amini 46b1e83716 Do not build llc and mlir-cpu-runner to run MLIR tests with the native target isn't configured (NFC)
The relevant tests are already disabled in this case.
2022-01-14 07:30:34 +00:00
Alexander Belyaev 436d17a8e9 [mlir] Expose a function to get vector::CombiningKind from Operation*.
Differential Revision: https://reviews.llvm.org/D117283
2022-01-14 08:28:18 +01:00
Mehdi Amini 5a68a85d85 Mark some MLIR tests as requiring the native target to be configured
This makes `ninja check-mlir` work without the host targets configured.
2022-01-14 07:23:14 +00:00
Mehdi Amini dc9f18da86 Partially revert cac7aabbd82: some APIs don't have in-tree users and some build breaks weren't caught 2022-01-14 06:16:38 +00:00
River Riddle 11067d711b [mlir] Optimize OperationName construction and usage
When constructing an OperationName, the overwhelming majority of
cases are from registered operations. This revision adds a non-locked
lookup into the currently registered operations, which prevents locking
in the common case. This revision also optimizes several uses of
RegisteredOperationName that expect the operation to be registered,
e.g. such as in OpBuilder.

These changes provides a reasonable speedup (5-10%) in some
compilations, especially on platforms where locking is expensive.

Differential Revision: https://reviews.llvm.org/D117187
2022-01-13 21:14:36 -08:00
wren romano cf35825388 [mlir][sparse] Moving the sort from factory method to the constructor.
This guarantees the preconditions of fromCOO; whereas prior to this, one could call the constructor directly with an unsorted tensor, which would cause fromCOO to misbehave.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D117167
2022-01-13 19:44:51 -08:00
Mehdi Amini 58ec17cb4e Apply clang-tidy fixes for readability-simplify-boolean-expr to MLIR (NFC) 2022-01-14 02:26:28 +00:00
Mehdi Amini cac7aabbd8 Apply clang-tidy fixes for readability-identifier-naming to MLIR (NFC) 2022-01-14 02:26:28 +00:00
Mehdi Amini d1b63c603a Apply clang-tidy fixes for readability-avoid-const-params-in-decls to MLIR (NFC) 2022-01-14 02:26:28 +00:00
Mehdi Amini e8d073951b Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC) 2022-01-14 02:26:27 +00:00
Mehdi Amini 8e5f112c05 Apply clang-tidy fixes for performance-move-const-arg to MLIR (NFC) 2022-01-14 02:26:27 +00:00
Mehdi Amini a68c8d3009 Apply clang-tidy fixes for performance-for-range-copy to MLIR (NFC) 2022-01-14 02:26:27 +00:00
Mehdi Amini 2071e7204d Apply clang-tidy fixes for modernize-use-using to MLIR (NFC) 2022-01-14 02:26:27 +00:00
Mehdi Amini bd87241c44 Apply clang-tidy fixes for modernize-use-override to MLIR (NFC) 2022-01-14 02:26:27 +00:00
Mehdi Amini 9940dcfa4a Apply clang-tidy fixes for modernize-use-equals-default to MLIR (NFC) 2022-01-14 02:26:27 +00:00
Mehdi Amini 59d8740f2f Apply clang-tidy fixes for modernize-use-default-member-init to MLIR (NFC) 2022-01-14 02:26:26 +00:00
Mehdi Amini d19f89b5d2 Apply clang-tidy fixes for llvm-qualified-auto to MLIR (NFC) 2022-01-14 02:26:26 +00:00
Peixin-Qiao f52805539b [OMPIRBuilder] Fix store inst alignment for ordered depend directive
OpenMP runtime requires depend vec with i64 type and the alignment of
store instruction should be set as 8.

Reviewed By: kiranchandramohan, shraiysh

Differential Revision: https://reviews.llvm.org/D116300
2022-01-14 09:47:11 +08:00
Mehdi Amini ba37c3b152 Apply clang-tidy fixes for llvm-namespace-comment in ToolUtilities.h (NFC) 2022-01-13 23:25:49 +00:00
Mehdi Amini b0aea19813 Apply clang-tidy fixes for llvm-namespace-comment in ParallelLoopMapper.h (NFC) 2022-01-13 23:25:49 +00:00
Mehdi Amini 63edb563a1 Apply clang-tidy fixes for llvm-namespace-comment in GPUToNVVMPass.h (NFC) 2022-01-13 23:25:49 +00:00
Mehdi Amini e4f5d47296 Apply clang-tidy fixes for llvm-namespace-comment in MemoryPromotion.h (NFC) 2022-01-13 23:25:49 +00:00
Mehdi Amini ac7a2742b2 Apply clang-tidy fixes for llvm-else-after-return in CommonFolders.h (NFC) 2022-01-13 23:25:49 +00:00
Mehdi Amini 4e08ce7adb Revert "Upstream MLIR PyTACO implementation."
This reverts commit 778a264da9.

This broke the bot: tests are failing at the moment.
2022-01-13 23:14:13 +00:00
Mehdi Amini 8f23296bcc Apply clang-tidy fixes for llvm-header-guard in MLIR (NFC)
Differential Revision: https://reviews.llvm.org/D117251
2022-01-13 23:14:06 +00:00
Aart Bik e52f530c36 [mlir][sparse] fix two typos
(1) copy-and-past error in encoding alias name:
    this is an annotation for a tensor (3-d) not a matrix (2-d).

(2) typo in "initialization"

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D117255
2022-01-13 15:11:55 -08:00
Bixia Zheng 778a264da9 Upstream MLIR PyTACO implementation.
Add TACO tests to test/Integration/Dialect/SparseTensor/taco. Add the MLIR
PyTACO implementation as tools under the directory.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D117126
2022-01-13 14:50:28 -08:00
Markus Böck 52b8fe9b6e [mlir] Fix attaching side effects on `FlatSymbolRefAttr`
The names of the generated attribute getters for ops changed some time ago. The method created from the attribute name returns the return type and an additional method of the same name with Attr as suffix is generated which returns the actual attribute as its storage type.

The code generating effects however was using the methods without the Attr suffix, which is a problem in the case of FlatSymbolRefAttr as it has a return type of llvm::StringRef. This would lead to compilation errors as the constructor of SideEffects::EffectInstance expects a SymbolRefAttr in this case.

This patch simply fixes the generated effects code to use the Attr suffixed getter to get the actual storage type of the attribute.

Differential Revision: https://reviews.llvm.org/D117194
2022-01-13 19:57:01 +01:00
Mehdi Amini f7c589d3e7 Clarify that fold() can't "erase" an operation in the MLIR Canonicalization doc (NFC) 2022-01-13 18:43:18 +00:00
Rob Suderman 173fce4205 [mlir][tosa] Update default tosa-to-linalg passes
Adding the optional decompositions have been verified to improve memory
usage on common models. Added the decomposition to the default tosa to linalg
passes.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D117175
2022-01-13 10:17:44 -08:00
Duncan P. N. Exon Smith b77d4d54f9 mlir: Avoid SmallVector::set_size in SerializeToHsacoPass::loadLibraries
Spotted this in a final grep of projects I don't usually build before
pushing https://reviews.llvm.org/D115380, which makes
`SmallVector::set_size()` private.

Update to `truncate()`, a new-ish variant of `resize()` that asserts the
new size is not bigger and that avoids pulling in the allocation and
initialization code for growing. Doesn't really look like the perf
impact of that would matter here, but since `dirLength` is known to be a
smaller size then we might as well.

Differential Revision: https://reviews.llvm.org/D117073
2022-01-13 10:17:00 -08:00
Benoit Jacob 499703e9c0 Enable ReassociatingReshapeOpConversion with "non-identity" layouts.
Enable ReassociatingReshapeOpConversion with "non-identity" layouts.

This removes an early-return in this function, which seems unnecessary and is
preventing some memref.collapse_shape from converting to LLVM (see included lit test).

It seems unnecessary because the return message says "only empty layout map is supported"
but there actually is code in this function to deal with non-empty layout maps. Maybe
it refers to an earlier state of implementation and is just out of date?

Though, there is another concern about this early return: the condition that it actually
checks, `{src,dst}MemrefType.getLayout().isIdentity()`, is not quite the same as what the
return message says, "only empty layout map is supported". Stepping through this
`getLayout().isIdentity()` code in GDB, I found that it evaluates to `.getAffineMap().isIdentity()`
which does (AffineMap.cpp:271):

```
  if (getNumDims() != getNumResults())
    return false;
```

This seems that it would always return false for memrefs of rank greater than 1 ?

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114808
2022-01-13 17:46:20 +00:00
Denys Shabalin a8a2ee6331 [mlir] Introduce C API for PDL dialect types
This change introduces C API helper functions to work with PDL types.
Modification closely follow the format of the https://reviews.llvm.org/D116546.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D117221
2022-01-13 15:29:01 +01:00
Denys Shabalin edcac733dc [mlir] Fix reference to out of date CMake function
Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D117222
2022-01-13 15:26:36 +01:00
Javier Setoain 7c56458616 [mlir] Fix scalable type translation in splat element attr
LLVM Dialect Constant Op translations assume that if the attribute is a
vector, it's a fixed length one, generating an invalid translation for
constant scalable vector initializations.

Differential Revision: https://reviews.llvm.org/D117125
2022-01-13 11:14:41 +00:00
Ivan Butygin b65f21a498 [mlir] Provide getMixedOffsets/sizes/strides as free functions
* This is useful when you need to build mixed array from external static/dynamic arrays (e.g. from adaptor during dialect conversion)
* Also, to reduce C++ code in td and generated files

Differential Revision: https://reviews.llvm.org/D117106
2022-01-13 13:46:31 +03:00
Adrian Kuegel 159898d568 [mlir] Add missing const to cloneWith method. 2022-01-13 09:40:29 +01:00
River Riddle 0998637e6f [mlir] Add a parsePassPipeline overload that returns a new pass manager
This overload parses a pipeline string that contains the anchor operation type, and returns an OpPassManager
corresponding to the provided pipeline. This is useful for various situations, such as dynamic pass pipelines
which are not anchored within a parent pass pipeline.

fixes #52813

Differential Revision: https://reviews.llvm.org/D116525
2022-01-12 14:54:30 -08:00
natashaknk 310e9636ca [tosa][mlir] Support dynamic batch dimension for ops where the batch dim is explicit
Dynamic batch for rescale, gather, max_pool, avg_pool, conv2D and depthwise_conv2D. Split helper functions into a separate header file.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D117031
2022-01-12 14:16:50 -08:00
River Riddle 676bfb2a22 [mlir] Refactor ShapedType into an interface
ShapedType was created in a time before interfaces, and is one of the earliest
type base classes in the ecosystem. This commit refactors ShapedType into
an interface, which is what it would have been if interfaces had existed at that
time. The API of ShapedType and it's derived classes are essentially untouched
by this refactor, with the exception being the API surrounding kDynamicIndex
(which requires a sole home).

For now, the API of ShapedType and its name have been kept as consistent to
the current state of the world as possible (to help with potential migration churn,
among other reasons). Moving forward though, we should look into potentially
restructuring its API and possible its name as well (it should really have "Interface"
at the end like other interfaces at the very least).

One other potentially interesting note is that I've attached the ShapedType::Trait
to TensorType/BaseMemRefType to act as mixins for the ShapedType API. This
is kind of weird, but allows for sharing the same API (i.e. preventing API loss from
the transition from base class -> Interface). This inheritance doesn't affect any
of the derived classes, it is just for API mixin.

Differential Revision: https://reviews.llvm.org/D116962
2022-01-12 14:12:09 -08:00
River Riddle a60e83fe7c [mlir][Interfaces] Add a extraSharedClassDeclaration field
This field allows for defining a code block that is placed in both the interface
and trait declarations. This is very useful when defining a set of utilities to
expose on both the Interface class and the derived attribute/operation/type.

In non-static methods, `$_attr`/`$_op`/`$_type` (depending on the type of
interface) may be used to refer to an instance of the IR entity. In the interface
declaration, this is an instance of the interface class. In the trait declaration,
this is an instance of the concrete entity class (e.g. `IntegerAttr`, `FuncOp`, etc.).

Differential Revision: https://reviews.llvm.org/D116961
2022-01-12 14:12:08 -08:00
Rob Suderman aa1c533a4e [mlir][tosa] Expand tosa.apply_scale lowering for vectors
Apply scale may encounter scalar, tensor, or vector operations. Expand the
lowering so that it can lower arbitrary of container types.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D117080
2022-01-12 14:07:52 -08:00
River Riddle d4d016869d [mlir] Remove populateFuncOpTypeConversionPattern
This method simply forwards to populateFunctionLikeTypeConversionPattern,
which is more general. This also helps to remove special treatment of FuncOp from
DialectConversion.

Differential Revision: https://reviews.llvm.org/D116624
2022-01-12 14:05:35 -08:00
Mehdi Amini 9dc4dea110 Add llc to the list of build dependencies to test MLIR (Fix buildbot) 2022-01-12 20:55:52 +00:00
Mehdi Amini 453a056df6 Add split-file to the MLIR test dependencies (Fix bot) 2022-01-12 20:33:52 +00:00
Kazu Hirata 44bb5cd80d [mlir] Fix a warning
This patch fixes:

  mlir/lib/Dialect/Arithmetic/Transforms/ExpandOps.cpp:161:52: error:
  'static_assert' with no message is a C++17 extension
  [-Werror,-Wc++17-extensions]
2022-01-12 12:31:43 -08:00
Mehdi Amini 44bdcb889a Apply clang-tidy fixes for bugprone-macro-parentheses in Interop.h (NFC) 2022-01-12 20:21:47 +00:00
Mehdi Amini ac5d32b103 Add an example of integration test invoking MLIR source with Memref from C
Reviewed By: ftynse, nicolasvasilache, bondhugula

Differential Revision: https://reviews.llvm.org/D117072
2022-01-12 20:18:56 +00:00
River Riddle 56f62fbf73 [mlir] Finish removing Identifier from the C++ API
There have been a few API pieces remaining to allow for a smooth transition for
downstream users, but these have been up for a few months now. After this only
the C API will have reference to "Identifier", but those will be reworked in a followup.

The main updates are:
* Identifier -> StringAttr
* StringAttr::get requires the context as the first parameter
  - i.e. `Identifier::get("...", ctx)` -> `StringAttr::get(ctx, "...")`

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D116626
2022-01-12 11:58:23 -08:00
Christian Sigg be1aeb818c Remove NaN constant from arith.minf, arith.maxf expansion
If any of the operands is NaN, return the operand instead of a new constant.

When the rhs operand is a constant, the second arith.cmpf+select ops will be folded away.

https://reviews.llvm.org/D117010 marks the two ops commutative, which will place the constant on the rhs.

Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D117011
2022-01-12 20:56:40 +01:00
Christian Sigg f6fab68c30 Fold arith.cmpf when at least one operand is known to be NaN.
Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D117101
2022-01-12 20:48:52 +01:00
Thomas Raoux b0a309dd7a [mlir][vector] Add folding for extract + extract/insert_strided
Differential Revision: https://reviews.llvm.org/D116785
2022-01-12 11:48:35 -08:00
William S. Moses 1773dddadf [MLIR][Math] Enable constant folding of ops
Enable constant folding of ops within the math dialect, and introduce constant folders for ceil and log2

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D117085
2022-01-12 12:19:29 -05:00
Matthias Springer 57e714bcc8 [mlir][linalg][bufferize] Add pass options for `createDeallocs`
This change makes it possible to use a different buffer deallocation strategy. E.g., `-buffer-deallocation` can be used, which also works for allocations that are not in destination-passing style.

Differential Revision: https://reviews.llvm.org/D117096
2022-01-12 18:55:36 +09:00
Matthias Springer 6c654b5198 [mlir][linalg][bufferize] Support std.select bufferization
This op is an example for how to deal with ops who's OpResult may aliasing with one of multiple OpOperands.

Differential Revision: https://reviews.llvm.org/D116868
2022-01-12 17:46:44 +09:00
Uday Bondhugula fc61d07dc1 Add inliner interface for GPU dialect
Add inliner interface for GPU dialect. The interface marks all GPU
dialect ops legal to inline anywhere.

Differential Revision: https://reviews.llvm.org/D116889
2022-01-12 12:55:02 +05:30
William S. Moses d2c547342c Revert "[MLIR][Math] Enable constant folding of ops"
This reverts commit 2f8b956ab6.

There is a linker error for mlir-nvidia as seen on
https://lab.llvm.org/buildbot/#/builders/61/builds/19939.

As it's late for me here, I'm oing to rever this for now to be
investigated later.
2022-01-12 02:00:53 -05:00
William S. Moses 2f8b956ab6 [MLIR][Math] Enable constant folding of ops
Enable constant folding of ops within the math dialect, and introduce constant folders for ceil and log2

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D117085
2022-01-12 01:55:48 -05:00
William S. Moses aaa0c81683 [MLIR][LLVM] Add memoryeffect for alloca
Add memory effect for llvm.alloca op

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D117086
2022-01-12 01:53:24 -05:00
William S. Moses d23fa4f2f1 [MLIR][SCF] Remove unused arguments to whileop
Canonicalize away unused arguments to the before region of a whileOp

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D117059
2022-01-11 20:18:08 -05:00
William S. Moses 97567bde5b [MLIR][SCF] Canonicalize while statement whose cmp condition is recomputed in the after region
Given a while loop whose condition is given by a cmp, don't recomputed the comparison (or its inverse) in the after region, instead use a constant since  the original condition must be true if we branched to the after region.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D117047
2022-01-11 18:34:04 -05:00
MaheshRavishankar e7cb716ef9 [mlir][Linalg] Pattern to fuse pad operation with elementwise operations.
Most convolution operations need explicit padding of the input to
ensure all accesses are inbounds. In such cases, having a pad
operation can be a significant overhead. One way to reduce that
overhead is to try to fuse the pad operation with the producer of its
source.

A sequence

```
linalg.generic -> linalg.pad_tensor
```

can be replaced with

```
linalg.fill -> tensor.extract_slice -> linalg.generic ->
tensor.insert_slice.
```

if the `linalg.generic` has all parallel iterator types.

Differential Revision: https://reviews.llvm.org/D116418
2022-01-11 13:37:25 -08:00
William S. Moses 65c15cbd4a [MLIR][LLVM] Add MemRead/MemWrite behavior to llvm store/load/addressof ops
This patch adds corresponding memory effects to mlir llvm-dialect load/store/addressof ops, which thus enables canonicalizations of those ops (like dead code elimination) that rely on the effect interface

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D117041
2022-01-11 14:55:30 -05:00
Mehdi Amini 75b08cce47 Apply clang-tidy fixes for readability-redundant-control-flow in OpenMPDialect.cpp (NFC) 2022-01-11 19:13:58 +00:00
Kazu Hirata 0ceb332a76 [mlir] Fix a missing override warning
This patch fixes:

  mlir/lib/Dialect/Tosa/Transforms/TosaOptionalDecompositions.cpp:28:8:
  error: 'runOnFunction' overrides a member function but is not marked
  'override' [-Werror,-Wsuggest-override]
2022-01-11 11:03:22 -08:00
Aaron DeBattista dfd070820c [mlir][tosa] Allow optional TOSA decompositions to be populated separately
Moved all TOSA decomposition patterns so that they can be optionally populated
and used by external rewrites. This avoids decomposing TOSa operations when
backends may benefit from the non-decomposed version.

Reviewed By: rsuderman, mehdi_amini

Differential Revision: https://reviews.llvm.org/D116526
2022-01-11 10:26:30 -08:00
Rob Suderman 630084549b [mlir][tosa] Relax tosa.apply_scale operations
Apply scale may operate on vectors, scalars, or tensors during
tiling. Relax the requirements to avoid failures.

Reviewed By: NatashaKnk

Differential Revision: https://reviews.llvm.org/D116981
2022-01-11 09:57:36 -08:00
William S. Moses 5443d2ed98 [MLIR][SCF] Simplify scf.if by swapping regions if condition is a not
Given an if of the form, simplify it by eliminating the not and swapping the regions

scf.if not(c) {
  yield origTrue
} else {
  yield origFalse
}

becomes

scf.if c {
  yield origFalse
} else {
  yield origTrue
}

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D116990
2022-01-11 12:57:29 -05:00
Lei Zhang b22a93f4fb [mlir][linalg] Improve pooling op iterator order consistency
All named ops list iterators for accessing output first except
pooling ops. This commit made the pooling ops consistent with
the rest.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D115520
2022-01-11 17:49:22 +00:00
Christian Sigg d345ce65ff Mark arith.minf, arith.maxf as commutative.
Reviewed By: herhut

Differential Revision: https://reviews.llvm.org/D117010
2022-01-11 17:47:53 +01:00
Benjamin Kramer 7f47005dcc [mlir][linalg] Use cast instead of dyn_cast that's always dereferenced
This turns a random nullptr deref into an assertion failure in case
`tensor::registerInferTypeOpInterfaceExternalModels` isn't called.
2022-01-11 15:05:45 +01:00
Matthias Springer 2c5c5ca868 [mlir][linalg][bufferize] Fix CallOp bufferization
Previously, CallOps did not have any aliasing OpResult/OpOperand pairs. Therefore, CallOps were mostly ignored by the analysis and buffer copies were not inserted when necessary.

This commit introduces the following changes:
* Function bbArgs writable by default. A function can now be bufferized without inspecting its callers.
* Callers must introduce buffer copies of function arguments when necessary. If a function is external, the caller must conservatively assume that a function argument is modified by the callee after bufferization. If the function is not external, the caller inspects the callee to determine if a function argument is modified.

Differential Revision: https://reviews.llvm.org/D116457
2022-01-11 20:10:21 +09:00
Julian Gross 4b01968b5e [MLIR] Update allocs to memref.allocs in documentation.
Changed the remaining appearances of alloc to memref.alloc in several
documentation sections, since they lead to misunderstandings, if they
are used.

Differential Revision: https://reviews.llvm.org/D116999
2022-01-11 11:22:22 +01:00
Diego Caballero e2b658cd5d [mlir][GPU] Fix attribute name of DL specification
D115722 added a DL spec to GPU modules. It happens that the DL
default interface implementation is sensitive to the name of the
DL spec attribute. This patch is fixing the name of the attribute
to be the expected one.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D116956
2022-01-11 08:30:52 +00:00
Mehdi Amini 63f0c00d38 Add a `qualified` directive to the Op, Attribute, and Type declarative assembly format
This patch introduces a new directive that allow to parse/print attributes and types fully
qualified.
This is a follow-up to ee0908703d which introduces the eliding of the `!dialect.mnemonic` by default and allows to force to fully qualify each type/attribute
individually.

Differential Revision: https://reviews.llvm.org/D116905
2022-01-11 01:30:19 +00:00
Tyler Augustine 87a9be2a74 Don't fail if unable to promote loops during unrolling
When the unroll factor is 1, we should only fail "unrolling" when the trip count also is determined to be 1 and it is unable to be promoted.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D115365
2022-01-10 22:26:21 +00:00
Ivan Butygin 08bc2eb1e0 [mlir][NFC] Fully spell mlir typenames in BaseOpWithOffsetSizesAndStrides
Differential Revision: https://reviews.llvm.org/D116951
2022-01-10 21:22:07 +03:00
William S. Moses a02af37560 [MLIR] Generalize select to arithmetic canonicalization
Given a select whose result is an i1, we can eliminate the conditional in the select completely by adding a few arithmetic operations.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D116839
2022-01-10 11:50:17 -05:00
James Y Knight 39f75ab6a7 Fix unused-variable warnings after d0ee094d6a. 2022-01-10 16:28:54 +00:00
Nicolas Vasilache d0ee094d6a [mlir][Bufferize] Fix incorrect bufferization of rank-reducing tensor ops.
This revision fixes SubviewOp, InsertSliceOp, ExtractSliceOp construction during bufferization
where not all offset/size/stride operands were properly specified.

A test that exhibited problematic behaviors related to incorrect memref casts is introduced.
Init tensor optimization is disabled in teh testing func bufferize pass.

Differential Revision: https://reviews.llvm.org/D116899
2022-01-10 10:14:55 -05:00
Matthias Springer 0696ad9563 [mlir][linalg][bufferize][NFC] Pass missing BufferizationState objs as const ref
These should have been updated as part of D116742.

Differential Revision: https://reviews.llvm.org/D116937
2022-01-10 23:38:04 +09:00
Nicolas Vasilache 1a2474b786 [mlir][Linalg] Disable init_tensor elimination by default
init_tensor elimination is arguably a pre-optimization that should be separated from comprehensive bufferization.
In any case it is still experimental and easily results in wrong IR with violated SSA def-use orderings.
Isolate the optimization behind a flag, separate the test cases and add a test case that would results in wrong IR.

Differential Revision: https://reviews.llvm.org/D116936
2022-01-10 09:19:18 -05:00
Serge Guelton d2cc6c2d0c Use a sorted array instead of a map to store AttrBuilder string attributes
Using and std::map<SmallString, SmallString> for target dependent attributes is
inefficient: it makes its constructor slightly heavier, and involves extra
allocation for each new string attribute. Storing the attribute key/value as
strings implies extra allocation/copy step.

Use a sorted vector instead. Given the low number of attributes generally
involved, this is cheaper, as showcased by

https://llvm-compile-time-tracker.com/compare.php?from=5de322295f4ade692dc4f1823ae4450ad3c48af2&to=05bc480bf641a9e3b466619af43a2d123ee3f71d&stat=instructions

Differential Revision: https://reviews.llvm.org/D116599
2022-01-10 14:49:53 +01:00
Matthias Springer 446f0c609f [mlir][linalg][bufferize][NFC] Update comments in BufferizableOpInterface
Differential Revision: https://reviews.llvm.org/D116932
2022-01-10 22:34:26 +09:00
Matthias Springer cb64c541f9 [mlir][linalg][bufferize][NFC] Clean up bufferization entry point
Differential Revision: https://reviews.llvm.org/D116892
2022-01-10 21:50:36 +09:00
Alex Zinenko c44d521b30 [mlir] address post-commit review for D116759 2022-01-10 12:40:58 +01:00
Alex Zinenko 2f672e2ffa [mlir] Don't inline calls from dead SCCs
During iterative inlining of the functions in a multi-step call chain, the
inliner could add the same call operation several times to the worklist, which
led to use-after-free when this op was considered more than once.

Closes #52887.

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D116820
2022-01-10 12:07:14 +01:00
Stephan Herhut 33cec20dbd [mlir][memref] Tighten verification of memref.reinterpret_cast
We allow the omission of a map in memref.reinterpret_cast under the assumption,
that the cast might cast to an identity layout. This change adds verification
that the static knowledge that is present in the reinterpret_cast supports
this assumption.

Differential Revision: https://reviews.llvm.org/D116601
2022-01-10 11:55:47 +01:00
Shraiysh Vaishay a8586b573e [mlir][OpenMP] Change the syntax of omp.atomic.read op
This patch changes the syntax of omp.atomic.read to take the address of
destination, instead of having the value in a result. This will allow
using omp.atomic.read operation within an omp.atomic.capture operation
thus making its implementation less complex.

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D116396
2022-01-10 16:19:45 +05:30
Stephen Neuendorffer 3523876873 Fix exported MLIR_TABLEGEN_EXE
LLVM_OPTIMIZED_TABLEGEN results in MLIR_TABLEGEN_EXE pointing to
an absolute path in the build directory.  This doesn't work
when exporting to an install directory.  This patch fixes the exported
information for an install directory to refer to the installed
mlir-tblgen.  (Note that this is probably a debug version if
LLVM_OPTIMIZED_TABLEGEN is set)
2022-01-09 23:27:08 -08:00
Mehdi Amini 60d13b85ca Apply clang-tidy fixes for performance-move-const-arg in ReductionNode.cpp (NFC) 2022-01-10 01:05:14 +00:00
Mehdi Amini ba19fa5779 Apply clang-tidy fixes for performance-for-range-copy in ElementwiseOpFusion.cpp (NFC) 2022-01-10 01:05:14 +00:00
Mehdi Amini 0c9d59e56a Apply clang-tidy fixes for performance-for-range-copy in ModuleBufferization.cpp (NFC) 2022-01-10 01:05:14 +00:00
Mehdi Amini 6a38cbfb53 Apply clang-tidy fixes for modernize-use-equals-default in IRCore.cpp (NFC) 2022-01-10 01:05:13 +00:00
Nicolas Vasilache 8871d8236a [mlir][MemRef] NFC - Improve assertion error message 2022-01-09 14:17:37 -05:00
Nicolas Vasilache 9ba25ec92d [mlir][Bufferize] NFC - Introduce areCastCompatible assertions to catch misformed CastOp early
Differential Revision: https://reviews.llvm.org/D116893
2022-01-09 14:13:08 -05:00
Mehdi Amini 18eb681821 Fix clang-tidy readability-redundant-smartptr-get in MLIR ModuleTranslation.cpp (NFC) 2022-01-08 20:07:11 +00:00
Mehdi Amini 651c73b8d1 Enable readability-redundant-smartptr-get in MLIR local clang-tidy config 2022-01-08 20:07:11 +00:00
Kazu Hirata 51fd157635 Remove duplicate forward declarations (NFC) 2022-01-08 11:56:42 -08:00
Uday Bondhugula 9cf9ed94ed Multiple fixes to affine loop tiling return status and checks
Fix crash in the presence of yield values. Multiple fixes to affine loop
tiling pre-condition checks and return status. Do not signal pass
failure on a failure to tile since the IR is still valid. Detect index
set computation failure in checkIfHyperrectangular and return failure.
Replace assertions with proper status return. Move checks to an
appropriate place earlier in the utility before mutation happens.

Differential Revision: https://reviews.llvm.org/D116738
2022-01-08 16:50:44 +05:30
Groverkss 0e19186c82 [MLIR][NFC] Move PresburgerSet to Presburger/ directory
This patch moves PresburgerSet to Presburger/ directory. This patch is purely
mechincal, it only moves and renames functionality and tests.

This patch is part of a series of patches to move presburger functionality to
Presburger/ directory.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D116836
2022-01-08 15:39:40 +05:30
Mehdi Amini 3e13c4c37c Avoid creating a ThreadPool in MlirOptMain when `--mlir-disable-threading` option is set
a32300a changed it to create a ThreadPool eagerly so that it gets reused
across buffers, however it also made it so that we create a ThreadPool
early even if we're not gonna use it later because of the command line
option `--mlir-disable-threading` is provided.

Fix #53056

Reland 45adf60802 after build fixes

Differential Revision: https://reviews.llvm.org/D116848
2022-01-08 02:26:41 +00:00
Mehdi Amini 4938949310 Revert "Avoid creating a ThreadPool in MlirOptMain when `--mlir-disable-threading` option is set"
This reverts commit 45adf60802.
Build is broken
2022-01-08 02:25:18 +00:00
Mehdi Amini 45adf60802 Avoid creating a ThreadPool in MlirOptMain when `--mlir-disable-threading` option is set
a32300a changed it to create a ThreadPool eagerly so that it gets reused
across buffers, however it also made it so that we create a ThreadPool
early even if we're not gonna use it later because of the command line
option `--mlir-disable-threading` is provided.

Fix #53056

Differential Revision: https://reviews.llvm.org/D116848
2022-01-08 02:18:19 +00:00
Groverkss 74903059b2 [MLIR] Add IntegerPolyhedron::getUniverse
This operation already exists in FlatAffineConstraints but is added to
IntegerPolyhedron to keep consistancy in available methods.
2022-01-08 02:59:56 +05:30
John Ericson 44e3365775 [CMake] Factor out config prefix finding logic
See the docs in the new function for details.

 I think I found every instance of this copy pasted code. Polly could
 also use it, but currently does something different, so I will save the
 behavior change for a future revision.

We get the shared, non-installed CMake modules following the pattern
established in D116472.

It might be good to have LLD and Flang also use this, but that would be
a functional change and so I leave it as future work.

Reviewed By: beanz, lebedev.ri

Differential Revision: https://reviews.llvm.org/D116521
2022-01-07 20:16:18 +00:00
Groverkss 49b754b5c6 [MLIR][NFC] Move presburger functionality from FlatAffineConstraints to IntegerPolyhedron
This patch moves all presburger functionality from FlatAffineConstraints to
IntegerPolyhedron. This patch is purely mechanical, it only moves and renames
functionality and tests.

This patch is part of a series of patches to move presburger functionality to
Presburger/ directory.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D116681
2022-01-08 01:22:49 +05:30
Kazu Hirata fb7cf90071 Use nullptr instead of 0 or NULL (NFC)
Identified with modernize-use-nullptr.
2022-01-07 10:17:29 -08:00
Kazu Hirata 117422c0da [ComprehensiveBufferize] Fix a warning
This patch fixes:

  mlir/lib/Dialect/Linalg/ComprehensiveBufferize/LinalgInterfaceImpl.cpp:292:12:
  error: comparison of integers of different signs: 'int' and
  'unsigned int' [-Werror,-Wsign-compare]
2022-01-07 09:25:59 -08:00
Matthias Springer 089b910abc [mlir][linalg][bufferize][NFC] Add `analyzeOp` helper function
This function runs just the analysis of Comprehensive Bufferize, but does not bufferize the IR yet.

This is in preparation of fixing CallOp bufferization. Also needed for unifying Comprehensive Bufferize and core bufferization; the new partial bufferization can simply run bufferization without an analysis.

Differential Revision: https://reviews.llvm.org/D116456
2022-01-08 01:33:41 +09:00
Matthias Springer d9184ab1a5 [mlir][linalg][bufferize][NFC] Simplify buffer API of BufferizationState
Instead of `lookupBuffer` and `getResultBuffer`, there is now a single `getBuffer` function. This simplifies the `BufferizableOpInterface` API and is less confusing to users. They could previously have called the wrong function.

Furthermore, since `getBuffer` now takes an `OpOperand &` instead of a `Value`, users can no longer accidentally use one of the previous two functions incorrectly, which would have resulted in missing buffer copies.

Differential Revision: https://reviews.llvm.org/D116455
2022-01-08 01:12:18 +09:00
Matthias Springer 8e2b6aac32 [mlir][linalg][bufferize][NFC] Analyze OpOperands instead of OpResults
With this change, the analysis takes a look at OpOperands instead of OpResults. OpOperands can bufferize out-of-place (even if they have no aliasing OpResults). The analysis does no longer care about OpResults.

Previously, only OpResults could bufferize out-of-place, so OpOperands that have no aliasing OpResults were never copied by Comprehensive Bufferize. This does not fit wwell with the new CallOp bufferization that is introduced in a subsequent change. In essence, called FuncOps can then be treated as "black boxes" that may read/write to any bbArg, even if they do not return anything.

Differential Revision: https://reviews.llvm.org/D115706
2022-01-08 01:00:30 +09:00
Kazu Hirata e56a9c9b5b Remove redundant return statements (NFC)
Identified by readability-redundant-control-flow.
2022-01-07 07:42:35 -08:00
Matthias Springer 547b9afc54 [mlir][linalg][bufferize][NFC] Add explicit inplaceable attrs to test cases
This is in preparation of fixing CallOp bufferization. Add explicit linalg.inplaceable attrs to all bbArgs, except for the ones where inplaceability should be decided by the analysis.

Differential Revision: https://reviews.llvm.org/D115840
2022-01-08 00:25:15 +09:00
Matthias Springer b8d0753694 [mlir][linalg][bufferize] Fix copy elision in `getResultBuffer`
A buffer copy may not be elided if the to-be-bufferized op is reading the data.

Differential Revision: https://reviews.llvm.org/D116454
2022-01-08 00:19:17 +09:00
gysit e3b442b62f [mlir][OpDSL] Separate `ReduceFn` and `ReduceFnUse`.
The revision distinguishes `ReduceFn` and `ReduceFnUse`. The latter has the reduction dimensions attached while the former specifies the arithmetic function only. This separation allows us to adapt the reduction syntax a little bit and specify the reduction dimensions using square brackets (in contrast to the round brackets used for the values to reduce). It als is a preparation to add reduction function attributes to OpDSL. A reduction function attribute shall only specify the arithmetic function and not the reduction dimensions.

Example:
```
ReduceFn.max_unsigned(D.kh, D.kw)(...)
```
changes to:
```
ReduceFn.max_unsigned[D.kh, D.kw](...)
```

Depends On D115240

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D115241
2022-01-07 12:51:06 +00:00
gysit cf05668c17 [mlir][OpDSL] Rename `PrimFn` to `ArithFn`.
The revision renames `PrimFn` to `ArithFn`. The name resembles the newly introduced arith dialect that implements most of the arithmetic functions. An exception are log/exp that are part of the math dialect.

Depends On D115239

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D115240
2022-01-07 12:38:03 +00:00
gysit 15757ea80a [mlir][OpDSL] Add `TypeFn` class.
This revision introduces a the `TypeFn` class that similar to the `PrimFn` class contains an extensible set of type conversion functions. Having the same mechanism for both type conversion functions and arithmetic functions improves code consistency. Additionally, having an explicit function class and function name is a prerequisite to specify a conversion or arithmetic function via attribute. In a follow up commits, we will introduce function attributes to make OpDSL operations more generic. In particular, the goal is to handle signed and unsigned computation in one operations. Today, there is a linalg.matmul and a linalg.matmul_unsigned.

The commit implements the following changes:
- Introduce the class of type conversion functions `TypeFn`
- Replace the hardwired cast and cast_unsigned ops by the `TypeFn` counterparts
- Adapt the python and C++ code generation paths to support the new cast operations

Example:
```
cast(U, A[D.m, D.k])
```
changes to
```
TypeFn.cast(U, A[D.m, D.k])
```

Depends On D115237

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D115239
2022-01-07 12:26:47 +00:00
Adrian Kuegel babad7c566 [mlir][python] Use a named object
Currently, the object would be immediately destroyed after creation.
Found by ClangTidy bugprone-unused-raii.
2022-01-07 13:22:32 +01:00
gysit 2648e2d5dd [mlir][OpDSL] Rename `AttributeDef` to `IndexAttrDef`.
Renaming `AttributeDef` to `IndexAttrDef` prepares OpDSL to support different kinds of attributes and more closely reflects the purpose of the attribute.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D115237
2022-01-07 12:09:25 +00:00
Benjamin Kramer ae29d5a484 [mlir] Provide a home for mlir::LLVM::GEPOp::kDynamicIndex
C++14 requires this and will trigger linker errors when optimizations
are disabled.
2022-01-07 12:06:04 +01:00
Adrian Kuegel 50da013406 [mlir] Use const reference for loop iteration variable. 2022-01-07 12:00:53 +01:00
Alex Zinenko f50cfc44d6 [mlir] Require struct indices in LLVM::GEPOp to be constant
Recent commits added a possibility for indices in LLVM dialect GEP operations
to be supplied directly as constant attributes to ensure they remain such until
translation to LLVM IR happens. Make this required for indexing into LLVM
struct types to match LLVM IR requirements, otherwise the translation would
assert on constructing such IR.

For better compatibility with MLIR-style operation construction interface,
allow GEP operations to be constructed programmatically using Values pointing
to known constant operations as struct indices.

Depends On D116758

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D116759
2022-01-07 09:56:05 +01:00
Alex Zinenko 43ff4a6d55 [mlir] Add ConstantLike trait to LLVM::ConstantOp
This make LLVM dialect constants to work with `m_constant` matches. Implement
the folding hook for this operation as required by the trait. This in turn
allows LLVM::ConstantOp to properly participate in constant-folding.

Depends On D116757

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D116758
2022-01-07 09:56:03 +01:00
Alex Zinenko cafaa35036 [mlir] Make it possible to directly supply constant values to LLVM GEPOp
In LLVM IR, the GEP indices that correspond to structures are required to be
i32 constants. MLIR models constants as just values defined by special
operations, and there is no verification that it is the case for structure
indices in GEP. Furthermore, some common transformations such as control flow
simplification may lead to the operands becoming non-constant. Make it possible
to directly supply constant values to LLVM GEPOp to guarantee they remain
constant until the translation to LLVM IR. This is not yet a requirement and
the verifier is not modified, this will be introduced separately.

Reviewed By: wsmoses

Differential Revision: https://reviews.llvm.org/D116757
2022-01-07 09:56:01 +01:00
William S. Moses 34646a2f7e [MLIR][Arith] Fold repeated xor and trunc
This patch adds two folds. One for a repeated xor (e.g. xor(xor(x, a), a)) and one for a repeated trunc (e.g. trunc(trunc(x))).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D116383
2022-01-07 03:36:10 -05:00
Kazu Hirata 410480e32b Ensure newlines at the end of files (NFC) 2022-01-06 23:44:02 -08:00
Shraiysh Vaishay 6bcb4c44de [mlir][OpenMP] Added omp.atomic.write lowering to LLVM IR
This patch adds omp.atomic.write lowering to LLVM IR.
Also, changed the syntax to have equal symbol instead of the comma to
make it more intuitive.

Reviewed By: kiranchandramohan, peixin

Differential Revision: https://reviews.llvm.org/D116416
2022-01-07 10:01:57 +05:30
Kazu Hirata e6075b2c2c [mlir] Fix a warning
This patch fixes:

  mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h:913:30:
  error: private field 'options' is not used
  [-Werror,-Wunused-private-field]
2022-01-06 18:41:07 -08:00
Nicolas Vasilache 07c009ed55 [mlir][Linalg] Fix invalid FailureOr construction from LogicalResult::success 2022-01-06 18:43:23 -05:00
Nicolas Vasilache 9cd7e880fd [mlir][Linalg] NFC - Modernize more transformation patterns.
Differential Revision: https://reviews.llvm.org/D116763
2022-01-06 17:40:23 -05:00
Matthias Springer 42fd68b344 [mlir][linalg][bufferize] LinalgOp: Move existing region to new op
This has two advantages.

1. It is more efficient. No need to clone the entire region.
2. Recreating ops (via cloning) invalidates analysis results. Previously, an OpResult could have bufferized out-of-place, even though the analysis requested an in-place bufferization. That is because BufferizationState keeps track of OpResults for storing bufferization analysis results (and cloned ops have new OpResults).

Differential Revision: https://reviews.llvm.org/D116453
2022-01-07 07:00:24 +09:00
Matthias Springer 698896cd6c [mlir][linalg][bufferize][NFC] Change allocationFn return type to FailureOr<Value>
In addition, all functions that call `allocationFn` now return FailureOr<Value>. This resolves a few TODOs in the code base.

Differential Revision: https://reviews.llvm.org/D116452
2022-01-07 06:33:19 +09:00
Nicolas Vasilache 4a661602ef [mlir][Linalg] NFC - Modernize APIs and get rid of unnecessary tiling paterns.
Tiling patterns can be reduced to a single pattern by using interface-based patterns.

Differential Revision: https://reviews.llvm.org/D116733
2022-01-06 16:27:35 -05:00
Matthias Springer 75d65293ca [mlir][linalg][bufferize][NFC] Clean up comments and minor code refactorings
Differential Revision: https://reviews.llvm.org/D116451
2022-01-07 06:23:01 +09:00