This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][spirv] Allow specifying availability on enum attribute cases
ClosedPublic

Authored by antiagainst on Dec 27 2019, 1:30 PM.

Details

Summary

Lots of SPIR-V ops take enum attributes and certain enum cases
need extra capabilities or extensions to be available. This commit
extends to allow specifying availability spec on enum cases.
Extra utility functions are generated for the corresponding enum
classes to return the availability requirement. The availability
interface implemention for a SPIR-V op now goes over all enum
attributes to collect the availability requirements.

Diff Detail

Event Timeline

antiagainst created this revision.Dec 27 2019, 1:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 27 2019, 1:30 PM

Unit tests: pass. 61132 tests passed, 0 failed and 728 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

mravishankar accepted this revision.Jan 2 2020, 9:56 AM

SPIR-V parts look good to me. Would still prefer the version/capability related methods into a separate file. They seem to have disjoint functionality (but its a personal preference).

This revision is now accepted and ready to land.Jan 2 2020, 9:56 AM

Would still prefer the version/capability related methods into a separate file.

You mean in the SPIR-V dialect or the TableGen backend? For the former I'm open to suggestions given that they will stay as what is implemented here for the foreseeable future (minus minor changes maybe) so having a clean library structure makes sense. For the latter, I won't worry that much given that eventually they will be moved to a proper place in core.

This revision was automatically updated to reflect the committed changes.