[llvm] Add SD matchers and unit test coverage for ISD::VECTOR_SHUFFLE (PR #119592)

Aidan Goldfarb via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 10:25:47 PST 2024


================
@@ -540,6 +549,25 @@ struct BinaryOpc_match {
   }
 };
 
+/// Matches shuffle.
+template <typename T0, typename T1> struct SDShuffle_match {
+  T0 Op1;
+  T1 Op2;
+  ArrayRef<int> Mask;
+
+  SDShuffle_match(const T0 &Op1, const T1 &Op2, const ArrayRef<int> &Mask)
----------------
AidanGoldfarb wrote:

Thank you for the detailed response. In my most recent push I implemented both variants. I considered doing them with a single `SDShuffle_match` struct but split it in two for simplicity. I updated the unit tests to test for each of these scenarios.

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


More information about the llvm-commits mailing list