[clang] [llvm] [SPIRV] Add more id and range builtIns (PR #143909)

Victor Lomuller via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 24 07:54:43 PDT 2025


Naghasan wrote:

> all built-ins are represented using global variables in a specific AS with the associated metadata to generate the decoration.

For the HLSL FE, there are already a few ids represented using intrinsics (unfortunately they use the DXIL naming rather than the SPIR-V but that's another point). I extended on that, were there reasons to not pursue this ?

> The reason for this is we wanted to make sure the final load/store to be explicit, and possibly optimized-out.

The intrinsic model will achieve the same thing for Inputs: they are modeled as pure, so 2 calls with the same parameters will be folded into 1 call and unused will be removed. For Outputs, I don't know (out of scope of what I'm trying to achieve).

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


More information about the cfe-commits mailing list