diff options
author | Matthias Springer <me@m-sp.org> | 2023-05-15 15:34:11 +0200 |
---|---|---|
committer | Matthias Springer <me@m-sp.org> | 2023-05-15 15:38:20 +0200 |
commit | bb9d1b551a4407660293c2bf3f2343ba70ed8e68 (patch) | |
tree | 36fa3e68e27453d0944785b16d637de9479c06f6 /mlir/test | |
parent | e1f34b735b669c5978bfdead874ee59d33f99eb0 (diff) | |
download | llvm-bb9d1b551a4407660293c2bf3f2343ba70ed8e68.tar.gz |
[mlir][bufferization] Add option to dump alias sets
This is useful for debugging.
Differential Revision: https://reviews.llvm.org/D143314
Diffstat (limited to 'mlir/test')
-rw-r--r-- | mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-analysis.mlir | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-analysis.mlir b/mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-analysis.mlir index 4eaa7dc2bcbf..df174d01ca07 100644 --- a/mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-analysis.mlir +++ b/mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize-analysis.mlir @@ -1,9 +1,17 @@ -// RUN: mlir-opt %s -one-shot-bufferize="test-analysis-only" -allow-unregistered-dialect -split-input-file | FileCheck %s +// RUN: mlir-opt %s -one-shot-bufferize="test-analysis-only" \ +// RUN: -allow-unregistered-dialect -split-input-file | FileCheck %s + +// RUN: mlir-opt %s -one-shot-bufferize="test-analysis-only dump-alias-sets" \ +// RUN: -allow-unregistered-dialect -split-input-file | \ +// RUN: FileCheck %s --check-prefix=CHECK-ALIAS-SETS // CHECK-LABEL: func @unknown_op_aliasing( func.func @unknown_op_aliasing(%f: f32, %f2: f32, %pos: index) -> f32 { + // CHECK-ALIAS-SETS: %[[empty:.*]] = tensor.empty + %0 = tensor.empty() : tensor<10xf32> // CHECK: linalg.fill {__inplace_operands_attr__ = ["none", "true"]} + // CHECK-ALIAS-SETS: %[[fill1:.*]] = linalg.fill %1 = linalg.fill ins(%f : f32) outs(%0 : tensor<10xf32>) -> tensor<10xf32> // Something must bufferize out-of-place because the op may return an alias @@ -12,6 +20,8 @@ func.func @unknown_op_aliasing(%f: f32, %f2: f32, %pos: index) -> f32 { %alias = "dummy.dummy_op"(%1) : (tensor<10xf32>) -> (tensor<10xf32>) // CHECK: linalg.fill {__inplace_operands_attr__ = ["none", "true"]} + // CHECK-ALIAS-SETS: %[[fill2:.*]] = linalg.fill {__alias_set_attr__ = [ + // CHECK-ALIAS-SETS-SAME: ["%[[fill2]]", "%[[fill1]]", "%[[empty]]"]] %2 = linalg.fill ins(%f2 : f32) outs(%1 : tensor<10xf32>) -> tensor<10xf32> %3 = tensor.extract %alias[%pos] : tensor<10xf32> return %3 : f32 |