Make legality check in GPU->SPIR-V lowering of FuncOp kernel specific.
authorMahesh Ravishankar <ravishankarm@google.com>
Tue, 12 Nov 2019 20:52:18 +0000 (12:52 -0800)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 12 Nov 2019 20:52:53 +0000 (12:52 -0800)
commit9d985141ef848f352c444cb950096c1e7ccadad9
tree7fa072b5380496fe84abc9f6c7c3f3c24c980622
parentb259c26eb0717b6962c2f75ac23a44491b27810d
Make legality check in GPU->SPIR-V lowering of FuncOp kernel specific.

Existing check that sets FuncOp to be dynamically legal was just
checking that the types of the argument are SPIR-V compatible. Since
the current conversion from GPU to SPIR-V does not handle lowering
non-kernel functions, change the legality check to verify that the
FuncOp has the gpu.kernel attribute and has void(void) return type.

PiperOrigin-RevId: 280032782
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp