[llvm] [AArch64][GlobalISel] Legalize Insert vector element (PR #81453)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 00:25:06 PST 2024


================
@@ -141,6 +141,7 @@ def : GINodeEquiv<G_CTLZ_ZERO_UNDEF, ctlz_zero_undef>;
 def : GINodeEquiv<G_CTTZ_ZERO_UNDEF, cttz_zero_undef>;
 def : GINodeEquiv<G_CTPOP, ctpop>;
 def : GINodeEquiv<G_EXTRACT_VECTOR_ELT, extractelt>;
+def : GINodeEquiv<G_INSERT_VECTOR_ELT, vector_insert>;
----------------
davemgreen wrote:

I'm not sure that's really true though, from what I can tell. I know there are comments saying it is deprecated, but an i8 isn't a legal type in AArch64 - we want it to be an i32 inserted into a v16i8 vector. It's the same as buildvectors, where the operands can be truncated to allow legal types to be inserted into a vector with smaller elements. Multiple other backends still use vector_insert.

We could probably be using insertelt a little more in the aarch64 backend where we know the types should match, so maybe it would be good to have both as Equivs, but we don't want to be using it everywhere.

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


More information about the llvm-commits mailing list