[llvm] [AMDGPU] Fix an issue that wrong index is used in calculation of byte provider when the op is extract_vector_elt (PR #91697)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 16:07:51 PDT 2024


shiltian wrote:

> We don't gain anything from looking into the vectors for scalarsize >= 32. calculateSrcByte will just return the Op since vector handling hasn't been built yet, and then we will need to re-extract the dword when building the perm https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/SIISelLowering.cpp#L12193 -- by disallowing them, we avoid some unecessary computation. Additionally, it does not introduce the regression mentioned above.
> 
> On the other hand, we want to continue looking through to the vector for 8 and 16 bit scalars, as the vector that we are extracting from is usually the common source of permutation (and not the extracted value itself).

Good to know. Thanks for your explanation. I have updated the patch.

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


More information about the llvm-commits mailing list