GPUToCUDA: emit addressof directly instead of wrapping it into a getter function
authorAlex Zinenko <zinenko@google.com>
Tue, 8 Oct 2019 12:03:09 +0000 (05:03 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 8 Oct 2019 12:03:42 +0000 (05:03 -0700)
commit52e082b6ed964ad408abc637b995bc13ff2fb122
tree77cf9481c0ebd8218884f60c0891fab082700cd4
parent16af5924cb6fd2bea3a4f9acf55aef4e796f5b11
GPUToCUDA: emit addressof directly instead of wrapping it into a getter function

Originally, the CUBIN getter function was introduced as a mechanism to
circumvent the absence of globals in the LLVM dialect. It would allocate memory
and populate it with the CUBIN data. LLVM dialect now supports globals and they
are already used to store CUBIN data, making the getter function a trivial
address computation of a global. Emit the address computation directly at the
place of `gpu.launch_func` instead of putting it in a function and calling it.
This simplifies the conversion flow and prepares it for using the
DialectConversion infrastructure.

PiperOrigin-RevId: 273496221
mlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
mlir/test/Conversion/GPUToCUDA/lower-launch-func-to-cuda.mlir