Page MenuHomePhabricator

[MLIR][SPIRVToLLVM] Updated documentation for SPIR-V to LLVM conversion

Authored by georgemitenkov on Jul 28 2020, 2:11 AM.



Updated the documentation for SPIR-V to LLVM conversion, particularly:

  • Added a section on control flow (To be updated once loop is reviewed)
  • Added a section on memory ops
  • Added a section on GLSL ops

Also, moved spv.FunctionCall to control flow section. Added a new section
that will be used to describe the modelling of runtime-related ops.

Diff Detail

Event Timeline

georgemitenkov created this revision.Jul 28 2020, 2:11 AM
georgemitenkov requested review of this revision.Jul 28 2020, 2:46 AM

Small nits: forgotten closing parenthesis, new GLSL ops.

antiagainst requested changes to this revision.Jul 28 2020, 6:44 PM



SPIR-V operations


This needs to be updated as Private storage class cannot have external linkage.


What do you mean here? OpLifetimeStart/OpLifetimeStop?

This revision now requires changes to proceed.Jul 28 2020, 6:44 PM
georgemitenkov marked 2 inline comments as done.Jul 29 2020, 6:48 AM
georgemitenkov added inline comments.

By scoping I mean any extra scope e.g. loops

If translating spv.Variable straight to llvm.alloca, we may have too many allocas (e.g. in the loop), which will cause a stack overflow. On LLVM side this can be handled with stacksave()/stackrestore() instructions as @ftynse mentioned in Those are removed if unnecessary by subsequent passes in actual LLVM.

georgemitenkov updated this revision to Diff 282511.EditedAug 3 2020, 12:21 AM
georgemitenkov marked an inline comment as done.

Addressed comments:

  • Fixed a typo
  • Changed linkage in globals accordingly
  • Rewrote section on variable op special case (when there is scoping)
mravishankar resigned from this revision.Aug 3 2020, 10:47 PM
antiagainst accepted this revision.Aug 4 2020, 3:32 PM
This revision is now accepted and ready to land.Aug 4 2020, 3:32 PM