[PATCH] D104858: [OpenCL][ARM] Fix ICE when compiling a kernel
Pekka Jääskeläinen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 5 05:30:29 PDT 2021
pekka.jaaskelainen added a comment.
> 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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104858/new/
https://reviews.llvm.org/D104858
More information about the cfe-commits
mailing list