This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Use separate attribute for (version, capabilities, extensions)
ClosedPublic

Authored by antiagainst on Mar 9 2020, 1:54 PM.

Details

Summary

We also need the (version, capabilities, extensions) triple on the
spv.module op. Thus far we have been using separate 'extensions'
and 'capabilities' attributes there and 'version' is missing. Creating
a separate attribute for the trip allows us to reuse the assembly
form and verification.

Diff Detail

Event Timeline

antiagainst created this revision.Mar 9 2020, 1:54 PM
Herald added a project: Restricted Project. · View Herald Transcript
denis13 accepted this revision.Mar 10 2020, 2:01 AM

LGTM! Thanks!

This revision is now accepted and ready to land.Mar 10 2020, 2:01 AM
mravishankar accepted this revision.Mar 10 2020, 11:23 AM

This is awesome! Thanks!

mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h
59

Nit: can you just take an integer here?

antiagainst marked 2 inline comments as done.Mar 11 2020, 12:14 PM
antiagainst added inline comments.
mlir/include/mlir/Dialect/SPIRV/TargetAndABI.h
59

This constructor's purpose is to avoid recreating the IntegerAttr if already having one. So I have it this one. Normally one should use the above.

This revision was automatically updated to reflect the committed changes.
antiagainst marked an inline comment as done.