Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.0/patches/2198182/?format=api
{ "id": 2198182, "url": "http://patchwork.ozlabs.org/api/1.0/patches/2198182/?format=api", "project": { "id": 17, "url": "http://patchwork.ozlabs.org/api/1.0/projects/17/?format=api", "name": "GNU Compiler Collection", "link_name": "gcc", "list_id": "gcc-patches.gcc.gnu.org", "list_email": "gcc-patches@gcc.gnu.org", "web_url": null, "scm_url": null, "webscm_url": null }, "msgid": "<bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.6@forge-stage.sourceware.org>", "date": "2026-02-19T14:02:07", "name": "[v2,6/7,Vectorizer] : SLP MATCH Pattern: Allow for more invariants", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "210af962459e10df3d422d164fb989e46388f99b", "submitter": { "id": 92460, "url": "http://patchwork.ozlabs.org/api/1.0/people/92460/?format=api", "name": "Andrei Tirziu via Sourceware Forge", "email": "forge-bot+why@forge-stage.sourceware.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.6@forge-stage.sourceware.org/mbox/", "series": [ { "id": 492684, "url": "http://patchwork.ozlabs.org/api/1.0/series/492684/?format=api", "date": "2026-02-19T14:02:02", "name": "Vectorizer: New SLP Pattern", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/492684/mbox/" } ], "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2198182/checks/", "tags": {}, "headers": { "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Delivered-To": [ "patchwork-incoming@legolas.ozlabs.org", "gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)", "sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org", "sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org", "server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39" ], "Received": [ "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGw9d68R1z1xvg\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 20 Feb 2026 01:04:37 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id E95234B9DB52\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 14:04:35 +0000 (GMT)", "from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 2F0344B9DB57\n for <gcc-patches@gcc.gnu.org>; Thu, 19 Feb 2026 14:02:39 +0000 (GMT)", "from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id D025344234;\n Thu, 19 Feb 2026 14:02:36 +0000 (UTC)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org E95234B9DB52", "OpenDKIM Filter v2.11.0 sourceware.org 2F0344B9DB57" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 2F0344B9DB57", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 2F0344B9DB57", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771509759; cv=none;\n b=g4t4bR8JJItZOZDnkDtQ27iFDCUBDdZHbGIzU1F62NmM1khDZkqdL3wU/TAhpsDizbEEewbCRFMWm5+KQG1qOWmMGZQ5gNXbzJ9as0Vej2ZQo28nGmikK2NunhDs0pH8dOIbIpiDq5DRCFJ3EO2Bj71PLVRj+pwHn5rSiV4W0XU=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1771509759; c=relaxed/simple;\n bh=K6TmgsMU0cPjcpkNOvFI4TV+PBrvyzckOVzGpRyCtr0=;\n h=From:Date:Subject:To:Message-ID;\n b=g17LdbqJkiTHJIgj7YbO0jpcCLa9n/fPUBO6g/uwXLwPXnpWaA9x30OSEpJQ0sh2Bvj+YYiH07ajnrsY/2X3XoLs7SPEn4q01IbakxBi3sFWK6wcyPhRUFxL+WGkr2+Klr8YxS2GNtekRQNVFf05MzRv3YHngnRlx/LkhQbxdvs=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "From": "Andrei Tirziu via Sourceware Forge\n <forge-bot+why@forge-stage.sourceware.org>", "Date": "Thu, 19 Feb 2026 14:02:07 +0000", "Subject": "[PATCH v2 6/7] [Vectorizer]: SLP MATCH Pattern: Allow for more\n invariants", "To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>", "Cc": "Tamar Christina <tamar.christina@arm.com>,\n Victor Do Nascimento <victor.donascimento@arm.com>", "Message-ID": "\n <bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.6@forge-stage.sourceware.org>", "X-Mailer": "batrachomyomachia", "X-Pull-Request-Organization": "gcc", "X-Pull-Request-Repository": "gcc-TEST", "X-Pull-Request": "https://forge.sourceware.org/gcc/gcc-TEST/pulls/135", "References": "\n <bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.0@forge-stage.sourceware.org>", "In-Reply-To": "\n <bmm.hfy4c1w8xq.gcc.gcc-TEST.why.135.2.0@forge-stage.sourceware.org>", "X-Patch-URL": "\n https://forge.sourceware.org/why/gcc/commit/edf34a05054dc993367f8b91c58c1207f845eb88", "X-BeenThere": "gcc-patches@gcc.gnu.org", "X-Mailman-Version": "2.1.30", "Precedence": "list", "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>", "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>", "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>", "Reply-To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>,\n Tamar Christina <tamar.christina@arm.com>,\n Victor Do Nascimento <victor.donascimento@arm.com>,\n andreinichita.tirziu@arm.com", "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org" }, "content": "From: Andrei Nichita Tirziu <andreinichita.tirziu@arm.com>\n\nThe MATCH pattern previously allowed for a maximum number of invariants,\ngiven by the maximum number of elements that could fit in a segment\nof the chosen vector mode. For example, if we had elements\nthat were 16-bits wide, and the chosen mode for vectorization\nwas VNx8HI, than we could fit at most 8 elements in a segment.\n\nThis change allows for any number of invariants, which can be split\nacross multiple MATCH / NMATCH instructions. These instructions\ncan then be accumulated by adding extra OR / AND instructions to\nobtain the final result.\n\nThis would be equivalent to the following:\n x1 = IFN_MATCH_ANY_FROM (variant, invariant_1);\n x2 = IFN_MATCH_ANY_FROM (variant, invariant_1);\n x3 = IFN_MATCH_ANY_FROM (variant, invariant_3);\n final_result = x1 || x2 || x3;\n(similar for the NMATCH case).\n\ngcc/ChangeLog:\n\n\t* tree-vect-slp-patterns.cc: Changes to the MATCH\n\t\t\t\t SLP pattern.\n---\n gcc/tree-vect-slp-patterns.cc | 265 ++++++++++++++++++++++++++--------\n 1 file changed, 204 insertions(+), 61 deletions(-)", "diff": "diff --git a/gcc/tree-vect-slp-patterns.cc b/gcc/tree-vect-slp-patterns.cc\nindex dcdb05b321d4..93d1b3226e48 100644\n--- a/gcc/tree-vect-slp-patterns.cc\n+++ b/gcc/tree-vect-slp-patterns.cc\n@@ -1888,95 +1888,238 @@ void match_pattern::build (vec_info *vinfo)\n return;\n }\n \n- // Create a new SLP node to hold all invariants as scalar operands.\n- slp_tree invariant_node = vect_create_new_slp_node (0, CONSTRUCTOR);\n- SLP_TREE_DEF_TYPE (invariant_node) = vect_external_def;\n- SLP_TREE_VECTYPE (invariant_node) = SLP_TREE_VECTYPE (variant_operand);\n- SLP_TREE_REPRESENTATIVE (invariant_node) = nullptr;\n-\n /* At this point, we know that we have a vector mode and we are\n interested in how many elements we can pack in a segment\n (usually 128 bits long). */\n const unsigned int lanes_in_segment =\n \tGET_MODE_NUNITS (vinfo->vector_mode).coeffs[0];\n \n- // We can't fit more invariants than the number of lanes in a segment.\n- if (lanes_in_segment < invariant_operands.size ())\n+ /* We can fit at most `lanes_in_segment` invariants in a node, so we might\n+ need multiple nodes. */\n+ unsigned int total_invariant_nodes =\n+\tinvariant_operands.size () / lanes_in_segment;\n+ if (invariant_operands.size () % lanes_in_segment != 0)\n+ total_invariant_nodes++;\n+\n+ auto_vec<gcall*> new_ifn_calls {};\n+ auto_vec<slp_tree> new_invariant_nodes {};\n+ auto_vec<stmt_vec_info> new_vec_infos {};\n+\n+ for (unsigned int i = 0; i < total_invariant_nodes; i++)\n {\n- if (dump_enabled_p ())\n- dump_printf_loc (MSG_NOTE, vect_location,\n-\t\t \"SLP MATCH pattern: Too many invariants (got %d \"\n-\t\t \"invariants, maximum for the current data type was %d).\"\n-\t\t \"Aborting transformation\\n\",\n-\t\t invariant_operands.size (),\n-\t\t lanes_in_segment);\n+ /* The invariants we want to pack on this iteration are in the range\n+ [i * lanes_in_segment ... ((i + 1) * lanes_in_segment - 1)] or\n+ [i * lanes_in_segment ... invariant_operands.size()]. */\n+ const unsigned int index_of_first_invariant = i * lanes_in_segment;\n+\n+ // Create a new SLP node to hold all invariants as scalar operands.\n+ slp_tree invariant_node = vect_create_new_slp_node (0, CONSTRUCTOR);\n+ SLP_TREE_DEF_TYPE (invariant_node) = vect_external_def;\n+ SLP_TREE_VECTYPE (invariant_node) = SLP_TREE_VECTYPE (variant_operand);\n+ SLP_TREE_REPRESENTATIVE (invariant_node) = nullptr;\n+\n+ /* We have some remaining invariants, but not enough to fill the\n+ entire node. This value is only useful in the last iteration. */\n+ const std::size_t remaining_invariants =\n+\tinvariant_operands.size () - index_of_first_invariant;\n+\n+ /* The indices of the invariants to insert in this node depend on the\n+ iteration we are in.\n+ At the last iteration, we have to fill the lanes in a circular way. The\n+ lanes can't just be left empty, since we would then match with zero,\n+ which isn't necessarily among our invariants. */\n+ for (unsigned int j = 0; j < lanes_in_segment; j++)\n+ {\n+ const unsigned int index_of_invariant_to_insert =\n+\t(i == total_invariant_nodes - 1) ?\n+\t (index_of_first_invariant + j % remaining_invariants) :\n+\t (index_of_first_invariant + j);\n \n- return;\n+ const tree scalar_invariant =\n+\tSLP_TREE_SCALAR_OPS (invariant_operands[index_of_invariant_to_insert])[0];\n+\n+ SLP_TREE_SCALAR_OPS (invariant_node).safe_push (scalar_invariant);\n+ }\n+\n+ /* We need a value here, that ensures that the\n+ scalar operands end up vectorized. */\n+ SLP_TREE_LANES (invariant_node) = 1;\n+\n+ /* Build a dummy IFN (the IFN will get its proper arguments\n+ in vectorizable_call). */\n+ auto_vec<tree> ifn_args {};\n+ tree dummy_arg_type = TREE_TYPE (gimple_get_lhs (current_stmt));\n+ tree dummy_arg = fold_convert (dummy_arg_type, integer_zero_node);\n+\n+ ifn_args.safe_push (dummy_arg);\n+ ifn_args.safe_push (dummy_arg);\n+\n+ gcall *ifn_call = gimple_build_call_internal_vec (m_ifn, ifn_args);\n+\n+ // Create an SSA LHS of the vector mask type and attach it to the call.\n+ const tree lhs = make_temp_ssa_name (SLP_TREE_VECTYPE (*m_node),\n+\t\t\t\t\t ifn_call,\n+\t\t\t\t\t \"match_temp_ifn\");\n+ gimple_call_set_lhs (ifn_call, lhs);\n+ gimple_set_location (ifn_call, gimple_location (current_stmt));\n+ gimple_call_set_nothrow (ifn_call, true);\n+ gimple_set_bb (ifn_call, gimple_bb (current_stmt));\n+\n+ // Create new vector info for the newly created IFN call.\n+ stmt_vec_info new_vec_info = vinfo->add_pattern_stmt (ifn_call,\n+\t\t\t\t\t\t\t current_vec_info);\n+ STMT_VINFO_RELEVANT (new_vec_info) = vect_used_in_scope;\n+ STMT_SLP_TYPE (new_vec_info) = pure_slp;\n+ STMT_VINFO_VECTYPE (new_vec_info) = SLP_TREE_VECTYPE (*m_node);\n+ STMT_VINFO_SLP_VECT_ONLY_PATTERN (new_vec_info) = true;\n+\n+ new_ifn_calls.safe_push (ifn_call);\n+ new_invariant_nodes.safe_push (invariant_node);\n+ new_vec_infos.safe_push (new_vec_info);\n }\n \n- const std::size_t number_invariants = invariant_operands.size ();\n+ /* At this point we have multiple nodes of invariants, let's say N of them\n+ For each such node, we have an IFN that takes the form\n+\tresult_i = IFN_MATCH (variant_operand, new_invariant_nodes[i]);\n+ with i between [0, N - 1].\n \n- /* Most likely, the number of invariants won't match the number of lanes,\n- so we have to fill the lanes in a circular way.\n- The lanes can't just be left empty, since we would then match with zero,\n- which isn't necessarily among our invariants. */\n- for (unsigned int i = 0; i < lanes_in_segment; i++)\n+ If we only have one invariant node, then we can directly attach it,\n+ together with the variant operand, as children of the root node.\n+ Otherwise, we need to to a few extra steps.\n+ */\n+ if (total_invariant_nodes == 1)\n {\n- const tree scalar_invariant =\n-\tSLP_TREE_SCALAR_OPS (invariant_operands[i % number_invariants])[0];\n- SLP_TREE_SCALAR_OPS (invariant_node).safe_push (scalar_invariant);\n+ SLP_TREE_CHILDREN (*m_node).release ();\n+\n+ SLP_TREE_CHILDREN (*m_node).safe_push (variant_operand);\n+ SLP_TREE_REF_COUNT (variant_operand)++;\n+\n+ SLP_TREE_CHILDREN (*m_node).safe_push (new_invariant_nodes[0]);\n+ SLP_TREE_REF_COUNT (new_invariant_nodes[0])++;\n+\n+ // Attach the new vec info, and designate the root node as a CALL expression.\n+ SLP_TREE_REPRESENTATIVE (*m_node) = new_vec_infos[0];\n+ SLP_TREE_CODE (*m_node) = CALL_EXPR;\n }\n \n- /* We need a value here, that ensures that the\n- scalar operands end up vectorized. */\n- SLP_TREE_LANES (invariant_node) = 1;\n+ auto_vec<slp_tree> new_match_nodes {};\n+\n+ if (total_invariant_nodes > 1)\n+ {\n+ /* Create new \"match nodes\". Each newly created IFN will form a new\n+ internal node, whose children are the variant operand and the IFN's\n+ corresponding invariant node. */\n+ for (unsigned int i = 0; i < total_invariant_nodes; i++)\n+ {\n+ slp_tree new_match_node = vect_create_new_slp_node (0, CONSTRUCTOR);\n+ SLP_TREE_DEF_TYPE (new_match_node) = vect_internal_def;\n+ SLP_TREE_VECTYPE (new_match_node) = SLP_TREE_VECTYPE (*m_node);\n+ SLP_TREE_LANES (new_match_node) = 1;\n+\n+ SLP_TREE_CHILDREN (new_match_node).safe_push (variant_operand);\n+ SLP_TREE_REF_COUNT (variant_operand)++;\n+\n+ SLP_TREE_CHILDREN (new_match_node).safe_push (new_invariant_nodes[i]);\n+ SLP_TREE_REF_COUNT (new_invariant_nodes[i])++;\n \n- /* Build a dummy IFN (the IFN will get its proper arguments\n- in vectorizable_call). */\n- auto_vec<tree> ifn_args {};\n- tree dummy_arg_type = TREE_TYPE (gimple_get_lhs (current_stmt));\n- tree dummy_arg = fold_convert (dummy_arg_type, integer_zero_node);\n+ /* Attach the new vec info, and designate the root node as\n+\t a CALL expression. */\n+ SLP_TREE_REPRESENTATIVE (new_match_node) = new_vec_infos[i];\n+ SLP_TREE_CODE (new_match_node) = CALL_EXPR;\n+\n+ new_match_nodes.safe_push (new_match_node);\n+ }\n+\n+ /* The following loop combines the newly created nodes to give a final\n+ result. The loop is executed only when we have at least two invariant\n+ nodes.\n+ If the \"match nodes\" were match_node[0 ... N - 1], then:\n+\t combine_node[0] has children match_node[0] and match_node[1]\n+\t combine_node[1] has children combine_node[0] and match_node[2]\n+\t ...\n+\t combine_node[N - 2] has children combine_node[N - 3] and match_node[N - 2]\n+\t m_node has children combine_node[N - 1] and match_node[N - 1].\n+ We can achieve such a computation by using accumulators.\n+ */\n+\n+ tree accumulator_lhs = gimple_call_lhs (new_ifn_calls[0]);\n+ slp_tree accumulator_combine_node = new_match_nodes[0];\n+\n+ for (unsigned int i = 0; i < total_invariant_nodes - 1; i++)\n+ {\n+ // Create an SSA LHS of the vector mask type and attach it to the call.\n+ const tree lhs = make_temp_ssa_name (SLP_TREE_VECTYPE (variant_operand),\n+\t\t\t\t\t NULL,\n+\t\t\t\t\t \"match_temp_combine\");\n+\n+ /* Create a statement of the form\n+\t combine_result = result_of_match_ifn0 OR result_of_match_ifn1. */\n+ gassign *result_of_match_combine =\n+\tgimple_build_assign (lhs,\n+\t\t\t m_ifn == IFN_MATCH_ANY_FROM ? BIT_IOR_EXPR : BIT_AND_EXPR,\n+\t\t\t accumulator_lhs,\n+\t\t\t gimple_call_lhs (new_ifn_calls[i + 1]));\n+\n+ gimple_set_location (result_of_match_combine,\n+\t\t\t gimple_location (current_stmt));\n+ gimple_set_bb (result_of_match_combine, gimple_bb (current_stmt));\n+\n+ accumulator_lhs = lhs;\n+\n+ // Create new vector info for the newly created assignment statement.\n+ stmt_vec_info new_vec_info = vinfo->add_pattern_stmt (result_of_match_combine,\n+\t\t\t\t\t\t\t current_vec_info);\n+ STMT_VINFO_RELEVANT (new_vec_info) = vect_used_in_scope;\n+ STMT_SLP_TYPE (new_vec_info) = pure_slp;\n+ STMT_VINFO_VECTYPE (new_vec_info) = SLP_TREE_VECTYPE (*m_node);\n+ STMT_VINFO_SLP_VECT_ONLY_PATTERN (new_vec_info) = true;\n+\n+ if (i < total_invariant_nodes - 2)\n+ {\n+\t/* If we haven't reached the last iteration, we keep creating new\n+\t combine nodes whose children are the current match node and the\n+\t previous combine node. */\n+\tslp_tree new_combine_node = vect_create_new_slp_node (0, CONSTRUCTOR);\n+\tSLP_TREE_DEF_TYPE (new_combine_node) = vect_internal_def;\n+\tSLP_TREE_VECTYPE (new_combine_node) = SLP_TREE_VECTYPE (*m_node);\n+\tSLP_TREE_LANES (new_combine_node) = 1;\n+\tSLP_TREE_REPRESENTATIVE (new_combine_node) = new_vec_info;\n \n- ifn_args.safe_push (dummy_arg);\n- ifn_args.safe_push (dummy_arg);\n+\tSLP_TREE_CHILDREN (new_combine_node).safe_push (accumulator_combine_node);\n+\tSLP_TREE_REF_COUNT (accumulator_combine_node)++;\n \n- gcall *ifn_call = gimple_build_call_internal_vec (m_ifn, ifn_args);\n+\tSLP_TREE_CHILDREN (new_combine_node).safe_push (new_match_nodes[i + 1]);\n+\tSLP_TREE_REF_COUNT (new_match_nodes[i + 1])++;\n \n- // Create an SSA LHS of the vector mask type and attach it to the call.\n- const tree lhs = make_temp_ssa_name (SLP_TREE_VECTYPE (*m_node),\n- ifn_call,\n- \"match_temp_ifn\");\n- gimple_call_set_lhs (ifn_call, lhs);\n- gimple_set_location (ifn_call, gimple_location (current_stmt));\n- gimple_call_set_nothrow (ifn_call, true);\n- gimple_set_bb (ifn_call, gimple_bb (current_stmt));\n+\tSLP_TREE_CODE (new_combine_node) =\n+\t m_ifn == IFN_MATCH_ANY_FROM ? BIT_IOR_EXPR : BIT_AND_EXPR;\n \n- // Create new vector info for the newly created IFN call.\n- stmt_vec_info new_vec_info = vinfo->add_pattern_stmt (ifn_call,\n-\t\t\t\t\t\t\tcurrent_vec_info);\n- STMT_VINFO_RELEVANT (new_vec_info) = vect_used_in_scope;\n- STMT_SLP_TYPE (new_vec_info) = pure_slp;\n- STMT_VINFO_VECTYPE (new_vec_info) = SLP_TREE_VECTYPE (*m_node);\n- STMT_VINFO_SLP_VECT_ONLY_PATTERN (new_vec_info) = true;\n+\taccumulator_combine_node = new_combine_node;\n+ }\n+ else\n+ {\n+\t/* In the last iteration, we add the last combine node we created and the\n+\t last match node as the children of the root node. */\n+\tSLP_TREE_CHILDREN (*m_node).release ();\n \n- /* We'll replace the node's children with the variant operand node\n- and the newly created invariants node. */\n- SLP_TREE_CHILDREN (*m_node).release ();\n+\tSLP_TREE_CHILDREN (*m_node).safe_push (accumulator_combine_node);\n+\tSLP_TREE_REF_COUNT (accumulator_combine_node)++;\n \n- SLP_TREE_CHILDREN (*m_node).safe_push (variant_operand);\n- SLP_TREE_REF_COUNT (variant_operand)++;\n+\tSLP_TREE_CHILDREN (*m_node).safe_push (new_match_nodes[i + 1]);\n+\tSLP_TREE_REF_COUNT (new_match_nodes[i + 1])++;\n \n- SLP_TREE_CHILDREN (*m_node).safe_push (invariant_node);\n- SLP_TREE_REF_COUNT (invariant_node)++;\n+\tSLP_TREE_CODE (*m_node) =\n+\t m_ifn == IFN_MATCH_ANY_FROM ? BIT_IOR_EXPR : BIT_AND_EXPR;\n+\tSLP_TREE_REPRESENTATIVE (*m_node) = new_vec_info;\n+ }\n+ }\n+ }\n \n if (dump_enabled_p ())\n dump_printf_loc (MSG_NOTE, vect_location,\n \t\t \"SLP MATCH pattern: Successfully built replacement for \"\n \t\t \"statement %G\",\n \t\t current_stmt);\n-\n- SLP_TREE_REPRESENTATIVE (*m_node) = new_vec_info;\n- SLP_TREE_CODE (*m_node) = CALL_EXPR;\n }\n \n vect_pattern*\n", "prefixes": [ "v2", "6/7", "Vectorizer" ] }