[llvm] [ISel] Replace expensive move from wzr by two moves via floating point immediate (PR #146538)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 14 03:02:03 PDT 2025
================
@@ -8035,6 +8029,18 @@ def MOVIv2d_ns : SIMDModifiedImmVectorNoShift<1, 1, 0, 0b1110, V128,
"movi", ".2d",
[(set (v2i64 V128:$Rd), (AArch64movi_edit imm0_255:$imm8))]>;
+def : Pat<(vector_insert (v8f16 V128:$Rn), (f16 fpimm0), (i64 VectorIndexH:$imm)),
+ (INSvi16lane V128:$Rn, VectorIndexH:$imm,
+ (v8f16 (MOVIv2d_ns (i32 0))), (i64 0))>;
+
+def : Pat<(vector_insert (v4f32 V128:$Rn), (f32 fpimm0), (i64 VectorIndexS:$imm)),
+ (INSvi32lane V128:$Rn, VectorIndexS:$imm,
+ (v4f32 (MOVIv2d_ns (i32 0))), (i64 0))>;
+
+def : Pat<(vector_insert (v2f64 V128:$Rn), (f64 fpimm0), (i64 VectorIndexD:$imm)),
+ (INSvi64lane V128:$Rn, VectorIndexD:$imm,
+ (v2f64 (MOVIv2d_ns (i32 0))), (i64 0))>;
----------------
davemgreen wrote:
I mean - If we remove the INS wzr patterns above, do we need the new patterns or is that already handled by the existing "insert" and "zero a register" patterns?
https://github.com/llvm/llvm-project/pull/146538
More information about the llvm-commits
mailing list