[mlir][gpu] Add GPU target support to `gpu-to-llvm`.
**For an explanation of these patches see D154153.** This patch modifies the lowering of `gpu.module` & `gpu.launch_func` in the `gpu-to-llvm` pass, allowing the usage of the new GPU compilation mechanism in the patch series ending in D154153. Instead of removing Modules, this patch preserves the module if it has target attributes so that the `gpu-module-to-binary` pass can later serialize them. Instead of lowering the kernel calls to the LLVM dialect, this patch primarily updates the operation's arguments, leaving the job of converting the operation into LLVM instructions to the translation stage. The reason for not lowering the operation to LLVM at this stage is that kernel launches do not have a single one-to-one representation in LLVM. For example, a kernel launch can be represented by a call to a kernel stub, like in CUDA or HIP. Kernel launches are also intrinsically linked to the binary associated with the call, and the binaries are converted during translation. Depends on D154149 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D154152
Loading
Please sign in to comment