[llvm] [SPIR-V] Support `nonuniformindex` intrsinsic in SPIRV CodeGen. (PR #162540)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 09:00:53 PDT 2025


https://github.com/MrSidims commented:

High level comment/question: adding an intrinic is a solid approach, but I can't stop myself but wonder, if we want to add new intrinsic for each new decoration. There are some other potential candidates for this:
1. existing spirv.Decoration metadata (which might not work great here, as it require some tricky frontend modifications to be emitted in the first place);
2. (don't remember if it's done in SPIR-V BE) intrinsics like var/ptr/global annotation - this can be simply emitted by annotation attribute in clang (and can be incapsulated in higher language API implementation).

Those mechanisms have their cons: both metadata and annotation intrinsics can be dropped by optimizer, hence we shouldn't use them when semantics is affected. But this feature seem to be performance-related, so technically we can reuse one of these mechanisms.

This is not a blocker, I just want to align for the future progress.

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


More information about the llvm-commits mailing list