[llvm] [DirectX] Scalarize `extractelement` and `insertelement` with dynamic indices (PR #141676)
Deric C. via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 18 11:29:18 PDT 2025
Icohedron wrote:
> It just came to me that the implementation still needs more work. Two issues:
>
> 1. Two `insertelement` instructions on the same vector currently is incorrect because they affect each other's results, which shouldn't be the case.
> 2. If `extractelement` or `insertelement` is used on a vector that is not a function arg, then the stores to the alloca are invalid because they reference a vector that is not yet defined.
Fixed 1. by loading the original value and storing it back after constructing the vector for insertelement.
Fixed 2. by moving the array initialization (copying vector contents to the array) to immediately after where the instruction where the vector is defined.
https://github.com/llvm/llvm-project/pull/141676
More information about the llvm-commits
mailing list