[llvm] [AArch64] Convert UADDV(add(zext, zext)) into UADDLV(concat). (PR #78301)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 17 01:38:28 PST 2024
================
@@ -16528,6 +16531,34 @@ static SDValue performUADDVAddCombine(SDValue A, SelectionDAG &DAG) {
return DAG.getNode(Opcode, SDLoc(A), VT, Ext0.getOperand(0));
};
+ // We can convert a UADDV(add(zext(64-bit source), zext(64-bit source))) into
+ // UADDLV(concat), where the concat represents the 64-bit zext sources.
+ auto DetectZextConcat = [&](SDValue A, SelectionDAG &DAG) {
+ // Look for add(zext(64-bit source), zext(64-bit source)), returning
+ // UADDLV(concat(zext, zext)) if found.
+ if (A.getOpcode() != ISD::ADD)
+ return SDValue();
+ EVT VT = A.getValueType();
+ if (VT != MVT::v4i32)
+ return SDValue();
+ SDValue Op0 = A.getOperand(0);
+ SDValue Op1 = A.getOperand(1);
+ if (Op0.getOpcode() != ISD::ZERO_EXTEND)
----------------
david-arm wrote:
This might explain some of the odd regressions in the existing tests perhaps?
https://github.com/llvm/llvm-project/pull/78301
More information about the llvm-commits
mailing list