[llvm] [PowerPC] Implement a more efficient memcmp in cases where the length is known. (PR #158657)
zhijian lin via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 22 08:30:45 PDT 2025
================
@@ -15556,6 +15556,63 @@ SDValue PPCTargetLowering::combineSetCC(SDNode *N,
SDValue Add = DAG.getNode(ISD::ADD, DL, OpVT, LHS, RHS.getOperand(1));
return DAG.getSetCC(DL, VT, Add, DAG.getConstant(0, DL, OpVT), CC);
}
+ if (Subtarget.hasVSX()) {
+ if (LHS.getOpcode() == ISD::LOAD && RHS.getOpcode() == ISD::LOAD &&
+ LHS.hasOneUse() && RHS.hasOneUse() &&
+ LHS.getValueType() == MVT::i128 && RHS.getValueType() == MVT::i128) {
+ SDLoc DL(N);
+ SelectionDAG &DAG = DCI.DAG;
+ auto *LA = dyn_cast<LoadSDNode>(LHS);
+ auto *LB = dyn_cast<LoadSDNode>(RHS);
+ if (!LA || !LB)
+ return SDValue();
----------------
diggerlin wrote:
good catch, I will fix it, thanks, I thought that the ISD::SETCC only return i1, and the function PPCTargetLowering::DAGCombineTruncBoolExt only deal with i32 and i64, so I return SDValue() here directly. but the ISD::SETCC maybe return i32/i64 too.
https://github.com/llvm/llvm-project/pull/158657
More information about the llvm-commits
mailing list