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

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 03:26:31 PST 2024


================
@@ -18200,6 +18200,19 @@ static SDValue performConcatVectorsCombine(SDNode *N,
     return true;
   };
 
+  // concat(uhadd(a, b), uhadd(c, d)) -> uhadd(concat(a, c), concat(b, d))
+  if (N0Opc == ISD::AVGFLOORU && N1Opc == ISD::AVGFLOORU) {
----------------
david-arm wrote:

Do we also want to only perform the optimisation if there is just one use of both operands? i.e. you might have something like

  %u1 = uhadd a, b
  %u2 = uhadd b, c
  %c = concat(%u1, %u2)
  %u3 = add %u1, %u2


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


More information about the llvm-commits mailing list