summaryrefslogtreecommitdiffstats
path: root/mlir/test/Dialect/SPIRV/Serialization
diff options
context:
space:
mode:
authorMahesh Ravishankar <ravishankarm@google.com>2019-10-04 15:59:54 -0700
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-10-04 16:00:22 -0700
commit3f8bde40cb267f1f6b168ea7bbdd918dfda650a4 (patch)
tree921c201af32fc1d9e3a30fff9533cbff0684176a /mlir/test/Dialect/SPIRV/Serialization
parent77a809d7a12bf83096a670dc3c611d9c1f95eb0d (diff)
downloadbcm5719-llvm-3f8bde40cb267f1f6b168ea7bbdd918dfda650a4.tar.gz
bcm5719-llvm-3f8bde40cb267f1f6b168ea7bbdd918dfda650a4.zip
Add spv.Undef op to support OpUndef instruction in SPIR-V.
Adding support for OpUndef instruction. Updating the dialect generation script to fix a few bugs in the instruction spec generation. PiperOrigin-RevId: 272975685
Diffstat (limited to 'mlir/test/Dialect/SPIRV/Serialization')
-rw-r--r--mlir/test/Dialect/SPIRV/Serialization/undef.mlir15
1 files changed, 15 insertions, 0 deletions
diff --git a/mlir/test/Dialect/SPIRV/Serialization/undef.mlir b/mlir/test/Dialect/SPIRV/Serialization/undef.mlir
new file mode 100644
index 00000000000..7c2ccdb1dcd
--- /dev/null
+++ b/mlir/test/Dialect/SPIRV/Serialization/undef.mlir
@@ -0,0 +1,15 @@
+// RUN: mlir-translate -test-spirv-roundtrip %s | FileCheck %s
+
+spv.module "Logical" "GLSL450" {
+ func @foo() -> () {
+ // CHECK: {{%.*}} = spv.Undef : f32
+ %0 = spv.Undef : f32
+ // CHECK: {{%.*}} = spv.Undef : vector<4xi32>
+ %1 = spv.Undef : vector<4xi32>
+ // CHECK: {{%.*}} = spv.Undef : !spv.array<4 x !spv.array<4 x i32>>
+ %2 = spv.Undef : !spv.array<4x!spv.array<4xi32>>
+ // CHECK: {{%.*}} = spv.Undef : !spv.ptr<!spv.struct<f32>, StorageBuffer>
+ %3 = spv.Undef : !spv.ptr<!spv.struct<f32>, StorageBuffer>
+ spv.Return
+ }
+} \ No newline at end of file
OpenPOWER on IntegriCloud