1897 Commits

Author SHA1 Message Date
Jakub Kuderski
f4d7586343
[mlir] Use llvm::filter_to_vector. NFC. (#117655)
This got recently added to SmallVectorExtras:
https://github.com/llvm/llvm-project/pull/117460.
2024-11-26 09:11:36 -05:00
lorenzo chelini
c9e606b9cf
[mlir] Improve doc in OpFormatGen.cpp (NFC) (#117564)
The comment is misleading because attributes do not have
`elidePrintingDefaultValue` bit. It appears that
`elidePrintingDefaultValue` was never merged upstream (see:
https://reviews.llvm.org/D135398 ), but the comment was likely
introduced by mistake in a later revision
(https://reviews.llvm.org/D135993.).
2024-11-25 17:37:42 +01:00
Théo Degioanni
2af6ddb8a2
[mlir][ods] Fix missing property elision for variadic segment properties (#115930)
This fixes a bug where variadic segment properties would not be elided
when printing `prop-dict`.
2024-11-24 10:57:08 +01:00
Matthias Springer
a0ef12c642
[mlir][LLVM] LLVMTypeConverter: Tighten materialization checks (#116532)
This commit adds extra checks to the MemRef argument materializations in
the LLVM type converter. These materializations construct a
`MemRefType`/`UnrankedMemRefType` from the unpacked elements of a MemRef
descriptor or from a bare pointer.

The extra checks ensure that the inputs to the materialization function
are correct. It is possible that a user added extra type conversion
rules that convert MemRef types in a different way and the extra checks
ensure that we construct a MemRef descriptor only if the inputs are what
we expect.

This commit also drops a check around bare pointer materializations:
```
// This is a bare pointer. We allow bare pointers only for function entry
// blocks.
```
This check should not be part of the materialization function. Whether a
MemRef block argument is converted into a MemRef descriptor or a bare
pointer is decided in the lowering pattern. At the point of time when
materialization functions are executed, we already made that decision
and we should just materialize regardless of the input format.
2024-11-24 12:20:09 +09:00
Kunwar Grover
db115ba3ef
[mlir][Linalg] Fix non-matmul linalg structured ops (#116412)
3ad0148020
broke linalg structured ops other than MatmulOp.

The patch:

- Changes the printer to hide additional attributes, which weren't
hidden before: "indexing_maps".
- Changes the build of every linalg structured op to have an indexing
map for matmul.

These changes combined, hide the problem until you print the operation
in it's generic form.

Reproducer:

```mlir
func.func public @bug(%arg0 : tensor<5x10x20xf32>, %arg1 : tensor<5x20x40xf32>, %arg3 : tensor<5x10x40xf32>) -> tensor<5x10x40xf32> {
  %out = linalg.batch_matmul ins(%arg0, %arg1 : tensor<5x10x20xf32>, tensor<5x20x40xf32>)
      outs(%arg3 : tensor<5x10x40xf32>) -> tensor<5x10x40xf32>
  func.return %out : tensor<5x10x40xf32>
}
```

Prints fine, with `mlir-opt <file>`, but if you do `mlir-opt
--mlir-print-op-generic <file>`:

```
#map = affine_map<(d0, d1, d2) -> (d0, d2)>
#map1 = affine_map<(d0, d1, d2) -> (d2, d1)>
#map2 = affine_map<(d0, d1, d2) -> (d0, d1)>
#map3 = affine_map<(d0, d1, d2, d3) -> (d0, d1, d3)>
#map4 = affine_map<(d0, d1, d2, d3) -> (d0, d3, d2)>
#map5 = affine_map<(d0, d1, d2, d3) -> (d0, d1, d2)>
"builtin.module"() ({
  "func.func"() <{function_type = (tensor<5x10x20xf32>, tensor<5x20x40xf32>, tensor<5x10x40xf32>) -> tensor<5x10x40xf32>, sym_name = "bug", sym_visibility = "public"}> ({
  ^bb0(%arg0: tensor<5x10x20xf32>, %arg1: tensor<5x20x40xf32>, %arg2: tensor<5x10x40xf32>):
    %0 = "linalg.batch_matmul"(%arg0, %arg1, %arg2) <{operandSegmentSizes = array<i32: 2, 1>}> ({
    ^bb0(%arg3: f32, %arg4: f32, %arg5: f32):
      %1 = "arith.mulf"(%arg3, %arg4) <{fastmath = #arith.fastmath<none>}> : (f32, f32) -> f32
      %2 = "arith.addf"(%arg5, %1) <{fastmath = #arith.fastmath<none>}> : (f32, f32) -> f32
      "linalg.yield"(%2) : (f32) -> ()
    }) {indexing_maps = [#map, #map1, #map2], linalg.memoized_indexing_maps = [#map3, #map4, #map5]} : (tensor<5x10x20xf32>, tensor<5x20x40xf32>, tensor<5x10x40xf32>) -> tensor<5x10x40xf32>
    "func.return"(%0) : (tensor<5x10x40xf32>) -> ()
  }) : () -> ()
}) : () -> ()
```

The batch_matmul operation's builder now always inserts a indexing_map
which is unrelated to the operation itself. This was caught when a
transformation from one LinalgStructuredOp to another, tried to pass
it's attributes to the other ops builder and there were multiple
indexing_map attributes in the result.

This patch fixes this by specializing the builders for MatmulOp with
indexing map information.
2024-11-16 08:13:10 +00:00
Andrea Faulds
0e39b1348e
[mlir] Remove the mlir-spirv-cpu-runner (move to mlir-cpu-runner) (#114563)
This commit builds on and completes the work done in
9f6c632ecda08bfff76b798c46d5d7cfde57b5e9 to eliminate the need for a
separate mlir-spirv-cpu-runner binary. Since the MLIR processing is
already done outside this runner, the only real difference between it
and the mlir-cpu-runner is the final linking step between the nested
LLVM IR modules. By moving this step into mlir-cpu-runner behind a new
command-line flag (`--link-nested-modules`), this commit is able to
completely remove the runner component of the mlir-spirv-cpu-runner.

The runtime libraries and the tests are moved and renamed to fit into
the Execution Engine and Integration tests, following the model of the
similar migration done for the CUDA Runner in D97463.
2024-11-08 08:01:52 -05:00
Md Asghar Ahmad Shahid
3ad0148020
[MLIR][Linalg] Re-land linalg.matmul move to ODS. + Remove/update failing obsolete OpDSL tests. (#115319)
The earlier PR(https://github.com/llvm/llvm-project/pull/104783) which
introduces
transpose and broadcast semantic to linalg.matmul was reverted due to
two failing
OpDSL test for linalg.matmul.

Since linalg.matmul is now defined using TableGen ODS instead of
Python-based OpDSL,
these test started failing and needs to be removed/updated.

This commit removes/updates the failing obsolete tests from below files.
All other files
were part of earlier PR and just cherry picked.
    "mlir/test/python/integration/dialects/linalg/opsrun.py"
    "mlir/test/python/integration/dialects/transform.py"

---------

Co-authored-by: Renato Golin <rengolin@systemcall.eu>
2024-11-07 14:51:02 +00:00
Haojian Wu
790cbee34d
[MLIR] Fix a stack-use-after-scope error in OpFormatGen.cpp (#114789) 2024-11-04 14:37:59 +01:00
Adrian Kuegel
bdfadb16d7 [mlir] Apply ClangTidy findings
Remove unused using declarations
2024-11-04 07:06:59 +00:00
Peter Hawkins
51a4f319f0
[mlir:python] Avoid calls to get_op_result_or_results in generated value wrappers (#114491)
If we know the output arity at tablegen time, we can often just call
.result or .results directly.

This saves almost 1s in a JAX-based LLM benchmark building a mixture of
upstream dialects and StableHLO.
2024-11-01 00:54:20 +01:00
Jessica Clarke
9467645547
[CodeGen] Rename MVT::iPTRAny to MVT::pAny
Whilst in upstream LLVM iPTRAny is only ever an integer, essentially an
alias for iPTR, this is not true in CHERI LLVM, where it gets used to
mean "iPTR or cPTR", i.e. either an integer address or a capability
(with cPTR and cN being the capability equivalents of iPTR and iN).
Moreover, iPTRAny is already not itself regarded as an integer (calling
isInteger() will give false), so the "i" prefix is misleading, and it
stands out as different from all the other xAny that have a single
letter prefix denoting their type.

Thus, rename it to pAny, reflecting that it is an overloaded pointer
type, which could end up being specialised to an integer type, but does
not have to be.

This has been verified to have no effect on the generated files for LLVM
itself or any in-tree target beyond the replacement of the identifier
iPTRAny with pAny in GenVT.inc.

Reviewers: arsenm

Reviewed By: arsenm

Pull Request: https://github.com/llvm/llvm-project/pull/113733
2024-10-30 03:27:48 +00:00
Andrea Faulds
9f6c632ecd
[mlir][mlir-spirv-cpu-runner] Move MLIR pass pipeline to mlir-opt (#113594)
Adds a new mlir-opt test-only pass, -test-spirv-cpu-runner-pipeline,
which runs the set of MLIR passes needed for the mlir-spirv-cpu-runner,
and removes them from the runner. The tests are changed to invoke
mlir-opt with this flag before running the runner. The eventual goal is
to move all host/device code generation steps out of the runner, like
with some of the other runners.

Recommit of 17e9752267ed9c81c8da87f3a6d0e01f130b0d04. It was reverted
due to a build failure, but the build failure had in fact already been
fixed in e7302319b52e3d231216d54d10622b0698928a96.
2024-10-25 07:21:59 -07:00
Adrian Kuegel
7e61d89373 [mlir] Apply ClangTidy performance finding
loop variable is copied but only used as const reference
2024-10-24 12:32:49 +00:00
Rahul Joshi
743f839a88
[NFC][LLVM][TableGen] Change RecordKeeper::getClass to return const pointer (#112261)
Change `RecordKeeper::getClass` to return const record pointer. This is
a part of effort to have better const correctness in TableGen backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-10-23 11:32:05 -07:00
Nikolay Panchenko
076d3e2326
[mlir][ods] Verify access to operands in inferReturnTypes (#112574)
The patch adds graceful handling of incorrectly constructed MLIR
operation with less operands than expected.
2024-10-23 00:20:53 -04:00
lorenzo chelini
34d4f660fe
[mlir] Fix the emission of prop-dict when operations have no properties (#112851)
When an operation has no properties, no property struct is emitted. To avoid a compilation error, we should also skip emitting `setPropertiesFromParsedAttr`, `parseProperties` and `printProperties` in such cases.
    
Compilation error:
    
```
    error: ‘Properties’ has not been declared
      static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
    
```
2024-10-21 13:43:55 -07:00
Jakub Kuderski
17e9752267
Revert "[mlir][mlir-spirv-cpu-runner] Move MLIR pass pipeline to mlir-opt" (#113176)
Reverts llvm/llvm-project#111575

This caused build failures:
https://lab.llvm.org/buildbot/#/builders/138/builds/5244
2024-10-21 08:10:22 -07:00
Andrea Faulds
f0312d962d
[mlir][mlir-spirv-cpu-runner] Move MLIR pass pipeline to mlir-opt (#111575)
Adds a new mlir-opt test-only pass, -test-spirv-cpu-runner-pipeline,
which runs the set of MLIR passes needed for the mlir-spirv-cpu-runner,
and removes them from the runner. The tests are changed to invoke
mlir-opt with this flag before running the runner. The eventual goal is
to move all host/device code generation steps out of the runner, like
with some of the other runners.
2024-10-21 06:55:40 -07:00
Longsheng Mou
0a6def62c2
[mlir][doc] Emit \n if description not end with \n. (#112898)
This PR addresses a markdown formatting issue by ensuring a `\n` is
emitted if the description string does not already end with one. Fixes
#112672.
2024-10-19 10:17:44 +08:00
Rahul Joshi
62e2c7fb2d
[LLVM][TableGen] Change all Init pointers to const (#112705)
This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-10-18 07:50:22 -07:00
Harrison Hao
eb446eb4f7
[MLIR][BUILD] Fix Unicode build issue on Windows. (#112300)
This issue is from https://github.com/llvm/llvm-project/pull/77668. I
encountered a build issue because it used Unicode. When I built MLIR on
Windows with Visual Studio 2022, I faced a build failure.

---------

Co-authored-by: Harrison Hao <harrison.hao@amd.com>
2024-10-18 14:34:33 +08:00
Matthias Springer
36d936a2d0
[mlir][IR] Improve error message when return type could not be inferred (#112336)
Print an error such as the following one before terminating program
execution.
```
mlir/test/Dialect/SparseTensor/convert_dense2sparse.mlir:26:8: remark: location of op
  %0 = sparse_tensor.convert %arg0 : tensor<?xi32> to tensor<?xi32, #SparseVector>
       ^
LLVM ERROR: Failed to infer result type(s):
"sparse_tensor.positions"(...) {} : (index) -> ( ??? )

(stack trace follows)
```
2024-10-16 21:04:11 +02:00
Rahul Joshi
e768b076e3
[MLIR][TableGen] Use const pointers for various Init objects (#112562)
This reverts commit 0eed3055511381436ee69d1caf64a4af47f8d65c and applies
additional fixes in `verifyArgument` in OmpOpGen.cpp for gcc-7 bot
failures
2024-10-16 11:46:38 -07:00
Mehdi Amini
0eed305551
Revert "[MLIR][TableGen] Use const pointers for various Init objects" (#112506)
Reverts llvm/llvm-project#112316

Bots are failing.
2024-10-16 11:09:17 +02:00
Matthias Springer
9aef0fd52a
[mlir][tblgen] Add additional constructor to Adaptor class (#112144)
Add an additional adaptor constructor that copies everything except for
the values. The values are provided with by a second parameter.

This commit is in preparation of merging the 1:1 and 1:N dialect
conversions. As part of that, a new `matchAndRewrite` function is added.
For details, see this RFC:
https://discourse.llvm.org/t/rfc-merging-1-1-and-1-n-dialect-conversions/82513

```c++
template <typename SourceOp>
class OpConversionPattern : public ConversionPattern {
 public:
  using OneToNOpAdaptor =
      typename SourceOp::template GenericAdaptor<ArrayRef<ArrayRef<Value>>>;

  virtual LogicalResult
  matchAndRewrite(SourceOp op, OneToNOpAdaptor adaptor,
                  ConversionPatternRewriter &rewriter) const {
    SmallVector<Value> oneToOneOperands =
        getOneToOneAdaptorOperands(adaptor.getOperands());

    // This OpAdaptor constructor is added by this commit.
    return matchAndRewrite(op, OpAdaptor(oneToOneOperands, adaptor), rewriter);
  }
};
```
2024-10-15 08:52:54 +02:00
Rahul Joshi
1ae9fe5ea0
[MLIR][TableGen] Use const pointers for various Init objects (#112316)
Use const pointers for various `Init` objects. This is a part of effort
to have better const correctness in TableGen backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-10-14 23:48:12 -07:00
Jacques Pienaar
4c25a538d3
[mlir] Start rewrite tool (#77668)
Initial commit of a tool to help in textual rewrites of .mlir files.
This tool builds of of AsmParserState and is rather simple. Took some
inspiration from when I used clang's AST rewrites where I'd often treat
it as a "localizing" regex applicator in fallback cases, and started
with that as functionality. There though, one does have access to the
lower level info than here, but still a step up over sed over entire
file.

This aims to be helpful (e.g., rewrite syntax including best effort
inside comments) rather than bulletproof tool. It may even be better
suited under utils than tools. And most of the rewrites would be rather
short lived and might never make it upstream (while the helpers of those
rewrites may for future rewrites).

The layering at the moment is not ideal as it is reusing the
RewriteBuffer class from clang's rewrite engine. So only optionally
enabling where clang is also enable. There doesn't seem to be anything
clang specific there (the dep does pull in more dependencies than ideal,
but leaving both refactorings).

Additionally started it as a single file to prototype more easily,
planning to refactor later to include and libs for out of file usage.
2024-10-12 15:10:34 -07:00
Emilio Cota
1276ce9e97 Revert "[mlir][linalg] Introduce transpose semantic to 'linalg.matmul' ops. (#104783)"
This reverts commit 03483737a7a2d72a257a5ab6ff01748ad9cf0f75 and
99c8557, which is a fix-up on top of the former.

I'm reverting because this commit broke two tests:
  mlir/test/python/integration/dialects/linalg/opsrun.py
  mlir/test/python/integration/dialects/transform.py
See https://lab.llvm.org/buildbot/#/builders/138/builds/4872

I'm not familiar with the tests, so I'm leaving it to the original author
to either remove or adapt the broken tests, as discussed here:
  https://github.com/llvm/llvm-project/pull/104783#issuecomment-2406390905
2024-10-11 05:22:56 -04:00
Md Asghar Ahmad Shahid
03483737a7
[mlir][linalg] Introduce transpose semantic to 'linalg.matmul' ops. (#104783)
The main goal of this patch is to extend the semantic of 'linalg.matmul'
named op to include per operand transpose semantic while also laying out
a way to move ops definition from OpDSL to tablegen. Hence, it is
implemented in tablegen. Transpose semantic is as follows.

By default 'linalg.matmul' behavior will remain as is. Transpose
semantics can be appiled on per input operand by specifying the optional
permutation attributes (namely 'permutationA' for 1st input and
'permutationB' for 2nd input) for each operand explicitly as needed. By
default, no transpose is mandated for any of the input operand.

    Example:
    ```
%val = linalg.matmul ins(%arg0, %arg1 : memref<5x3xf32>,
memref<5x7xf32>)
              outs(%arg2: memref<3x7xf32>)
              permutationA = [1, 0]
              permutationB = [0, 1]
    ```
2024-10-10 17:00:58 +01:00
Rahul Joshi
e813750354
[NFC] Rename variable recordKeeper to records (#110989) 2024-10-03 06:30:31 -07:00
Alex Rice
5762bd60d6
[mlir] [tblgen-to-irdl] Add region support (#110512)
Adds support to exporting regions.
2024-10-03 01:26:52 +01:00
Rahul Joshi
bccd37f69f
[NFC][MLIR][TableGen] Eliminate llvm:: for commonly used types (#110841)
Eliminate `llvm::` namespace qualifier for commonly used types in MLIR
TableGen backends to reduce code clutter.
2024-10-02 13:23:44 -07:00
Rahul Joshi
d256b9e88b
[TableGen] Change DefInit::Def to a const Record pointer (#110747)
This change undoes a const_cast<> introduced in an earlier change to
help transition to const pointers. It is a part of effort to have better
const correctness in TableGen backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-10-02 09:48:26 -07:00
Rahul Joshi
a140931be5
[TableGen] Change getValueAsListOfDefs to return const pointer vector (#110713)
Change `getValueAsListOfDefs` to return a vector of const Record
pointer, and remove `getValueAsListOfConstDefs` that was added as a
transition aid.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-10-01 14:30:38 -07:00
Rahul Joshi
a5dfcccd58
[MLIR][TableGen] Change MLIR TableGen to use const Record * (#110687)
This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-10-01 09:54:11 -07:00
Nikhil Kalra
fef3566a25
[mlir] Pass Options ownership modifications (#110582)
This change makes two (related) changes: 

First, it updates the tablegen option for `ListOption` to emit a
`SmallVector` instead of an `ArrayRef`. This brings `ListOption` more
inline with the traditional `Option`, where values are typically
provided using types that have storage. After this change, all options
should be fully owned by a Pass' `Options` object after it has been
fully constructed, unless the underlying type of the `Option` explicitly
indicates otherwise.

Second, it updates the generated constructors for Passes to consume
options by value instead of reference, and prefers moving options into
the pass itself. This should be more efficient for non-trivial options
objects, where the previous interface forced a copy to be materialized.
Now, at worst case the API materializes a copy (no worse than before);
at best-case, all options objects are moved into place. Ideally, we
could update the Pass constructor to take an r-value reference to the
Options object instead, but this approach will require numerous changes
to existing passes and their factory functions.

---------

Authored-by: Nikhil Kalra <nkalra@apple.com>
2024-10-01 09:48:51 -07:00
Rahul Joshi
fcb5905ea4
[MLIR][TableGen] Minor code cleanup in DirectiveCommonGen (#110290)
Directly Use Clause/ClauseVal as loop iterator.
Use llvm::transform instead of std::transform.
Use interleaveComma() to generate comma separated list.
2024-09-30 10:11:17 -07:00
Rahul Joshi
7ac474baad
[LLVM][TableGen] Change SeachableTableEmitter to use const RecordKeeper (#110032)
Change SeachableTableEmitter to use const RecordKeeper.
Also change RecordRecTy to use const Record pointers for its classes.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-30 10:08:48 -07:00
Alex Rice
159470def9
[mlir] [tblgen-to-irdl] Add attributes to tblgen-to-irdl script (#109633)
Adds the ability to export attributes from the dialect and attributes of
operations in the dialect
2024-09-28 00:51:51 +01:00
Youngsuk Kim
123e8c735d [mlir] Don't call llvm::raw_string_ostream::flush() (NFC)
Don't call raw_string_ostream::flush(), which is essentially a no-op.
As specified in the docs, raw_string_ostream is always unbuffered.
( 65b13610a5226b84889b923bae884ba395ad084d for further reference )
2024-09-22 15:37:34 -05:00
Alex Rice
04575dce43
[mlir] [tblgen-to-irdl] Add types to tblgen-to-irdl script (#108558)
Adds dialect types to the tblgen-to-irdl script and also allows
operations to refer to types by symbol, when possible, and updates tests
to do this.

The name of the type is exported with an exclamation mark to avoid name
clashes.
2024-09-17 23:03:54 +01:00
JOE1994
ffc80de864 [mlir] Nits on uses of llvm::raw_string_ostream (NFC)
* Don't call raw_string_ostream::flush(), which is essentially a no-op
* Strip unneeded calls to raw_string_ostream::str(), to avoid excess indirection.
2024-09-15 21:06:32 -04:00
Sergio Afonso
6568062ff1
[MLIR][OpenMP] Improve assemblyFormat handling for clause-based ops (#108023)
This patch modifies the representation of `OpenMP_Clause` to allow
definitions to incorporate both required and optional arguments while
still allowing operations including them and overriding the
`assemblyFormat` to take advantage of automatically-populated format
strings.

The proposed approach is to split the `assemblyFormat` clause property
into `reqAssemblyFormat` and `optAssemblyFormat`, and remove the
`isRequired` template and associated `required` property. The
`OpenMP_Op` class, in turn, populates the new `clausesReqAssemblyFormat`
and `clausesOptAssemblyFormat` properties in addition to
`clausesAssemblyFormat`. These properties can be used by clause-based
OpenMP operation definitions to reconstruct parts of the
clause-inherited format string in a more flexible way when overriding
it.

Clause definitions are updated to follow this new approach and some
operation definitions overriding the `assemblyFormat` are simplified by
taking advantage of the improved flexibility, reducing code duplication.
The `verify-openmp-ops` tablegen pass is updated for the new
`OpenMP_Clause` representation.

Some MLIR and Flang unit tests had to be updated due to changes to the
default printing order of clauses on updated operations.
2024-09-13 12:57:41 +01:00
Alex Rice
135bd31975
[mlir] [tblgen-to-irdl] Refactor tblgen-to-irdl script and support more types (#105505)
Refactors the tblgen-to-irdl script slightly and adds support for
- Various integer types
- Various Float types
- Confined types
- Complex types (with fixed element type)

Also doesn't add the operand and result ops if they are empty.

I could potentially split this into smaller PRs if that'd be helpful
(refactor + integer/float/complex, confined type, optional
operand/result).

@math-fehr
2024-09-11 14:02:44 +01:00
Jie Fu
0856f12bb0 [mlir] Fix -Wunused-variable in OmpOpGen.cpp (NFC)
/llvm-project/mlir/tools/mlir-tblgen/OmpOpGen.cpp:239:8:
error: unused variable 'isAttr' [-Werror,-Wunused-variable]
  bool isAttr = superClasses.contains("Attr");
       ^
2024-09-11 19:59:00 +08:00
Jie Fu
b35bb7b797 [mlir] Fix 'StringSet' may not intend to support class template argument deduction (NFC)
/llvm-project/mlir/tools/mlir-tblgen/OmpOpGen.cpp:202:3:
error: 'StringSet' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
  llvm::StringSet superClasses;
  ^
/llvm-project/llvm/include/llvm/ADT/StringSet.h:23:7: note: add a deduction guide to suppress this warning
class StringSet : public StringMap<std::nullopt_t, AllocatorTy> {
      ^
2024-09-11 19:46:26 +08:00
Sergio Afonso
2f3d061918
[MLIR][OpenMP] Automate operand structure definition (#99508)
This patch adds the "gen-openmp-clause-ops" `mlir-tblgen` generator to
produce the structure definitions previously in OpenMPClauseOperands.h
automatically from the information contained in OpenMPOps.td and
OpenMPClauses.td.

The original header is maintained to enable the definition of similar
structures that are not directly related to any single `OpenMP_Clause`
or `OpenMP_Op` tablegen definition.
2024-09-11 12:16:34 +01:00
Kunwar Grover
c9aa55da62
[mlir][Linalg] Add speculation for LinalgStructuredOps (#108032)
This patch adds speculation behavior for linalg structured ops, allowing
them to be hoisted out of loops using LICM.
2024-09-11 09:30:05 +01:00
Amy Wang
6634d44e5e
[MLIR][Transform] Allow stateInitializer and stateExporter for applyTransforms (#101186)
This is discussed in RFC:

https://discourse.llvm.org/t/rfc-making-the-constructor-of-the-transformstate-class-protected/80377
2024-09-09 10:57:13 -04:00
Rahul Joshi
b60c6cbc0b
[MLIR][TableGen] Migrate MLIR backends to use const RecordKeeper (#107505)
- Migrate MLIR backends to use a const RecordKeeper reference.
2024-09-07 15:13:19 -07:00