Page MenuHomePhabricator

[mlir][spirv] Use spv.vce in spv.module and wire up (de)serialization
ClosedPublic

Authored by antiagainst on Mar 9 2020, 2:04 PM.

Details

Summary

This commits changes the definition of spv.module to use the #spv.vce
attribute for specifying (version, capabilities, extensions) triple
so that we can have better API and custom assembly form. Since now
we have proper modelling of the triple, (de)serialization is wired up
to use them.

With the new UpdateVCEPass, we don't need to manually specify the
required extensions and capabilities anymore when creating a spv.module.
One just need to call UpdateVCEPass before serialization to get the
needed version/extensions/capabilities.

Depends On D75871

Diff Detail

Event Timeline

antiagainst created this revision.Mar 9 2020, 2:04 PM
Herald added a reviewer: herhut. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
mravishankar accepted this revision.Mar 10 2020, 12:13 PM

Nice cleanup!

This revision is now accepted and ready to land.Mar 10 2020, 12:13 PM
mehdi_amini added inline comments.Mar 10 2020, 6:42 PM
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
1

Doesn't seem intended?

antiagainst marked 2 inline comments as done.

Address comments

antiagainst added inline comments.Mar 11 2020, 1:06 PM
mlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
1

Oops! Thanks for the good catch!

This revision was automatically updated to reflect the committed changes.