[PATCH] D106555: [PowerPC] handle more splat loads

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 04:13:20 PDT 2021


nemanjai added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:9071
 
+static bool IsValidSplatLoad(const PPCSubtarget &Subtarget, SDValue &Op,
+                             unsigned &Opcode) {
----------------
Why take `Op` as a non-const reference? I don't see it being modified so it is not an output operand AFAICT.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrVSX.td:2839
+          (v4i32 (XXSPLTW (SUBREG_TO_REG (i64 1), (LFIWZX ForceXForm:$A), sub_64), 1))>;
+def : Pat<(v8i16 (PPCldsplat ForceXForm:$A)),
+          (v8i16 (VSPLTHs 3, (MTVSRD (INSERT_SUBREG (i64 (IMPLICIT_DEF)), (LHZX ForceXForm:$A), sub_32))))>;
----------------
As far as I can tell, this is in a block that only sets `let Predicates = [VSX]`. It is not safe to use direct moves on subtargets that don't have direct moves.


================
Comment at: llvm/test/CodeGen/PowerPC/load-and-splat.ll:223
+; P7-NEXT:    lhzx r4, 0, r4
+; P7-NEXT:    mtvsrd v2, r4
+; P7-NEXT:    vsplth v2, v2, 3
----------------
Definitely bad. P7 doesn't have direct moves.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106555



More information about the llvm-commits mailing list