[libclc] [libclc] Restore always_inline for SPIR-V targets (PR #202891)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 10 23:21:20 PDT 2026


Eric-Guo-NXP wrote:

> perhaps change -O0 to -disable-llvm-passes can solve your problem?

I tried `-disable-llvm-passes` as suggested, but it does not work for SPIR-V targets.

While it does preserve function bodies, running no passes means the libclc helpers keep their `Import` LinkageAttributes unresolved. `llvm-spirv` then emits functions that have a body and are decorated with `Import`, which fails SPIR-V validation:

```
A function definition (an OpFunction with basic blocks) cannot be
decorated with the Import Linkage Type.
```


https://github.com/llvm/llvm-project/pull/202891


More information about the cfe-commits mailing list