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

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 14 16:00:54 PST 2024


================
@@ -540,6 +540,45 @@ struct BinaryOpc_match {
   }
 };
 
+/// Matching while capturing mask
+template <typename T0, typename T1> struct SDShuffle_match {
+  T0 Op1;
+  T1 Op2;
+
+  const ArrayRef<int> *MaskRef;
----------------
mshockwave wrote:

I think you forgot to store the captured mask to here. Also, `MaskRef` is declared as a pointer to a constant object, so you can't assign any new value to that object. You probably want to use non-constant pointer or reference.

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


More information about the llvm-commits mailing list