This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][SPIRVToLLVM] Added a hook for descriptor set / binding encoding
ClosedPublic

Authored by georgemitenkov on Aug 25 2020, 3:10 AM.

Details

Summary

This patch introduces a hook to encode descriptor set
and binding number into spv.globalVariable's symbolic name. This
allows to preserve this information, and at the same time legalize
the global variable for the conversion to LLVM dialect.

This is required for mlir-spirv-cpu-runner to convert kernel
arguments into LLVM.

Also, a couple of some nits added:

  • removed unused comment
  • changed to a capital letter in the comment

Diff Detail

Event Timeline

georgemitenkov created this revision.Aug 25 2020, 3:10 AM
georgemitenkov requested review of this revision.Aug 25 2020, 3:10 AM
mravishankar accepted this revision.Aug 25 2020, 2:59 PM
mravishankar added inline comments.
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
1406

If you rebase this on top of the change to add SymbolName trait to spv.module you can add that to the name as well.

This revision is now accepted and ready to land.Aug 25 2020, 2:59 PM
georgemitenkov marked an inline comment as done.

Rebased on top of the SPIR-V module name patch to include the symbol name of the module into the new name of the global variable.