[PATCH] D104858: [OpenCL][ARM] Fix ICE when compiling a kernel

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 6 05:15:53 PDT 2021


Anastasia added a comment.

In D104858#2857958 <https://reviews.llvm.org/D104858#2857958>, @pekka.jaaskelainen wrote:

>> The reason why we would like to fix it is that upstream clang has a crash currently when OpenCL sources are compiled for any Arm CPU: https://bugs.llvm.org/show_bug.cgi?id=50841. Do you have any other suggestions to avoid this problem?
>>
>> FYI clang also emits kernel metadata that can be used to detect kernels...
>
> Unfortunately I cannot look at this in detail right now, but I'll reply quickly for a heads up: The problem was not how to detect kernels, but the ABI/CC mismatch to the
> clSetKerneArg() with (user facing) arguments that get split to multiple args or vice versa. E.g. x86 ABI had a CC where 2xfloat gets to 1xdouble in the generated function
> finger print, thus there was no 1:1 match of the kernel arguments to the OpenCL-facing ones (making clSetKernelArg calls difficult to implement robustly).
>
> IIRC, SPIR_KERNEL CC was used to force the 1:1 mapping and produce a portable way to handle this OpenCL API e.g. with struct args etc.

Ok, thanks for clarification. Does it mean there is something we need to add to LLVM somewhere to make it work correctly? Would it be specific to Arm or generally for all CPU targets?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104858/new/

https://reviews.llvm.org/D104858



More information about the cfe-commits mailing list