[llvm] SD Pattern Match: Operands patterns with VP Context (PR #103308)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 10:17:09 PDT 2024


================
@@ -464,7 +467,7 @@ struct TernaryOpc_match {
   bool match(const MatchContext &Ctx, SDValue N) {
     if (sd_context_match(N, Ctx, m_Opc(Opcode))) {
       EffectiveOperands<ExcludeChain> EO(N);
-      assert(EO.Size == 3);
+      assert(EO.Size == 3U + 2 * N->isVPOpcode());
----------------
v01dXYZ wrote:

We could add another template argument `bool ExcludeVPArgs`. When set to `true` and a VP Node, `TotalNumOperands := N->getNumOperands() - 2`.

It supposes the implicit convention that with VP nodes the last two args are for mask and vector length. Do you want me to search if it is always true and write it down here ?

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


More information about the llvm-commits mailing list