KhronosGroup / SPIRV-LLVM-Translator

A tool and a library for bi-directional translation between SPIR-V and LLVM IR
Other
469 stars 210 forks source link

Remove support for the internal SPIR-V text format #211

Open kpet opened 5 years ago

kpet commented 5 years ago

The translator currently supports its own textual format for SPIR-V assembly. This format is incompatible with the official format handled by the SPIRV-Tools. It is furthermore poorly tested, probably doesn't support all the corner cases and is generally a liability to the translator code base.

The translator currently produces or consumes this format via three different options:

I'm tempted to suggest that none of this functionality belongs in the translator and that we should get rid of it entirely, using the relevant SPIR-V Tools for testing.

A possible staged approach could be to:

These changes would make it easier to reuse code from SPIR-V tools as suggested in #32.

jigsawecho commented 4 years ago

I did it a couple of years ago in a fork. Is there anyone working on it? The current support to text-format spirv makes the spt test cases difficult to read and write. It would be great to lean against either KhronosGroup/SPIRV-Tools or KhronosGroup/glslang.

svenvh commented 4 years ago

You can write .spvasm tests as of 9977928 ("Add SPIR-V assembly tests", 2019-08-01).

jigsawecho commented 4 years ago

@svenvh Thanks. I see, in this way both text formats are supported.

bwlodarcz commented 6 months ago

@svenvh @MrSidims It's an old topic but it's relevant againt. The current approach is: We should go into using spirv-tools as our default test format and SPT usage should be minimized. In addition to that binary and text formats should be split in parser implementation to improve performance and readability of our main hot path. In the long run SPT should be removed completely and tests should only use spirv-tools. Unfortunately there are a few Intel extensions in preview stage which are supported by translator but aren't in spirv-tools. The possible discussed approaches to extensions problem: