summaryrefslogtreecommitdiffstats
path: root/mlir/test/Dialect/SPIRV/Serialization
diff options
context:
space:
mode:
authorDenis Khalikov <khalikov.denis@huawei.com>2019-12-05 13:10:10 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-12-05 13:10:44 -0800
commite67acfa4684e4bee38d3b4c90eff1e78adc62cef (patch)
tree430b259445efeae3ff83d7e28d331016b1d27b0c /mlir/test/Dialect/SPIRV/Serialization
parent33a64540ade2dc9e860ddd6d4c1adbd1088e94c2 (diff)
downloadbcm5719-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.mlir9
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>>
+ }
+}
OpenPOWER on IntegriCloud