[llvm] [AArch64][GlobalISel] Improve lowering of vector fp16 fptrunc and fpext (PR #163398)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 01:17:28 PDT 2025


================
@@ -133,6 +137,97 @@ bool isZeroExtended(Register R, MachineRegisterInfo &MRI) {
   return MRI.getVRegDef(R)->getOpcode() == TargetOpcode::G_ZEXT;
 }
 
+// This patten aims to match the following shape to avoid extra mov instructions
+// G_BUILD_VECTOR(
+//   G_UNMERGE_VALUES(src, 0)
+//   G_UNMERGE_VALUES(src, 1)
+//   G_IMPLICIT_DEF
+//   G_IMPLICIT_DEF
+// )
+// ->
+// G_CONCAT_VECTORS(
----------------
davemgreen wrote:

I think it should be concat(src, undef). We can create a new undef of the same type as src.

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


More information about the llvm-commits mailing list