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

Rin Dobrescu via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 04:24:58 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))
----------------
Rin18 wrote:

> Can this optimisation also work for dests that are 64 bits too? I'm thinking of cases like this:
> 
> concat(v4i8 uhadd(v4i8 a, v4i8 b), v4i8 uhadd(v4i8 c, v4i8 d))
> 
> where the result is actually a legal NEON vector - v8i8? I imagine doing the concats on the inputs first will help with codegen too because the uhadd operation will then be legal I think.

I think for legal NEON vectors there isn't a concat used so the optimisation won't apply for 64-bits. 

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


More information about the llvm-commits mailing list