/llvm-project/mlir/test/Dialect/Linalg/ |
H A D | one-shot-bufferize-analysis-2fill-extract-matmul-all-perms.mlir | 10 …%arg0: tensor<518x518xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 11 …%arg1: tensor<518x518xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 12 …%arg2: tensor<256x256xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 18 %0 = bufferization.alloc_tensor() : tensor<256x256xf32> 37 …%arg0: tensor<518x518xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 38 …%arg1: tensor<518x518xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 39 …%arg2: tensor<256x256xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 45 %0 = bufferization.alloc_tensor() : tensor<256x256xf32> 64 …%arg0: tensor<518x518xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 65 …%arg1: tensor<518x518xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… [all …]
|
/llvm-project/mlir/test/Dialect/Bufferization/ |
H A D | ops.mlir | 10 %clone = bufferization.clone %buf : memref<*xf32> to memref<*xf32> 17 %0 = bufferization.to_memref %arg0 19 %1 = bufferization.to_memref %arg1 26 %tensor = bufferization.to_tensor %buf restrict writable : memref<2xf32> to tensor<2xf32> 34 // CHECK: bufferization.alloc_tensor(%{{.*}}) : tensor<?x5xf32> 35 %0 = bufferization.alloc_tensor(%sz) : tensor<?x5xf32> 36 // CHECK: bufferization.alloc_tensor() copy(%{{.*}}) : tensor<?x5xf32> 37 %1 = bufferization.alloc_tensor() copy(%t) : tensor<?x5xf32> 38 // CHECK: bufferization.alloc_tensor() : tensor<5x6xf32> 39 %2 = bufferization [all...] |
H A D | canonicalize.mlir | 9 %0 = bufferization.to_memref %arg0 : tensor<?xf32> to memref<?xf32> 10 %1 = bufferization.to_tensor %0 : memref<?xf32> to tensor<?xf32> 21 %0 = bufferization.to_tensor %arg0 : memref<?xf32> to tensor<?xf32> 22 %1 = bufferization.to_memref %0 : tensor<?xf32> to memref<?xf32> 36 // CHECK: %[[TENSOR:.*]] = bufferization.to_tensor 38 // CHECK: %[[MEMREF_ADDRSPACE7:.*]] = bufferization.to_memref 43 %0 = bufferization.to_tensor %arg0 : memref<?xf32, 2> to tensor<?xf32, 7> 44 %1 = bufferization.to_memref %0 : tensor<?xf32, 7> to memref<?xf32, 7> 55 // CHECK-NOT: bufferization.to_tensor 56 // CHECK-NOT: bufferization [all...] |
H A D | invalid.mlir | 6 %0 = bufferization.alloc_tensor(%arg0) : tensor<4x?x?x5xf32> 15 %0 = bufferization.alloc_tensor() copy(%t) : tensor<5xf32> 23 %0 = bufferization.alloc_tensor(%sz) copy(%t) : tensor<?xf32> 29 // expected-error @+1{{invalid value for 'bufferization.access'}} 30 func.func private @invalid_buffer_access_type(tensor<*xf32> {bufferization.access = "foo"}) 34 // expected-error @+1{{'bufferization.writable' is invalid on external functions}} 35 func.func private @invalid_writable_attribute(tensor<*xf32> {bufferization.writable = false}) 40 …// expected-error @+1{{attribute '"bufferization.writable"' not supported as an op attribute by th… 41 arith.constant {bufferization.writable = true} 0 : index 48 …bufferization.materialize_in_destination %arg0 in %arg1 : (tensor<4xf32>, tensor<5xf32>) -> tensor… [all …]
|
/llvm-project/mlir/lib/Dialect/Bufferization/Transforms/ |
H A D | Bufferize.cpp | 28 namespace bufferization { namespace 32 } // namespace bufferization 38 using namespace mlir::bufferization; 67 : public bufferization::impl::OneShotBufferizeBase<OneShotBufferizePass> { in BufferizeTypeConverter() 75 .insert<bufferization::BufferizationDialect, memref::MemRefDialect>(); in BufferizeTypeConverter() 81 // Make new bufferization options if none were provided when creating the in BufferizeTypeConverter() 136 return bufferization::getMemRefTypeWithStaticIdentityLayout( in populateEliminateBufferizeMaterializationsPatterns() 141 return bufferization::getMemRefTypeWithFullyDynamicLayout(tensorType, 215 std::unique_ptr<Pass> mlir::bufferization::createOneShotBufferizePass() { in runOnOperation() 219 std::unique_ptr<Pass> mlir::bufferization in runOnOperation() [all...] |
H A D | EmptyTensorToAllocTensor.cpp | 18 namespace bufferization { namespace 21 } // namespace bufferization 25 using namespace mlir::bufferization; 34 rewriter.replaceOpWithNewOp<bufferization::AllocTensorOp>( in matchAndRewrite() 41 : public bufferization::impl::EmptyTensorToAllocTensorBase< 49 .insert<tensor::TensorDialect, bufferization::BufferizationDialect>(); in getDependentDialects() 54 void bufferization::populateEmptyTensorToAllocTensorPattern( in populateEmptyTensorToAllocTensorPattern() 68 mlir::bufferization::createEmptyTensorToAllocTensorPass() { in createEmptyTensorToAllocTensorPass()
|
H A D | EmptyTensorElimination.cpp | 22 namespace bufferization { namespace 25 } // namespace bufferization 29 using namespace mlir::bufferization; 96 Value mlir::bufferization::buildSubsetExtraction(RewriterBase &rewriter, in findValidInsertionPoint() 118 LogicalResult mlir::bufferization::eliminateEmptyTensors( in eliminateEmptyTensors() 190 : public bufferization::impl::EmptyTensorEliminationBase< in eliminateEmptyTensors() 198 .insert<bufferization::BufferizationDialect, tensor::TensorDialect>(); in eliminateEmptyTensors() 203 LogicalResult mlir::bufferization::eliminateEmptyTensors(RewriterBase &rewriter, in eliminateEmptyTensors() 222 return bufferization::eliminateEmptyTensors(rewriter, op, state); 227 if (failed(bufferization [all...] |
/llvm-project/mlir/test/Dialect/Bufferization/Transforms/ |
H A D | finalizing-bufferize.mlir |
|
H A D | transform-ops.mlir | 8 %1 = transform.bufferization.one_shot_bufferize %0 : (!transform.any_op) -> !transform.any_op 18 // CHECK: %[[A_memref:.*]] = bufferization.to_memref %[[A]] 23 // CHECK: %[[res_tensor:.*]] = bufferization.to_tensor %[[alloc]] 37 …%1 = transform.bufferization.one_shot_bufferize %0 {memcpy_op = "linalg.copy"} : (!transform.any_o… 48 // CHECK: %[[A_memref:.*]] = bufferization.to_memref %[[A]] 53 // CHECK: %[[res_tensor:.*]] = bufferization.to_tensor %[[alloc]] 67 %1 = transform.bufferization.one_shot_bufferize %0 92 // expected-error @+1 {{bufferization failed}} 93 %1 = transform.bufferization.one_shot_bufferize %0 : (!transform.any_op) -> !transform.any_op 109 %0 = transform.bufferization.one_shot_bufferize %arg1 : (!transform.any_op) -> !transform.any_op [all …]
|
H A D | one-shot-module-bufferize-analysis.mlir | 23 func.func @extract_slice_fun(%A : tensor<?xf32> {bufferization.writable = false}, 24 // CHECK-SAME: bufferization.access = "read" 25 %B : tensor<?xf32> {bufferization.writable = true}) 26 // CHECK-SAME: bufferization.access = "read" 47 func.func @insert_slice_fun(%A : tensor<?xf32> {bufferization.writable = false}, 48 // CHECK-SAME: bufferization.access = "read" 49 %B : tensor<?xf32> {bufferization.writable = true}, 50 // CHECK-SAME: bufferization.access = "read-write" 51 %C : tensor<4xf32> {bufferization.writable = false}) 52 // CHECK-SAME: bufferization [all...] |
H A D | one-shot-bufferize.mlir | 42 // CHECK: %[[A_memref:.*]] = bufferization.to_memref %[[A]] 57 // CHECK: %[[A_memref:.*]] = bufferization.to_memref %[[A]] 62 // CHECK: %[[res_tensor:.*]] = bufferization.to_tensor %[[alloc]] 74 %0 = bufferization.alloc_tensor() : tensor<10xf32> 105 // CHECK-DAG: %[[dummy_m:.*]] = bufferization.to_memref %[[dummy]] 126 %0 = bufferization.alloc_tensor() : tensor<10xf32> 127 // CHECK: %[[alloc_tensor:.*]] = bufferization.to_tensor %[[alloc]] 137 // CHECK-DAG: %[[m:.*]] = bufferization.to_memref %[[t]] : tensor<?xf32> to memref<?xf32, strided{{.*}}> 139 %0 = bufferization.alloc_tensor(%sz) : tensor<?xf32> 154 // moment because this would create a tensor op during bufferization [all...] |
H A D | buffer-deallocation-simplification.mlir | 4 %0 = bufferization.dealloc (%arg0 : memref<2xi32>) if (%arg1) retain (%arg0 : memref<2xi32>) 5 …%1 = bufferization.dealloc (%arg0, %arg2 : memref<2xi32>, memref<2xi32>) if (%arg1, %arg1) retain … 6 …%2:2 = bufferization.dealloc (%arg0 : memref<2xi32>) if (%arg1) retain (%arg0, %arg2 : memref<2xi3… 11 …%5:3 = bufferization.dealloc (%arg0, %4 : memref<2xi32>, memref<1xi32, strided<[1], offset: 1>>) i… 18 // CHECK-NEXT: [[V1:%.+]] = bufferization.dealloc ([[ARG2]] : memref<2xi32>) if ([[ARG1]]) retain … 20 // CHECK-NEXT: [[V2:%.+]]:2 = bufferization.dealloc ([[ARG0]] : memref<2xi32>) if ([[ARG1]]) retai… 35 %0 = bufferization.dealloc (%base_buffer : memref<i32>) if (%arg1) retain (%arg0 : memref<2xi32>) 36 …%1 = bufferization.dealloc (%base_buffer, %base_buffer0 : memref<i32>, memref<i32>) if (%arg1, %ar… 37 …%2:2 = bufferization.dealloc (%base_buffer : memref<i32>) if (%arg1) retain (%arg0, %arg2 : memref… 42 …%5:3 = bufferization.dealloc (%base_buffer, %4 : memref<i32>, memref<1xi32, strided<[1], offset: 1… [all …]
|
H A D | tensor-copy-insertion.mlir | 10 // CHECK-FUNC: bufferization.alloc_tensor() copy(%{{.*}}) : tensor<?xf32> 11 // CHECK: %[[copy:.*]] = bufferization.alloc_tensor() copy(%{{.*}}) : tensor<?xf32> 23 // CHECK-FUNC: bufferization.alloc_tensor() : tensor<5xf32> 24 // CHECK: bufferization.alloc_tensor() : tensor<5xf32> 25 %0 = bufferization.alloc_tensor() : tensor<5xf32> 36 // CHECK: bufferization.alloc_tensor() : tensor<5xf32> 37 // CHECK: bufferization.alloc_tensor() : tensor<5xf32> 38 %0 = bufferization.alloc_tensor() : tensor<5xf32> 49 // CHECK: %[[alloc:.*]] = bufferization.alloc_tensor() : tensor<5xf32> 68 // CHECK: %[[alloc:.*]] = bufferization.alloc_tensor() : tensor<3xf32>
|
H A D | one-shot-bufferize-partial.mlir | 3 // Test bufferization using memref types that have no layout map. 11 // RUN: mlir-opt %s -allow-unregistered-dialect -one-shot-bufferize="dialect-filter=tensor,bufferization allow-unknown-ops" -canonicalize -split-input-file | FileCheck %s --check-prefix=CHECK-TENSOR 12 // RUN: mlir-opt %s -allow-unregistered-dialect -one-shot-bufferize="dialect-filter=scf,bufferization allow-unknown-ops" -canonicalize -split-input-file | FileCheck %s --check-prefix=CHECK-SCF 28 // CHECK: %[[dummy_memref:.*]] = bufferization.to_memref %[[dummy]] : tensor<?xf32> to memref<?xf32, strided<[?], offset: ?>> 30 // CHECK-NO-LAYOUT-MAP: %[[dummy_memref:.*]] = bufferization.to_memref %[[dummy]] : tensor<?xf32> to memref<?xf32> 58 // CHECK: %[[m1:.*]] = bufferization.to_memref %[[t1]] 64 // CHECK: %[[dummy_memref:.*]] = bufferization.to_memref %[[dummy]] : tensor<?xf32> to memref<?xf32, strided<[?], offset: ?>> 84 // CHECK: %[[dummy_memref:.*]] = bufferization.to_memref %[[dummy]] 101 // CHECK: %[[m1:.*]] = bufferization.to_memref %[[t1]] 107 // CHECK: %[[alloc_tensor:.*]] = bufferization [all...] |
/llvm-project/mlir/test/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation/ |
H A D | dealloc-memoryeffect-interface.mlir | 22 // CHECK-NOT: bufferization.dealloc 24 // CHECK-NOT: bufferization.dealloc 26 // CHECK-NOT: bufferization.dealloc 28 // CHECK: bufferization.dealloc (%[[FIRST_ALLOC]] :{{.*}}) if (%true{{[0-9_]*}}) 29 // CHECK: bufferization.dealloc (%[[SECOND_ALLOC]] :{{.*}}) if (%true{{[0-9_]*}}) 51 // CHECK: bufferization.dealloc (%[[FIRST_ALLOC]] :{{.*}}) if (%true{{[0-9_]*}}) 70 // CHECK: bufferization.dealloc (%[[ALLOC0]] :{{.*}}) if (%true{{[0-9_]*}}) 88 // CHECK: bufferization.dealloc ([[BASE]] : {{.*}}) if ([[COND0]]) 94 %0 = bufferization.clone %arg0 : memref<?x?xf64> to memref<?x?xf64> 95 %1 = bufferization.clone %arg1 : memref<?x?xf64> to memref<?x?xf64> [all …]
|
H A D | dealloc-branchop-interface.mlir | 33 // CHECK-NOT: bufferization.dealloc 42 // CHECK-NEXT: bufferization.dealloc ([[BASE]] : {{.*}}) if ([[COND1]]) 77 // CHECK-NOT: bufferization.dealloc 86 // CHECK-NEXT: bufferization.dealloc ([[BASE]] : {{.*}}) if ([[COND]]) 111 // CHECK-NOT: bufferization.dealloc 122 // CHECK-NEXT: bufferization.dealloc ([[BASE]] : {{.*}}) if ([[COND]]) 175 // CHECK-NOT: bufferization.dealloc 176 // CHECK-NOT: bufferization.clone 179 // CHECK-NOT: bufferization.dealloc 180 // CHECK-NOT: bufferization [all...] |
/llvm-project/mlir/lib/Dialect/SparseTensor/Transforms/ |
H A D | SparsificationAndBufferizationPass.cpp | 66 const bufferization::OneShotBufferizationOptions &bufferizationOptions, in SparsificationAndBufferizationPass() 77 const bufferization::OneShotBufferizationOptions &bufferizationOptions, in SparsificationAndBufferizationPass() 99 /// `insertTensorCopies` in the form of `bufferization.alloc_tensor` ops. in runDenseBufferization() 101 bufferization::OneShotBufferizationOptions updatedOptions = in runDenseBufferization() 117 if (failed(bufferization::bufferizeModuleOp(cast<ModuleOp>(getOperation()), in runDenseBufferization() 121 bufferization::removeBufferizationAttributesInModule(getOperation()); in runDenseBufferization() 137 bufferization::createEmptyTensorToAllocTensorPass()); in runOnOperation() 145 // materialized in the IR in the form of `bufferization.alloc_tensor` ops. in runOnOperation() 152 if (failed(bufferization::insertTensorCopies(getOperation(), in runOnOperation() 164 // of `bufferization in runOnOperation() [all...] |
/llvm-project/mlir/test/Integration/Dialect/SparseTensor/CPU/ |
H A D | sparse_conversion_sparse2dense.mlir | 219 bufferization.dealloc_tensor %s2341 : tensor<2x3x4xf64, #Tensor1> 220 bufferization.dealloc_tensor %s2342 : tensor<2x3x4xf64, #Tensor2> 221 bufferization.dealloc_tensor %s2343 : tensor<2x3x4xf64, #Tensor3> 222 bufferization.dealloc_tensor %s2344 : tensor<2x3x4xf64, #Tensor4> 223 bufferization.dealloc_tensor %s2345 : tensor<2x3x4xf64, #Tensor5> 224 bufferization.dealloc_tensor %s2346 : tensor<2x3x4xf64, #Tensor6> 225 bufferization.dealloc_tensor %sp344 : tensor<?x3x4xf64, #Tensor4> 226 // bufferization.dealloc_tensor %sp345 : tensor<?x3x4xf64, #Tensor5> 227 // bufferization.dealloc_tensor %sp346 : tensor<?x3x4xf64, #Tensor6> 228 // bufferization [all...] |
/llvm-project/mlir/include/mlir/Dialect/Bufferization/IR/ |
H A D | BufferizationBase.td | 15 let name = "bufferization"; 16 let cppNamespace = "::mlir::bufferization"; 20 Simply put, bufferization is the process of converting computations on the 22 The `bufferization` dialect contains operations/interfaces specific to the 23 bufferization passes. 25 An overview of the bufferization infrastructure and important conceptual 27 found in [bufferization](/docs/Bufferization/) and [ownership-based buffer 48 kWritableAttrName = "bufferization.writable"; 57 kBufferAccessAttrName = "bufferization.access"; 59 /// Attribute name used to mark the bufferization layout for region [all …]
|
/llvm-project/mlir/docs/ |
H A D | Bufferization.md | 9 to bufferization. These passes typically run as one of the last steps in a 12 [tile/fuse/… on tensors first](https://llvm.discourse.group/t/rfc-linalg-on-tensors-update-and-comprehensive-bufferization-rfc/3373), 15  17 The most important bufferization pass is *One-Shot Bufferize*: This pass 32 One-Shot Bufferize is a tensor bufferization pass designed for IR in 34 and with aggressive in-place bufferization. 43 * A **whole-function at a time analysis**. In-place bufferization decisions 47 information about an op's bufferization/memory semantics. 50 analyze the entire IR and make bufferization decisions. Then, bufferize 60 analysis. The result of the analysis are queried by the bufferization vi [all...] |
/llvm-project/mlir/test/python/dialects/ |
H A D | transform_bufferization_ext.py | 5 from mlir.dialects.transform import bufferization 6 from mlir.dialects.bufferization import LayoutMapOption 27 bufferization.EmptyTensorToAllocTensorOp(sequence.bodyTarget) 42 bufferization.EmptyTensorToAllocTensorOp( 58 bufferization.OneShotBufferizeOp(sequence.bodyTarget) 71 bufferization.OneShotBufferizeOp( 87 bufferization.OneShotBufferizeOp(
|
/llvm-project/mlir/lib/Dialect/Bufferization/TransformOps/ |
H A D | BufferizationTransformOps.cpp | 23 using namespace mlir::bufferization; 33 bufferization::hoistBuffersFromLoops(target); in applyToOne() 93 if (failed(bufferization::runOneShotModuleBufferize(moduleOp, options))) in apply() 94 return emitSilenceableError() << "bufferization failed"; in apply() 96 if (failed(bufferization::runOneShotBufferize(target, options))) in apply() 97 return emitSilenceableError() << "bufferization failed"; in apply() 121 if (failed(bufferization::eliminateEmptyTensors(rewriter, target))) in apply() 136 auto alloc = rewriter.replaceOpWithNewOp<bufferization::AllocTensorOp>( in applyToOne() 159 declareGeneratedDialect<bufferization::BufferizationDialect>(); in init() 175 void mlir::bufferization in registerTransformDialectExtension() [all...] |
/llvm-project/mlir/test/Dialect/SCF/ |
H A D | one-shot-bufferize-tensor-copy-insertion.mlir | 10 // CHECK: %[[A_copy:.*]] = bufferization.alloc_tensor() copy(%[[A]]) : tensor<?xf32> 11 // CHECK: %[[B_copy:.*]] = bufferization.alloc_tensor() copy(%[[B]]) : tensor<?xf32> 31 // CHECK: %[[A_copy:.*]] = bufferization.alloc_tensor() copy(%[[A]]) : tensor<?xf32> 32 // CHECK: %[[B_copy:.*]] = bufferization.alloc_tensor() copy(%[[B]]) : tensor<?xf32> 38 // CHECK-DAG: %[[yield1:.*]] = bufferization.alloc_tensor() copy(%[[iter2]]) : tensor<?xf32> 39 // CHECK-DAG: %[[yield2:.*]] = bufferization.alloc_tensor() copy(%[[iter1]]) : tensor<?xf32> 54 // CHECK: %[[A_copy:.*]] = bufferization.alloc_tensor() copy(%[[A]]) : tensor<5xi1> 55 // CHECK: %[[B_copy:.*]] = bufferization.alloc_tensor() copy(%[[B]]) : tensor<5xi1> 85 // CHECK: %[[A_copy:.*]] = bufferization.alloc_tensor() copy(%[[A]]) : tensor<5xi1> 86 // CHECK: %[[B_copy:.*]] = bufferization.alloc_tensor() copy(%[[B]]) : tensor<5xi1> [all …]
|
/llvm-project/mlir/test/Dialect/Tensor/ |
H A D | bufferize.mlir | 1 // RUN: mlir-opt %s --one-shot-bufferize="dialect-filter=tensor,bufferization copy-before-write unknown-type-conversion=identity-layout-map" -cse -split-input-file | FileCheck %s 6 // CHECK: %[[MEMREF:.*]] = bufferization.to_memref %[[TENSOR]] : tensor<*xf32> to memref<*xf32> 18 // CHECK: %[[MEMREF:.*]] = bufferization.to_memref %[[TENSOR]] 29 // CHECK: %[[MEMREF:.*]] = bufferization.to_memref %[[TENSOR]] 31 // CHECK: %[[RET:.*]] = bufferization.to_tensor %[[CASTED]] 42 // CHECK: %[[MEMREF:.*]] = bufferization.to_memref %[[TENSOR]] : tensor<*xf32> to memref<*xf32> 44 // CHECK: %[[RET:.*]] = bufferization.to_tensor %[[CASTED_MEMREF]] : memref<2xf32, strided<[?], offset: ?>> 55 // CHECK: %[[MEMREF:.*]] = bufferization.to_memref %[[TENSOR]] : tensor<2xf32> to memref<2xf32> 57 // CHECK: %[[RET:.*]] = bufferization.to_tensor %[[CASTED_MEMREF]] : memref<*xf32> 68 // CHECK: %[[RET:.*]] = bufferization [all...] |
/llvm-project/mlir/lib/Dialect/Bufferization/IR/ |
H A D | BufferizableOpInterface.cpp | 29 namespace bufferization { namespace 33 } // namespace bufferization 36 MLIR_DEFINE_EXPLICIT_TYPE_ID(mlir::bufferization::AnalysisState) 43 using namespace bufferization; 112 Region *bufferization::getNextEnclosingRepetitiveRegion( in getNextEnclosingRepetitiveRegion() 122 Region *bufferization::getParallelRegion(Region *region, in getParallelRegion() 137 Operation *bufferization::getOwnerOfValue(Value value) { in getOwnerOfValue() 146 FailureOr<Value> bufferization::allocateTensorForShapedValue( in allocateTensorForShapedValue() 337 // Special case: If function boundary bufferization is deactivated, do not in isOpAllowed() 367 return bufferization in setFunctionBoundaryTypeConversion() [all...] |