[llvm] [AArch64] Fold COPY(y:gpr, DUP(x:fpr, i)) -> UMOV(y:gpr, x:fpr, i) (PR #89017)

David Green via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 01:20:08 PDT 2024


davemgreen wrote:

Morning - I was looking into https://godbolt.org/z/njh7rs44G. Are most of the changes due to G_EXTRACT_VECTOR_ELT requiring the result to be a FPR? Is it possible to change that?

I recently manage to commit #81453, which made some changes to G_INSERT_VECTOR_ELT. I have a similar patch for extract, but it looks like it is mostly handling legalization not changing selection/regbank. (And could do with some cleanup).

The regbank for insert in https://github.com/llvm/llvm-project/pull/81453/files#diff-c2b6149d4ce96115e46b03ba19778fe7dd911412078c302ace57ac14364f5227 does two things - it re-uses FPR/GPR if the input is already known to be a give type, and extends small i8/i16 values to i32. The second part is something different that we can do separately, but is the first part possible to use for extracts too? The selection might change, which might mean fixing the i32 issue too.

I might try and upload the patch for extract I have, but I don't think it is making these selection parts better yet. (And it still looks quite messy). The ideal in the end is that we can share the same tablegen patterns between SDAG and GISEL.

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


More information about the llvm-commits mailing list