Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Transforms/buffer-placement-preparation.mlir
Show First 20 Lines • Show All 193 Lines • ▼ Show 20 Lines | |||||
// CHECK-NEXT: %[[ALLOC6:.*]] = alloc() | // CHECK-NEXT: %[[ALLOC6:.*]] = alloc() | ||||
// CHECK-NEXT: linalg.generic {{.*}} %[[ARG0]], %[[ALLOC6]] | // CHECK-NEXT: linalg.generic {{.*}} %[[ARG0]], %[[ALLOC6]] | ||||
// CHECK: %[[ALLOC7:.*]] = alloc() | // CHECK: %[[ALLOC7:.*]] = alloc() | ||||
// CHECK-NEXT: linalg.generic {{.*}} %[[ALLOC6]], %[[ALLOC7]] | // CHECK-NEXT: linalg.generic {{.*}} %[[ALLOC6]], %[[ALLOC7]] | ||||
// ----- | // ----- | ||||
// Test case: Checking BufferAssignmentCallOpConverter and | // Test case: Checking BufferAssignmentCallOpConverter and | ||||
// FunctionAndBlockSignatureConverter and BufferAssignmentReturnOpConverter all | // BufferAssignmentFuncOpConverter and BufferAssignmentReturnOpConverter all | ||||
// together. The signature of `callee` after signature conversion would be: | // together. The signature of `callee` after signature conversion would be: | ||||
// func @callee(%arg0: memref<5xf32>,%arg1: memref<5xf32>) -> () | // func @callee(%arg0: memref<5xf32>,%arg1: memref<5xf32>) -> () | ||||
// The operands and results of caller and return operations must be matched | // The operands and results of caller and return operations must be matched | ||||
// respectively. | // respectively. | ||||
#map0 = affine_map<(d0) -> (d0)> | #map0 = affine_map<(d0) -> (d0)> | ||||
Show All 30 Lines | |||||
// CHECK: %[[SECOND_ALLOC:.*]] = alloc() | // CHECK: %[[SECOND_ALLOC:.*]] = alloc() | ||||
// CHECK: call @callee(%[[FIRST_ALLOC]], %[[SECOND_ALLOC]]) | // CHECK: call @callee(%[[FIRST_ALLOC]], %[[SECOND_ALLOC]]) | ||||
// CHECK: linalg.copy(%[[SECOND_ALLOC]], %[[CALLER_RESULT]]) | // CHECK: linalg.copy(%[[SECOND_ALLOC]], %[[CALLER_RESULT]]) | ||||
// CHECK: return | // CHECK: return | ||||
// ----- | // ----- | ||||
// Test case: Checking BufferAssignmentCallOpConverter and | // Test case: Checking BufferAssignmentCallOpConverter and | ||||
// FunctionAndBlockSignatureConverter and BufferAssignmentReturnOpConverter all | // BufferAssignmentFuncOpConverter and BufferAssignmentReturnOpConverter all | ||||
// together on functions that also have memref typed results. The signature of | // together on functions that also have memref typed results. The signature of | ||||
// `callee` after signature conversion would be: | // `callee` after signature conversion would be: | ||||
// func @callee(%arg0: memref<5xf32>,%arg1: memref<5xf32>)-> memref<2xf32> | // func @callee(%arg0: memref<5xf32>,%arg1: memref<5xf32>)-> memref<2xf32> | ||||
// where %arg0 is the input and %arg1 is the output buffer and the original memref | // where %arg0 is the input and %arg1 is the output buffer and the original memref | ||||
// type result remain as the function result. Then, the rewriter should match the | // type result remain as the function result. Then, the rewriter should match the | ||||
// caller's signature with the callee. Thus, two buffers will be allocated instead | // caller's signature with the callee. Thus, two buffers will be allocated instead | ||||
Show All 29 Lines |