[llvm] [IA]: Construct (de)interleave4 out of (de)interleave2 (PR #89276)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 15:43:10 PDT 2024


================
@@ -2793,6 +2793,65 @@ inline VScaleVal_match m_VScale() {
   return VScaleVal_match();
 }
 
+template <typename LHS, typename RHS> struct Interleave2_match {
+  LHS L;
+  RHS R;
+
+  Interleave2_match(const LHS &L, const RHS &R) : L(L), R(R) {}
+
+  template <typename ITy> bool match(ITy *V) {
+    auto *I = dyn_cast<IntrinsicInst>(V);
+    if (m_Intrinsic<Intrinsic::experimental_vector_interleave2>().match(V)) {
+      return (L.match(I->getOperand(0)) && R.match(I->getOperand(1)));
+    }
+    return false;
+  }
+};
+
+template <typename LHS, typename RHS>
+inline Interleave2_match<LHS, RHS> m_Interleave2(const LHS &L, const RHS &R) {
+  return Interleave2_match<LHS, RHS>(L, R);
+}
+
+// Match deinterleave tree.
+// if the current user of deinterelave is the last (extract instr) in the tree,
----------------
topperc wrote:

deinterelave -> deinterleave

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


More information about the llvm-commits mailing list