This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Migrate to use specalized enum attributes
ClosedPublic

Authored by antiagainst on Aug 5 2022, 9:54 PM.

Details

Summary

Previously we are using IntegerAttr to back all SPIR-V enum
attributes. Therefore we all such attributes are showed like
IntegerAttr in IRs, which is barely readable and breaks
roundtripability of the IR. This commit changes to use
EnumAttr as the base directly so that we can have separate
attribute definitions and better IR printing.

Diff Detail

Event Timeline

antiagainst created this revision.Aug 5 2022, 9:54 PM
Herald added a project: Restricted Project. · View Herald Transcript
antiagainst requested review of this revision.Aug 5 2022, 9:54 PM
kuhar accepted this revision.Aug 9 2022, 8:12 AM

Looks fine to me. I'm not very familiar with this part of many of the changed files, so please wait for a second approval before submitting.

mlir/lib/Target/SPIRV/Serialization/Serializer.cpp
197–199

ubernit: auto mm = and auto am = ?

This revision is now accepted and ready to land.Aug 9 2022, 8:12 AM
antiagainst marked an inline comment as done.Aug 9 2022, 11:06 AM
This revision was landed with ongoing or failed builds.Aug 9 2022, 11:15 AM
This revision was automatically updated to reflect the committed changes.