Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class LinalgStructuredBase_Op<string mnemonic, list<Trait> props>
SingleBlockImplicitTerminator<"YieldOp">,
DeclareOpInterfaceMethods<MemoryEffectsOpInterface>,
DeclareOpInterfaceMethods<ConditionallySpeculatable>,
RecursiveMemoryEffects,
DestinationStyleOpInterface,
LinalgStructuredInterface,
ReifyRankedShapedTypeOpInterface], props)> {
Expand Down
17 changes: 17 additions & 0 deletions mlir/test/Dialect/Linalg/canonicalize.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -1232,3 +1232,20 @@ func.func @transpose_buffer(%input: memref<?xf32>,
// CHECK-SAME: %[[VAL_1:.*]]: memref<?xf32>) {
// CHECK: linalg.transpose ins(%[[VAL_0]] : memref<?xf32>)
// CHECK-SAME: outs(%[[VAL_1]] : memref<?xf32>) permutation = [0]

// -----

// This test checks linalg op has a recursive memory effect. Otherwise
// linalg.map without a user would be DCEd.
func.func @recursive_effect(%arg : tensor<1xf32>) {
%init = arith.constant dense<0.0> : tensor<1xf32>
%mapped = linalg.map ins(%arg:tensor<1xf32>) outs(%init :tensor<1xf32>)
(%in : f32) {
vector.print %in : f32
linalg.yield %in : f32
}
func.return
}

// CHECK-LABEL: @recursive_effect
// CHECK: linalg.map
Loading