| Issue |
91595
|
| Summary |
[SPIR-V] Set non-kernel function linkage type via OpDecorate for all linkage types except for static functions
|
| Labels |
new issue
|
| Assignees |
VyacheslavLevytskyy
|
| Reporter |
VyacheslavLevytskyy
|
Now SPIR-V Backend generates linkage type declaration via OpDecorate only for external and linkonce_odr linkage types. This makes it impossible to use, for example, `extern_weak` functions. The following example would crash:
```
define i32 @abs(i32 noundef %x) {
entry:
%call = tail call spir_func i32 @__devicelib_abs(i32 noundef %x) #11
ret i32 %call
}
declare extern_weak i32 @__devicelib_abs(i32 noundef)
```
We should fix the behaviour, probably in a way that corresponds to Khronos SPIRV Translator that sets non-kernel function linkage type via OpDecorate for all linkage types except for static functions.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs