Add lowering for module with gpu.kernel_module attribute.
authorMahesh Ravishankar <ravishankarm@google.com>
Mon, 9 Dec 2019 17:51:25 +0000 (09:51 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 9 Dec 2019 17:52:21 +0000 (09:52 -0800)
commit4a62019eb88f0f8fafe8f4f7ab1c984313b0b022
tree432f1cef5f32fca9b9654bef352508d69332f63f
parent312ccb1c0f6df2fb67a7ad24ab4ce70dadbcda37
Add lowering for module with gpu.kernel_module attribute.

The existing GPU to SPIR-V lowering created a spv.module for every
function with gpu.kernel attribute. A better approach is to lower the
module that the function lives in (which has the attribute
gpu.kernel_module) to a spv.module operation. This better captures the
host-device separation modeled by GPU dialect and simplifies the
lowering as well.

PiperOrigin-RevId: 284574688
mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRV.cpp
mlir/lib/Conversion/GPUToSPIRV/ConvertGPUToSPIRVPass.cpp
mlir/lib/Dialect/SPIRV/SPIRVLowering.cpp
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
mlir/test/Conversion/GPUToSPIRV/simple.mlir