Skip to content

[SPIR-V] Set non-kernel function linkage type via OpDecorate for all linkage types except for static functions #91595

@VyacheslavLevytskyy

Description

@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.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions