summaryrefslogtreecommitdiffstats
path: root/mlir/test/Dialect/SPIRV/Serialization
diff options
context:
space:
mode:
authorMahesh Ravishankar <ravishankarm@google.com>2019-09-19 14:49:29 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-09-19 14:50:05 -0700
commit9a4f5d2ee324f536cede769c10022d1ce7b875f1 (patch)
treed9ed6d52b0ea1bf45dc170b370ef252fff97cadd /mlir/test/Dialect/SPIRV/Serialization
parent2df646bef6e7665fdb8523613d82e7d4a5013217 (diff)
downloadbcm5719-llvm-9a4f5d2ee324f536cede769c10022d1ce7b875f1.tar.gz
bcm5719-llvm-9a4f5d2ee324f536cede769c10022d1ce7b875f1.zip
Allow specification of decorators on SPIR-V StructType members.
Allow specification of decorators on SPIR-V StructType members. If the struct has layout information, these decorations are to be specified after the offset specification of the member. These decorations are emitted as OpMemberDecorate instructions on the struct <id>. Update (de)serialization to handle these decorations. PiperOrigin-RevId: 270130136
Diffstat (limited to 'mlir/test/Dialect/SPIRV/Serialization')
-rw-r--r--mlir/test/Dialect/SPIRV/Serialization/struct.mlir9
1 files changed, 9 insertions, 0 deletions
diff --git a/mlir/test/Dialect/SPIRV/Serialization/struct.mlir b/mlir/test/Dialect/SPIRV/Serialization/struct.mlir
index b061dfebcc6..7a4695e0cfc 100644
--- a/mlir/test/Dialect/SPIRV/Serialization/struct.mlir
+++ b/mlir/test/Dialect/SPIRV/Serialization/struct.mlir
@@ -13,6 +13,15 @@ spv.module "Logical" "GLSL450" {
// CHECK: !spv.ptr<!spv.struct<!spv.array<128 x !spv.struct<!spv.array<128 x f32 [4]> [0]> [4]> [0]>, StorageBuffer>
spv.globalVariable @var3 : !spv.ptr<!spv.struct<!spv.array<128 x !spv.struct<!spv.array<128 x f32 [4]> [0]> [4]> [0]>, StorageBuffer>
+ // CHECK: !spv.ptr<!spv.struct<f32 [0 NonWritable], i32 [4]>, StorageBuffer>
+ spv.globalVariable @var4 : !spv.ptr<!spv.struct<f32 [0 NonWritable], i32 [4]>, StorageBuffer>
+
+ // CHECK: !spv.ptr<!spv.struct<f32 [NonWritable], i32 [NonWritable NonReadable]>, StorageBuffer>
+ spv.globalVariable @var5 : !spv.ptr<!spv.struct<f32 [NonWritable], i32 [NonWritable NonReadable]>, StorageBuffer>
+
+ // CHECK: !spv.ptr<!spv.struct<f32 [0 NonWritable], i32 [4 NonWritable NonReadable]>, StorageBuffer>
+ spv.globalVariable @var6 : !spv.ptr<!spv.struct<f32 [0 NonWritable], i32 [4 NonWritable NonReadable]>, StorageBuffer>
+
// CHECK: !spv.ptr<!spv.struct<!spv.array<128 x f32 [4]> [0]>, Input>,
// CHECK-SAME: !spv.ptr<!spv.struct<!spv.array<128 x f32 [4]> [0]>, Output>
func @kernel_1(%arg0: !spv.ptr<!spv.struct<!spv.array<128 x f32 [4]> [0]>, Input>, %arg1: !spv.ptr<!spv.struct<!spv.array<128 x f32 [4]> [0]>, Output>) -> () {
OpenPOWER on IntegriCloud