This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][mlir-spirv-cpu-runner] A pass to emulate a call to kernel in LLVM
AbandonedPublic

Authored by mravishankar on Oct 14 2020, 10:51 PM.

Details

Summary

This patch introduces a pass for running
mlir-spirv-cpu-runner - LowerHostCodeToLLVMPass.

This pass emulates gpu.launch_func call in LLVM dialect and lowers
the host module code to LLVM. It removes the gpu.module, creates a
sequence of global variables that are later linked to the varables
in the kernel module, as well as a series of copies to/from
them to emulate the memory transfer to/from the host or to/from the
device sides. It also converts the remaining Standard dialect into
LLVM dialect, emitting C wrappers.

Diff Detail