llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.03k stars 11.58k forks source link

ICE when compiling OpenCL kernels for Arm CPU #50185

Open AnastasiaStulova opened 3 years ago

AnastasiaStulova commented 3 years ago
Bugzilla Link 50841
Version unspecified
OS All
CC @AnastasiaStulova

Extended Description

Compiling any valid OpenCL C source with kernel results in ICE.

Example:

kernel void foo(__global int ptr) { ptr = 1; };

Command line: clang-13 --target=arm-linux-gnueabi test.cl

The compilation fails with ICE: fatal error: error in backend: Unsupported calling convention

This due to the fact that we add SPIR_KERNEL calling convention by default to all kernels but the targets are expected to override it if they don't handle it.

AnastasiaStulova commented 3 years ago

Patch in review: https://reviews.llvm.org/D104858