[llvm] [LegalizeTypes] Handle non byte-sized elt types when splitting INSERT/EXTRACT_VECTOR_ELT (PR #93357)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 13:36:37 PDT 2024


bjope wrote:

> Is there some reason we want to create a new EXTRACT_VECTOR_ELT, but not a new INSERT_VECTOR_ELT?

I think that some earlier step should have choosen to widen instead of split the vector if such legalization is preferred for the INSERT_VECTOR_ELT case.
And since SplitVecRes_INSERT_VECTOR_ELT should return a pair of vectors (the lo/hi halfs) it is a bit unclear to me how to do it.. One widened INSERT_VECTOR_ELT with a split+trunc afterwards? And then hope for that the split+trunc are cheap to legalize.

I think optimizing that situation is out-of-scope for this patch anyway. This patch is just supposed to support some scenatios for which we either hit assertion failure of miscompiled in the past. But if suddenly the legalization here is considered as performance critical, then we can follow up with optimizations later. We would need some test cases that show the benefit of doing it some other way, and I don't know about any such test cases.

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


More information about the llvm-commits mailing list