-
Notifications
You must be signed in to change notification settings - Fork 219
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
OpenCL (CLC++2021) compilation to SPIR-V fails #2193
Comments
For reference, I tried the same with clang 18.1 and spirv llvm transpator 18.1, and I am still getting the same error |
@davidrohr thanks for the report and apologies for the long response. I have a feeling, that this issue relates with (quite funny) bug with handling "convert" functions, that was recently fixed in #2443 . May I ask you to check it you example works on main branch? If so, @vmaksimo please backport your patch(es) to release branches. |
Dear @MrSidims : I have just tried with the version llvm_release_180 branch (commit 1745c78) with #2443 cherry-picked, and it still fails. The testcase is attached. The error message is:
|
@davidrohr could you please also try this fix together with the one mentioned above? #2464 |
@vmaksimo : I just tried with #2464 in addition. Still fails in the same way as before. I am attachiing again the clang testcase with the sources: And here is the |
@vmaksimo : Any progress on this? Sorry for bugging, but I am wondering what could be a timescale to get a fix? |
Hi @davidrohr! I was able to reproduce the issue and found out that the problem is in the translation of |
Thx a lot. That was very helpful. Indeed that was a bug on our side. The I fixed it on our side, but now I am running into a different problem, which I have reported here #2531 :(. |
For reference, after the fix mentioned in #2531 and avoiding the printf, the code compiles to spirv now. I am leaving this open until the printf problem is fixed as well. |
@vmaksimo : What is the status of this? I am not using printf any more, so it is not failing for me. But is it meanwhile fixed? |
@davidrohr I've just checked the original reproducer with clang build from LLVM top of the trunk, and apparently it doesn't go to llvm-spirv and crashes earlier: I'm compiling foo.cl with The same error occurs with -emit-llvm --target=spir64-unknown-unknown option. |
well, the current version of our code compiles with LLVM 17, 18 and 19, and I don't intend to follow up possible new issues with our old code version. |
I will try llvm19 tomorrow |
I think, in principle one does not even need to try the original reproducer. The remaining issue was the translation of the printf call, other problems were already fixed. That would be a much simpler reproducer, in case my original one does no longer work with LLVM. |
I opened this issue as an LLVM issue first, but LLVM experts indicated the problem is with the SPIRV-LLVM-Translator:
llvm/llvm-project#68305
Thus I am opening it also here:
Compilation with clang 17.0.2 (on Gentoo Linux) fails with the below error message. I was using clang 15 before, which didn't fail. I also tried clang 16 now, which failed with the same error, I didn't try other versions.
I am attaching a tarball with my .cl file, and with the 2 files in /tmp that clang asked me to attach to the bug report:
bugreport.tar.gz
Command to reproduce:
Error message:
The text was updated successfully, but these errors were encountered: