[llvm] [SPIRV] Handle unknown intrinsics (PR #166284)

Alex Voicu via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 07:54:19 PST 2025


AlexVlx wrote:

> Hello! What's the end goal here? Seems like you want to allow any intrinsic to be lowered to external calls when targeting AMDGPU. Do you plan to this as a valid flow? Is the goal to compile something -> SPIR-V + external to then simplify lifting back the SPIR-V to LLVM IR with proper intrinsics to feed it in a driver or something?

Very good questions, thank you! This is already the flow we have in place / use, via the translator. The core benefit is the retention of target specific intrinsics, which then get consumed by the target BE which knows what to do with them. Orthogonally to AMDGPU (as this is not gated on AMDGPU), it does give a side-channel for handling intrinsics that are known to GISEL, but aren't currently handled by the BE - the test illustrates a case of this. As @MrSidims pointed out above, we'll eventually want to have valid SPIR-V lowerings for all vanilla LLVM intrinsics, but until we get there this would allow targets to make forward progress / extant code using builtins or intrinsics directly (ick) to just work with SPIR-V, rather than having to refactor. Hopefully that makes some amount of sense.

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


More information about the llvm-commits mailing list