diff --git a/mlir/docs/Interfaces.md b/mlir/docs/Interfaces.md --- a/mlir/docs/Interfaces.md +++ b/mlir/docs/Interfaces.md @@ -118,7 +118,7 @@ implemented. As an example, many analyses and transformations want to reason about the side effects of an operation to improve performance and correctness. The side effects of an operation are generally tied to the semantics of a -specific operation, for example an `affine.load` operation has a `write` effect +specific operation, for example an `affine.load` operation has a `read` effect (as the name may suggest). These interfaces are defined by overriding the diff --git a/mlir/include/mlir/Dialect/GPU/GPUOps.td b/mlir/include/mlir/Dialect/GPU/GPUOps.td --- a/mlir/include/mlir/Dialect/GPU/GPUOps.td +++ b/mlir/include/mlir/Dialect/GPU/GPUOps.td @@ -806,8 +806,7 @@ def GPU_AllocOp : GPU_Op<"alloc", [ GPU_AsyncOpInterface, - AttrSizedOperandSegments, - MemoryEffects<[MemAlloc]> + AttrSizedOperandSegments ]> { let summary = "GPU memory allocation operation."; @@ -831,7 +830,7 @@ let arguments = (ins Variadic:$asyncDependencies, Variadic:$dynamicSizes, Variadic:$symbolOperands); - let results = (outs Res]>:$memref, + let results = (outs Res:$memref, Optional:$asyncToken); let extraClassDeclaration = [{ @@ -844,9 +843,7 @@ }]; } -def GPU_DeallocOp : GPU_Op<"dealloc", [ - GPU_AsyncOpInterface, MemoryEffects<[MemFree]> - ]> { +def GPU_DeallocOp : GPU_Op<"dealloc", [GPU_AsyncOpInterface]> { let summary = "GPU memory deallocation operation"; @@ -879,9 +876,7 @@ }]; } -def GPU_MemcpyOp : GPU_Op<"memcpy", [ - GPU_AsyncOpInterface, MemoryEffects<[MemRead, MemWrite]> - ]> { +def GPU_MemcpyOp : GPU_Op<"memcpy", [GPU_AsyncOpInterface]> { let summary = "GPU memcpy operation"; diff --git a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td --- a/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td +++ b/mlir/include/mlir/Dialect/StandardOps/IR/Ops.td @@ -170,7 +170,6 @@ list traits = []> : Std_Op]>, AttrSizedOperandSegments ], traits)> { @@ -1507,8 +1506,7 @@ // DeallocOp //===----------------------------------------------------------------------===// -def DeallocOp : Std_Op<"dealloc", - [MemoryEffects<[MemFree]>, MemRefsNormalizable]> { +def DeallocOp : Std_Op<"dealloc", [MemRefsNormalizable]> { let summary = "memory deallocation operation"; let description = [{ The `dealloc` operation frees the region of memory referenced by a memref diff --git a/mlir/test/Dialect/Linalg/sparse_1d.mlir b/mlir/test/Dialect/Linalg/sparse_1d.mlir --- a/mlir/test/Dialect/Linalg/sparse_1d.mlir +++ b/mlir/test/Dialect/Linalg/sparse_1d.mlir @@ -863,7 +863,6 @@ // CHECK: %[[VAL_3:.*]] = constant 0 : index // CHECK: %[[VAL_4:.*]] = constant 1 : index // CHECK: %[[VAL_5:.*]] = alloca(%[[VAL_2]]) : memref -// CHECK: %[[VAL_6:.*]] = alloca(%[[VAL_2]]) : memref // CHECK: %[[VAL_7:.*]] = alloca(%[[VAL_2]]) : memref // CHECK: %[[VAL_8:.*]] = alloca() : memref // CHECK: %[[VAL_9:.*]] = load %[[VAL_5]]{{\[}}%[[VAL_3]]] : memref diff --git a/mlir/test/Dialect/Linalg/sparse_2d.mlir b/mlir/test/Dialect/Linalg/sparse_2d.mlir --- a/mlir/test/Dialect/Linalg/sparse_2d.mlir +++ b/mlir/test/Dialect/Linalg/sparse_2d.mlir @@ -1091,7 +1091,6 @@ // CHECK: %[[VAL_4:.*]] = constant 0 : index // CHECK: %[[VAL_5:.*]] = constant 1 : index // CHECK: %[[VAL_6:.*]] = alloca(%[[VAL_2]]) : memref -// CHECK: %[[VAL_7:.*]] = alloca(%[[VAL_2]]) : memref // CHECK: %[[VAL_8:.*]] = alloca(%[[VAL_2]]) : memref // CHECK: %[[VAL_9:.*]] = alloca() : memref // CHECK: scf.for %[[VAL_10:.*]] = %[[VAL_4]] to %[[VAL_3]] step %[[VAL_5]] { diff --git a/mlir/test/Dialect/Linalg/sparse_3d.mlir b/mlir/test/Dialect/Linalg/sparse_3d.mlir --- a/mlir/test/Dialect/Linalg/sparse_3d.mlir +++ b/mlir/test/Dialect/Linalg/sparse_3d.mlir @@ -1260,11 +1260,8 @@ // CHECK: %[[VAL_3:.*]] = constant 0 : index // CHECK: %[[VAL_4:.*]] = constant 1 : index // CHECK: %[[VAL_5:.*]] = alloca(%[[VAL_2]]) : memref -// CHECK: %[[VAL_6:.*]] = alloca(%[[VAL_2]]) : memref // CHECK: %[[VAL_7:.*]] = alloca(%[[VAL_2]]) : memref -// CHECK: %[[VAL_8:.*]] = alloca(%[[VAL_2]]) : memref // CHECK: %[[VAL_9:.*]] = alloca(%[[VAL_2]]) : memref -// CHECK: %[[VAL_10:.*]] = alloca(%[[VAL_2]]) : memref // CHECK: %[[VAL_11:.*]] = alloca(%[[VAL_2]]) : memref // CHECK: %[[VAL_12:.*]] = alloca() : memref // CHECK: %[[VAL_13:.*]] = load %[[VAL_5]]{{\[}}%[[VAL_3]]] : memref diff --git a/mlir/test/Transforms/canonicalize.mlir b/mlir/test/Transforms/canonicalize.mlir --- a/mlir/test/Transforms/canonicalize.mlir +++ b/mlir/test/Transforms/canonicalize.mlir @@ -415,7 +415,7 @@ } // CHECK-LABEL: func @dyn_shape_fold(%arg0: index, %arg1: index) -func @dyn_shape_fold(%L : index, %M : index) -> (memref, memref) { +func @dyn_shape_fold(%L : index, %M : index) -> (memref, memref, memref<4 x ? x 8 x ? x ? x f32>) { // CHECK: %c0 = constant 0 : index %zero = constant 0 : index // The constants below disappear after they propagate into shapes. @@ -449,7 +449,7 @@ } } - return %c, %d : memref, memref + return %c, %d, %e : memref, memref, memref<4 x ? x 8 x ? x ? x f32> } #map1 = affine_map<(d0, d1)[s0, s1, s2] -> (d0 * s1 + s0 + d1 * s2)>