diff options
| author | Denis Khalikov <khalikov.denis@huawei.com> | 2019-12-05 13:10:10 -0800 |
|---|---|---|
| committer | A. Unique TensorFlower <gardener@tensorflow.org> | 2019-12-05 13:10:44 -0800 |
| commit | e67acfa4684e4bee38d3b4c90eff1e78adc62cef (patch) | |
| tree | 430b259445efeae3ff83d7e28d331016b1d27b0c /mlir/test/Dialect/SPIRV/Serialization | |
| parent | 33a64540ade2dc9e860ddd6d4c1adbd1088e94c2 (diff) | |
| download | bcm5719-llvm-e67acfa4684e4bee38d3b4c90eff1e78adc62cef.tar.gz bcm5719-llvm-e67acfa4684e4bee38d3b4c90eff1e78adc62cef.zip | |
[spirv] Add CompositeInsertOp operation
A CompositeInsertOp operation make a copy of a composite object,
while modifying one part of it.
Closes tensorflow/mlir#292
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/292 from denis0x0D:sandbox/composite_insert 2200962b9057bda53cd2f2866b461e2797196380
PiperOrigin-RevId: 284036551
Diffstat (limited to 'mlir/test/Dialect/SPIRV/Serialization')
| -rw-r--r-- | mlir/test/Dialect/SPIRV/Serialization/composite-op.mlir | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mlir/test/Dialect/SPIRV/Serialization/composite-op.mlir b/mlir/test/Dialect/SPIRV/Serialization/composite-op.mlir new file mode 100644 index 00000000000..a3f74ca02cd --- /dev/null +++ b/mlir/test/Dialect/SPIRV/Serialization/composite-op.mlir @@ -0,0 +1,9 @@ +// RUN: mlir-translate -split-input-file -test-spirv-roundtrip %s | FileCheck %s + +spv.module "Logical" "GLSL450" { + func @composite_insert(%arg0 : !spv.struct<f32, !spv.struct<!spv.array<4xf32>, f32>>, %arg1: !spv.array<4xf32>) -> !spv.struct<f32, !spv.struct<!spv.array<4xf32>, f32>> { + // CHECK: {{%.*}} = spv.CompositeInsert {{%.*}}, {{%.*}}[1 : i32, 0 : i32] : !spv.array<4 x f32> into !spv.struct<f32, !spv.struct<!spv.array<4 x f32>, f32>> + %0 = spv.CompositeInsert %arg1, %arg0[1 : i32, 0 : i32] : !spv.array<4xf32> into !spv.struct<f32, !spv.struct<!spv.array<4xf32>, f32>> + spv.ReturnValue %0: !spv.struct<f32, !spv.struct<!spv.array<4xf32>, f32>> + } +} |

