llvm-project/mlir/tools
Lei Zhang cb395f66ac [mlir][spirv] Change the return type for {Min|Max}VersionBase
For synthesizing an op's implementation of the generated interface
from {Min|Max}Version, we need to define an `initializer` and
`mergeAction`. The `initializer` specifies the initial version,
and `mergeAction` specifies how version specifications from
different parts of the op should be merged to generate a final
version requirements.

Previously we use the specified version enum as the type for both
the initializer and thus the final return type. This means we need
to perform `static_cast` over some hopefully not used number (`~0u`)
as the initializer. This is quite opaque and sort of not guaranteed
to work. Also, there are ops that have an enum attribute where some
values declare version requirements (e.g., enumerant `B` requires
v1.1+) but some not (e.g., enumerant `A` requires nothing). Then a
concrete op instance with `A` will still declare it implements the
version interface (because interface implementation is static for
an op) but actually theirs no requirements for version.

So this commit changes to use an more explicit `llvm::Optional`
to wrap around the returned version enum.  This should make it
more clear.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D108312
2021-11-24 17:33:01 -05:00
..
mlir-cpu-runner [mlir][Standard] NFC - Drop remaining EDSC usage 2021-05-21 10:40:39 +00:00
mlir-linalg-ods-gen [mlir][NFC] Replace references to Identifier with StringAttr 2021-11-16 17:36:26 +00:00
mlir-lsp-server [mlir][Standard] NFC - Drop remaining EDSC usage 2021-05-21 10:40:39 +00:00
mlir-opt [mlir][spirv] Change the return type for {Min|Max}VersionBase 2021-11-24 17:33:01 -05:00
mlir-reduce [MLIR] Move TestDialect to ::test namespace 2021-08-14 13:24:41 -07:00
mlir-shlib [MLIR] Reapply: Adjust libMLIR building to more closely follow libClang 2020-05-04 20:47:57 -07:00
mlir-spirv-cpu-runner [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
mlir-tblgen [mlir] Fully qualify default generated type/attribute printer and parser 2021-11-18 20:24:00 +01:00
mlir-translate Revert "[RFC] Factor out repetitive cmake patterns for llvm-style projects" 2020-10-04 15:17:34 -07:00
mlir-vulkan-runner [MLIR] Replace std ops with arith dialect ops 2021-10-13 03:07:03 +00:00
CMakeLists.txt [mlir][mlir-lsp] Add a new C++ LSP server for MLIR named mlir-lsp-server 2021-04-21 14:44:37 -07:00