[PATCH] D96700: [llvm][Aarch64][SVE] Remove extra fmov instruction with certain literals

David Truby via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 15 06:29:42 PST 2021


DavidTruby added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td:566-567
+            (DUP_ZR_D (MOVi64imm (bitcast_fpimm_to_i64 f64:$val)))>;
+ def : Pat<(nxv4f64 (AArch64dup (f64 fpimm:$val))),
+            (DUP_ZR_D (MOVi64imm (bitcast_fpimm_to_i64 f64:$val)))>;
+
----------------
paulwalker-arm wrote:
> `nxv4f64` is not a legal type and thus this pattern will have no affect.
My mistake I must have not been thinking very hard when I added these!


================
Comment at: llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td:560
+  // Duplicate immediate FP into all vector elements.
+  def : Pat<(nxv2f32 (AArch64dup (f32 fpimm:$val))),
+            (DUP_ZR_S (MOVi32imm (bitcast_fpimm_to_i32 f32:$val)))>;
----------------
david-arm wrote:
> paulwalker-arm wrote:
> > david-arm wrote:
> > > It looks like this probably needs a 
> > > `let AddedComplexity = 2`
> > > like the patterns below. Also, should we be also adding patterns for `half` and `double` too?
> > @david-arm : What have you spotted to say this?  The tests suggest AddedComplexity is not required?
> Well, I guess I haven't seen specific tests that require this. I just thought this was consistent with the patterns below that's all, but maybe I've just misunderstood something!
Adding it seems to break a number of other unrelated tests so I think it's best to leave it out


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96700/new/

https://reviews.llvm.org/D96700



More information about the llvm-commits mailing list