This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][SPIRVToLLVM] Implementation of bitwise and logical not
ClosedPublic

Authored by georgemitenkov on Jun 26 2020, 3:17 AM.

Details

Summary

This patch introduces new conversion patterns for bit and logical negation op: spv.Not and spv.LogicalNot. They are implemented by applying xor on the operand and mask with all bits set.

Diff Detail

Event Timeline

georgemitenkov created this revision.Jun 26 2020, 3:17 AM
georgemitenkov edited the summary of this revision. (Show Details)Jun 26 2020, 3:18 AM
  • [MLIR][SPIRVToLLVM] Removed commented out code

Removed the code for commented out pattern.

Harbormaster completed remote builds in B61889: Diff 273642.
ftynse accepted this revision.Jun 26 2020, 6:59 AM

LGTM after addressing the comments

mlir/lib/Conversion/SPIRVToLLVM/ConvertSPIRVToLLVM.cpp
56

Nit: please put a full stop at the end of each sentence. (https://llvm.org/docs/CodingStandards.html#commenting)

187

Is this cast necessary? AFAIR, VectorType derives from ShapedType

This revision is now accepted and ready to land.Jun 26 2020, 6:59 AM
georgemitenkov marked 2 inline comments as done.
  • [MLIR][SPIRVToLLVM] Addressed comments on NotPattern conversion class

Added a full stop at the end of each sentence. When creating a vector constant with all bits set, cast of srcType to VectorType is used instead of ShapedType. The cast is necessary for type checks.

antiagainst accepted this revision.Jun 29 2020, 4:15 PM
This revision was automatically updated to reflect the committed changes.