[llvm] [PowerPC] Improve pwr7 codegen for v4i8 load (PR #104507)

Chen Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 21:28:09 PDT 2024


================
@@ -11490,13 +11490,38 @@ SDValue PPCTargetLowering::LowerIS_FPCLASS(SDValue Op,
 SDValue PPCTargetLowering::LowerSCALAR_TO_VECTOR(SDValue Op,
                                                  SelectionDAG &DAG) const {
   SDLoc dl(Op);
+
+  MachineFunction &MF = DAG.getMachineFunction();
+  SDValue Op0 = Op.getOperand(0);
+  ReuseLoadInfo RLI;
+  if (Subtarget.hasVSX() && Op.getValueType() == MVT::v4i32 &&
+      Op0.getOpcode() == ISD::LOAD && Op0.getValueType() == MVT::i32 &&
+      Op0.hasOneUse() &&
+      canReuseLoadAddress(Op0, MVT::i32, RLI, DAG, ISD::NON_EXTLOAD)) {
+
----------------
chenzheng1030 wrote:

This seems like should be lowered to `PPCISD::LD_SPLAT` instead of expanding it here. `BUILD_VECTOR` did the same way.

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


More information about the llvm-commits mailing list