[llvm] [SPIRV] Support non-constant indices for vector insert/extract (PR #172514)
Steven Perron via llvm-commits
llvm-commits at lists.llvm.org
Sun Dec 21 10:51:47 PST 2025
s-perron wrote:
> The approach is fine, though for future enhancements we may prevent spilling to the stack by using OpVectorInsertDynamic / OpVectorExtractDynamic, right?
If the size of the vector is legal, then we can. However if we have to split the vector into multiple vectors, we would have to add controlflow or a series of selects to pick the correct vector, and then do the dynamic extract. In general, I think the spill is better because drivers can optimize the spill more easily than the series of selects or control flow.
For cases where we just need to expand the size of the vector to 8 or 16, we could do better.
https://github.com/llvm/llvm-project/pull/172514
More information about the llvm-commits
mailing list