llvm-project/mlir/test/Dialect/Linalg/transform-ops-invalid.mlir
Alex Zinenko 5cde5a5739 [mlir] add interchange, pad and scalarize to structured transform dialect
Add ops to the structured transform extension of the transform dialect that
perform interchange, padding and scalarization on structured ops. Along with
tiling that is already defined, this provides a minimal set of transformations
necessary to build vectorizable code for a single structured op.

Define two helper traits: one that implements TransformOpInterface by applying
a function to each payload op independently and another that provides a simple
"functional-style" producer/consumer list of memory effects for the transform
ops.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D126374
2022-05-30 11:42:40 +02:00

40 lines
1.1 KiB
MLIR

// RUN: mlir-opt %s --split-input-file --verify-diagnostics
transform.sequence {
^bb0(%arg0: !pdl.operation):
// expected-error@below {{expects iterator_interchange to be a permutation, found [1, 1]}}
transform.structured.interchange %arg0 {iterator_interchange = [1, 1]}
}
// -----
transform.sequence {
^bb0(%arg0: !pdl.operation):
// expected-error@below {{expects padding_dimensions to contain positive integers, found [1, -7]}}
transform.structured.pad %arg0 {padding_dimensions=[1, -7]}
}
// -----
transform.sequence {
^bb0(%arg0: !pdl.operation):
// expected-error@below {{expects pack_paddings to contain booleans (0/1), found [1, 7]}}
transform.structured.pad %arg0 {pack_paddings=[1, 7]}
}
// -----
transform.sequence {
^bb0(%arg0: !pdl.operation):
// expected-error@below {{expects hoist_paddings to contain positive integers, found [1, -7]}}
transform.structured.pad %arg0 {hoist_paddings=[1, -7]}
}
// -----
transform.sequence {
^bb0(%arg0: !pdl.operation):
// expected-error@below {{expects transpose_paddings to be a permutation, found [1, 1]}}
transform.structured.pad %arg0 {transpose_paddings=[[1, 1]]}
}