This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][SPIRV] Add `UnsignedOp` trait.
ClosedPublic

Authored by ergawy on Jan 5 2021, 1:08 AM.

Details

Summary

This commit adds a new trait that can be attached to ops that have
unsigned semantics.

TODO:

  • Check if other places in code can use the new attribute (possibly in this patch).
  • Add a similar SignedOp attribute (in a new patch).

Diff Detail

Event Timeline

ergawy created this revision.Jan 5 2021, 1:08 AM
ergawy requested review of this revision.Jan 5 2021, 1:08 AM
ergawy edited the summary of this revision. (Show Details)Jan 5 2021, 1:10 AM
antiagainst requested changes to this revision.Jan 5 2021, 5:07 AM

This looks awesome! Thanks so much! Just one request.

mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOps.h
26

Could you create another header file for hosting this trait? (I expect we will have more traits later so it's better to have a proper structure from the beginning.) :D

This revision now requires changes to proceed.Jan 5 2021, 5:07 AM
ergawy updated this revision to Diff 314801.Jan 5 2021, 10:39 PM

Add a new header for Op traits.

ergawy marked an inline comment as done.Jan 5 2021, 10:40 PM
antiagainst accepted this revision.Jan 6 2021, 4:34 AM

Just two remaining nits. Feel free to land after fixing them.

mlir/include/mlir/Dialect/SPIRV/IR/SPIRVOpTraits.h
2

This should be updated to match the filename.

19

Please use an empty line to separate namespace and declarations enclosed inside.

This revision is now accepted and ready to land.Jan 6 2021, 4:34 AM
ergawy updated this revision to Diff 314870.Jan 6 2021, 5:53 AM

Handle some formatting comments.

ergawy marked 2 inline comments as done.Jan 6 2021, 5:54 AM
This revision was automatically updated to reflect the committed changes.