This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][SPIRVToLLVM] Conversion of GLSL ops to LLVM intrinsics
ClosedPublic

Authored by georgemitenkov on Jul 27 2020, 7:30 AM.

Details

Summary

This patch introduces new intrinsics in LLVM dialect:

  • llvm.intr.floor
  • llvm.intr.maxnum
  • llvm.intr.minnum
  • llvm.intr.smax
  • llvm.intr.smin

These intrinsics correspond to SPIR-V ops from GLSL
extended instruction set (spv.GLSL.Floor, spv.GLSL.FMax,
spv.GLSL.FMin, spv.GLSL.SMax and spv.GLSL.SMin
respectively). Also conversion patterns for them were added.

Diff Detail

Event Timeline

georgemitenkov created this revision.Jul 27 2020, 7:30 AM
georgemitenkov updated this revision to Diff 281197.EditedJul 28 2020, 5:29 AM

Also added other intrinsics to this patch since they fall in the same category:

  • SMin
  • SMax
  • FMin (minnum in LLVM)
  • FMax (maxnum in LLVM)
georgemitenkov retitled this revision from [MLIR][SPIRVToLLVM] Conversion of floor op to LLVM dialect to [MLIR][SPIRVToLLVM] Conversion of GLSL osp to LLVM intrinsics.Jul 28 2020, 5:32 AM
georgemitenkov edited the summary of this revision. (Show Details)
georgemitenkov retitled this revision from [MLIR][SPIRVToLLVM] Conversion of GLSL osp to LLVM intrinsics to [MLIR][SPIRVToLLVM] Conversion of GLSL ops to LLVM intrinsics.Jul 28 2020, 5:34 AM
antiagainst accepted this revision.Jul 28 2020, 5:50 PM
This revision is now accepted and ready to land.Jul 28 2020, 5:50 PM
ftynse added inline comments.Aug 3 2020, 7:25 AM
mlir/test/Target/llvmir-intrinsics.mlir
149
georgemitenkov marked an inline comment as done.Aug 3 2020, 1:09 PM
georgemitenkov added inline comments.
mlir/test/Target/llvmir-intrinsics.mlir
149

Thanks for pointing that out! Will address in a separate patch, I think it is actually a reoccurring issue in all the tests.