Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIR-V translator is failed to translate "unsupported" vectors. #645

Open
bader opened this issue Jul 19, 2020 · 0 comments
Open

SPIR-V translator is failed to translate "unsupported" vectors. #645

bader opened this issue Jul 19, 2020 · 0 comments
Labels
agenda Tooling Call Agenda

Comments

@bader
Copy link
Contributor

bader commented Jul 19, 2020

Here is an example of OpenCL program SPIR-V translator fails to translate because InstCombine pass changes vector type to another vector type with the same size, but different # of elements.

long3 y;

kernel void foo(global int *x) {
    x[0] = y.x;
}

https://godbolt.org/z/oMM9qv - LLVM IR contains 6 - element vectors. Changing data types in this example we can get a lot of vector types, which will be rejected by SPIR-V translator if SPV_INTEL_vector_compute extension is not supported.

bader added a commit to bader/llvm that referenced this issue Jul 20, 2020
This is temporary work-around for a problem reported here:
KhronosGroup/SPIRV-LLVM-Translator#645

InstCombine canonical form for this pattern
```
  // Example (little endian):
  //   trunc (extractelement <4 x i64> %X, 0) to i32
  //   --->
  //   extractelement <8 x i32> (bitcast <4 x i64> %X to <8 x i32>), i32 0
```
can't be lowered by SPIR-V translator to "standard" format.
bader added a commit to intel/llvm that referenced this issue Jul 22, 2020
This is temporary work-around for a problem reported here:
KhronosGroup/SPIRV-LLVM-Translator#645

InstCombine canonical form for this pattern
```
  // Example (little endian):
  //   trunc (extractelement <4 x i64> %X, 0) to i32
  //   --->
  //   extractelement <8 x i32> (bitcast <4 x i64> %X to <8 x i32>), i32 0
```
can't be lowered by SPIR-V translator to "standard" format.
@bader bader added the agenda Tooling Call Agenda label Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agenda Tooling Call Agenda
Projects
None yet
Development

No branches or pull requests

1 participant