[clang] [llvm] [CLANG][LLVM][AArch64]SME2.1 intrinsics for MOVAZ tile to 2/4 vectors (PR #88710)

Momchil Velikov via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 08:00:53 PDT 2024


================
@@ -1985,6 +1986,34 @@ void AArch64DAGToDAGISel::SelectMultiVectorMove(SDNode *N, unsigned NumVecs,
   CurDAG->RemoveDeadNode(N);
 }
 
+template <unsigned MaxIdx, unsigned Scale>
+void AArch64DAGToDAGISel::SelectMultiVectorMoveZ(SDNode *N, unsigned NumVecs,
----------------
momchil-velikov wrote:

The real question is why is this is a function template or, if you want, why `AArch64DAGToDAGISel::SelectMultiVectorMove` is a function template? Both the template parameters do not affect any type, so we aren't benefiting from any kind of parametric polymorphism, the parameters themselves are only passed as ordinary parameters to `SelectSMETileSlice` and as such can't participate in any constant folding that would warrant multiple instantiations (each of which is essentially a specialisation of the function).
IMHO, it's OK to have the `Scale` and `NumVecs` separate since `SelectMultiVectorMove` is a hint we may need it some day.

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


More information about the llvm-commits mailing list