[clang] [llvm] [HLSL] Run finalize linkage pass for all targets (PR #134260)

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 8 12:00:11 PDT 2025


s-perron wrote:

I'm following a design that was put in place by others, so I cannot fully answer all of the questions. However, I'll do my best.

>  Is there some form of linker involved?

No linker is involved yet, but I believe the long term plan is to have some type of linker. When that is available, this pass will become part of it.

> By convention, passes which are required for correctness are part of the backend, so you can't accidentally skip running them.

I want it to be part of clang because it is the HLSL language that is causing the problem. I would prefer to keep the backend language agnostic as much as possible.

The SPIR-V backend  adds the export linkage decoration to function with external linkage in llvm. This is the expected behaviour for OpenCL. However, it is incorrect for HLSL. Without this change, the backend will have to know the llvm-ir came from HLSL and look for the hlsl-export attribute. I don't want to do that.



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


More information about the llvm-commits mailing list