This is an archive of the discontinued LLVM Phabricator instance.

[SPIR-V] Allow setting SPIR-V version via target triple
ClosedPublic

Authored by Anastasia on May 2 2022, 8:56 AM.

Details

Summary

As per RFC: https://discourse.llvm.org/t/setting-version-environment-and-extensions-for-spir-v-target/62018 this patch adds ability to set version of SPIR-V using sub-arch field in the target triple.

Currently available versions are from v1.0 to v1.4, however other versions can be added in the future as needed.

Diff Detail

Event Timeline

Anastasia created this revision.May 2 2022, 8:56 AM
Anastasia requested review of this revision.May 2 2022, 8:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2022, 8:56 AM
Anastasia edited the summary of this revision. (Show Details)May 6 2022, 1:51 AM
Anastasia added a subscriber: cfe-commits.

@Anastasia, when are you going to add support for v1.5? We would use it in the SPIR-V backend.

linjamaki added inline comments.May 9 2022, 1:46 AM
llvm/docs/SPIRVUsage.rst
55

Should the explicit unknown string default to the generic SPIR-V too? Maybe change this to ''unknown'' or *<empty>* here?

63

’’unknown’’ or *<empty>* here too?

71

’’unknown’’ or *<empty>* here too?

@Anastasia, when are you going to add support for v1.5? We would use it in the SPIR-V backend.

Ok, I can add it straight away if there is a use-case. So far I have taken the list from what the llvm-spirv translator supports.

Anastasia updated this revision to Diff 428118.May 9 2022, 9:58 AM
  • Added v1.5.
  • Changed wording in documentation.
Anastasia marked 3 inline comments as done.May 9 2022, 9:59 AM
tschuett added inline comments.
llvm/docs/SPIRVUsage.rst
15

described

Anastasia updated this revision to Diff 429678.May 16 2022, 4:05 AM

Fixed typo in docs

Anastasia marked an inline comment as done.May 16 2022, 4:05 AM
svenvh accepted this revision.May 19 2022, 9:15 AM

LGTM

This revision is now accepted and ready to land.May 19 2022, 9:15 AM
This revision was landed with ongoing or failed builds.May 23 2022, 6:24 AM
This revision was automatically updated to reflect the committed changes.