This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][SPIRVToLLVM] Added conversion for SPIR-V comparison ops
ClosedPublic

Authored by georgemitenkov on Jun 9 2020, 10:48 AM.

Details

Summary

Implemented FComparePattern and IComparePattern classes that provide conversion of SPIR-V comparison ops (such as spv.FOrdGreaterThanEqual and others) to LLVM dialect. Also added tests in comparison-ops-to-llvm.mlir.

Diff Detail

Event Timeline

georgemitenkov created this revision.Jun 9 2020, 10:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2020, 10:48 AM
antiagainst accepted this revision.Jun 9 2020, 5:27 PM
antiagainst added inline comments.
mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
52

This line can be reflowed to the above line?

75

Same here.

106

Normally we sort these alpabetically. Here it's fine if you are grouping them logically, but it would be nice to have some comments like

// Arithmetic ops
...
// Bitwise ops
...
This revision is now accepted and ready to land.Jun 9 2020, 5:27 PM
georgemitenkov marked 3 inline comments as done.
  • [MLIR][SPIRVToLLVM] Restyled comments and restructured patterns
  • [MLIR][SPIRVToLLVM] Refactored code with git-clang

Restyled comments for comparison patterns to be one liners. Included comments in pattern population that specify the group of ops, also sorted each group alphabetically.

The parent commit has landed. Could you rebase this against master so I can land this too?

  • [MLIR][SPIRVToLLVM] Restyled comments and restructured patterns
  • [MLIR][SPIRVToLLVM] Refactored the code to follow clang style

Rebased this patch against master to include changes to DirectPatternClass.

This revision was automatically updated to reflect the committed changes.