[llvm] [AArch64] Convert concat(uhadd(a,b), uhadd(c,d)) to uhadd(concat(a,c), concat(b,d)) (PR #79464)

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 06:31:21 PST 2024


================
@@ -18172,6 +18172,17 @@ static SDValue performConcatVectorsCombine(SDNode *N,
           return DAG.getNode(N0Opc, dl, VT, N00Source, N01Source);
       }
     }
+
+    // For a concat of two [u]avgfloors with a 128-bit destination size, combine
+    // into an avg of two contacts of the source vectors.
+    // eg: concat(uhadd(a,b), uhadd(c, d)) -> uhadd(concat(a, c), concat(b, d))
+    if (N0Opc == ISD::AVGFLOORU && VT.is128BitVector() && N0->hasOneUse() &&
+        N1->hasOneUse()) {
+      EVT PairVT = N00VT.getDoubleNumVectorElementsVT(*DAG.getContext());
----------------
davemgreen wrote:

I think PairVT is just VT?

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


More information about the llvm-commits mailing list