llvm-project/mlir/tools
Lei Zhang 4c640e49c9 [mlir][linalg] Verify indexing map required attributes
Indexing maps for named ops can reference attributes so that
we can synthesize the indexing map dynamically. This supports
cases like strides for convolution ops. However, it does cause
an issue: now the indexing_maps() function call is dependent
on those attributes.

Linalg ops inherit LinalgOpInterfaceTraits, which calls
verifyStructuredOpInterface() to verify the interface.
verifyStructuredOpInterface() further calls indexing_maps().
Note that trait verification is done before the op itself,
where ODS generates the verification for those attributes.
So we can have indexing_maps() referencing non-existing or
invalid attribute, before the ODS-generated verification
kick in.

There isn't a dependency handling mechansim for traits.
This commit adds new interface methods to query whether an
op hasDynamicIndexingMaps() and then perform
verifyIndexingMapRequiredAttributes() in
verifyStructuredOpInterface() to handle the dependency issue.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D96297
2021-02-09 08:48:29 -05:00
..
mlir-cpu-runner [mlir] Make mlir-cpu-runner depend on native instead of X86 2020-11-30 15:11:34 +00:00
mlir-cuda-runner [mlir] Add gpu async integration test. 2021-02-03 21:45:23 +01:00
mlir-linalg-ods-gen [mlir][linalg] Verify indexing map required attributes 2021-02-09 08:48:29 -05:00
mlir-opt [mlir][Linalg] Enable TileAndFusePattern to work with tensors. 2021-01-28 14:13:01 -08:00
mlir-reduce [mlir] Fix missing namespaces in OpBuildGen.cpp 2020-11-05 18:11:01 +01:00
mlir-rocm-runner Set GPU context before {cu,hip}MemHostRegister. 2021-02-03 20:00:36 +01: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][spirv] NFC: rename SPIR-V conversion files for consistency 2020-12-23 14:36:46 -05:00
mlir-tblgen Revert "Revert "Reorder MLIRContext location in BuiltinAttributes.h"" 2021-02-08 10:39:58 +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] Mark LogicalResult as LLVM_NODISCARD 2021-02-04 15:10:10 -08:00
CMakeLists.txt [mlir] Fix cross-compilation (Linalg ODS gen) 2021-01-18 11:57:55 +01:00