[llvm] [ISel] Replace expensive move from wzr by two moves via floating point immediate (PR #146538)
Julian Nagele via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 11 10:20:29 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))>;
----------------
juliannagele wrote:
Hm, sorry not sure I understand, without those patterns we get the move from wzr (which we want to avoid).
https://github.com/llvm/llvm-project/pull/146538
More information about the llvm-commits
mailing list