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
32 lines
978 B
MLIR
32 lines
978 B
MLIR
// RUN: mlir-opt %s | mlir-opt | FileCheck %s
|
|
|
|
transform.sequence {
|
|
^bb1(%arg0: !pdl.operation):
|
|
// CHECK %{{.*}}, %{{.*}}:2 = transform.structured.tile
|
|
%0, %1:2 = transform.structured.tile %arg0 { sizes = [2, 0, 3] }
|
|
}
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Check that operations are registered correctly through the extension
|
|
// mechanism. Their syntax is generated and requries no additional testing since
|
|
// we test the generator.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
transform.sequence {
|
|
^bb1(%arg0: !pdl.operation):
|
|
// CHECK: transform.structured.pad
|
|
%0 = transform.structured.pad %arg0
|
|
}
|
|
|
|
transform.sequence {
|
|
^bb1(%arg0: !pdl.operation):
|
|
// CHECK: transform.structured.interchange
|
|
%0 = transform.structured.interchange %arg0
|
|
}
|
|
|
|
transform.sequence {
|
|
^bb1(%arg0: !pdl.operation):
|
|
// CHECK: transform.structured.scalarize
|
|
%0 = transform.structured.scalarize %arg0
|
|
}
|