Makes spv.module generated by GPU->SPIRV conversion spec compliant
authorMahesh Ravishankar <ravishankarm@google.com>
Wed, 16 Oct 2019 18:52:33 +0000 (11:52 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Wed, 16 Oct 2019 18:53:07 +0000 (11:53 -0700)
commit54a847347040ab50a6c17881998f1cb3e899f1e0
tree1ce129d9db3cf11a81d4bb0c466ebc915b216a85
parentd2f0f847af31009203215b158a5363f70c0b4d8d
Makes spv.module generated by GPU->SPIRV conversion spec compliant

Makes the spv.module generated by the GPU to SPIR-V conversion SPIR-V
spec compliant (validated using spirv-val from Vulkan tools).

1) Separate out the VulkanLayoutUtils from
DecorateSPIRVCompositeTypeLayoutPass to make it reusable within the
Type converter in SPIR-V lowering infrastructure. This is used to
compute the layout of the !spv.struct used in global variable type
description.
2) Set the capabilities of the spv.module to Shader (needed for use of
Logical Memory Model, and the extensions to
SPV_KHR_storage_buffer_storage_class for use of Storage Buffer)

PiperOrigin-RevId: 275081486
mlir/include/mlir/Dialect/SPIRV/LayoutUtils.h [new file with mode: 0644]
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
mlir/lib/Dialect/SPIRV/CMakeLists.txt
mlir/lib/Dialect/SPIRV/LayoutUtils.cpp [new file with mode: 0644]
mlir/lib/Dialect/SPIRV/Transforms/DecorateSPIRVCompositeTypeLayoutPass.cpp
mlir/test/Conversion/GPUToSPIRV/load_store.mlir
mlir/test/Conversion/GPUToSPIRV/simple.mlir