get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2226714/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2226714,
    "url": "http://patchwork.ozlabs.org/api/patches/2226714/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhuom29jc4.gcc.gcc-TEST.pinskia.61.1.1@forge-stage.sourceware.org/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<bmm.hhuom29jc4.gcc.gcc-TEST.pinskia.61.1.1@forge-stage.sourceware.org>",
    "list_archive_url": null,
    "date": "2026-04-22T18:30:26",
    "name": "[v1,1/6] forwprop: Change optimize_agr_copyprop into forward walk instead of backwards",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a0a510b93f71d02a9ee150633e0dc330edb9c1dd",
    "submitter": {
        "id": 93219,
        "url": "http://patchwork.ozlabs.org/api/people/93219/?format=api",
        "name": "Andrew Pinski via Sourceware Forge",
        "email": "forge-bot+pinskia@forge-stage.sourceware.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhuom29jc4.gcc.gcc-TEST.pinskia.61.1.1@forge-stage.sourceware.org/mbox/",
    "series": [
        {
            "id": 501080,
            "url": "http://patchwork.ozlabs.org/api/series/501080/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501080",
            "date": "2026-04-22T18:30:28",
            "name": "copy-propv3",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501080/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2226714/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2226714/checks/",
    "tags": {},
    "related": [],
    "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=2620:52:6:3111::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\n [IPv6:2620:52:6:3111::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 4g17XH6fMyz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 23 Apr 2026 04:48:15 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id EFA6E48EACF8\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 18:48:13 +0000 (GMT)",
            "from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 17B4D4BC8957\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:32:05 +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 DEF32434CD\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 18:32:04 +0000 (UTC)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org EFA6E48EACF8",
            "OpenDKIM Filter v2.11.0 sourceware.org 17B4D4BC8957"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 17B4D4BC8957",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 17B4D4BC8957",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776882725; cv=none;\n b=Hu0nHyadWCsJstnksHWDxkpbiDDQbJ2SC+ZrUvkvcqzw9rn3OfQQIvnPrrDEahMM1KzQBM78YQBI9iIMr3ksuEFVHoJwpfYKKOoile1P14Y3SBhkoc2qelfTv75H2Ii0APv5/BQZs8X9nDAYCXMFmNkViL3Lz6qmCwPdfSOfw+o=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776882725; c=relaxed/simple;\n bh=GJ8FIum5MmCtNL8n1KrSJonRtFiISJeDsfrHWfT8u6Q=;\n h=From:Date:Subject:To:Message-ID;\n b=BaHX1R16u/MrEULGXpuEoSOxNMjPljOBRfQEP4Kug2d2seEU2bA0oILz2PcSShT9AWQxvgAnGNKzoIwxf5+mF58s+6MHNuIhzeYcjUgAmXT9uOrIDCGfjKZLgpETxqxUUcjnPP/nh6loNQGzrL6hvmjdSHgfXz7a87M825ugZhg=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "From": "Andrew Pinski via Sourceware Forge\n <forge-bot+pinskia@forge-stage.sourceware.org>",
        "Date": "Wed, 22 Apr 2026 18:30:26 +0000",
        "Subject": "[PATCH v1 1/6] forwprop: Change optimize_agr_copyprop into forward\n walk instead of backwards",
        "To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>",
        "Message-ID": "\n <bmm.hhuom29jc4.gcc.gcc-TEST.pinskia.61.1.1@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/61",
        "References": "\n <bmm.hhuom29jc4.gcc.gcc-TEST.pinskia.61.1.0@forge-stage.sourceware.org>",
        "In-Reply-To": "\n <bmm.hhuom29jc4.gcc.gcc-TEST.pinskia.61.1.0@forge-stage.sourceware.org>",
        "X-Patch-URL": "\n https://forge.sourceware.org/pinskia/gcc-TEST/commit/936642cff643f387029762217aef68bcd3bf88b1",
        "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 pinskia@gcc.gnu.org",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "From: Andrew Pinski <quic_apinski@quicinc.com>\n\nWhile thinking about how to implement the rest of the copy prop and makes sure not\nto introduce some compile time problems, optimize_agr_copyprop should be changed\ninto a forwproping rather than looking backwards.\n\nBootstrapped and tested on x86_64-linux-gnu.\n\ngcc/ChangeLog:\n\n\t* tree-ssa-forwprop.cc (optimize_agr_copyprop): Change into a\n\tforward looking (looking at vdef's uses) instead of a back\n\tlooking (vuse's def).\n\nSigned-off-by: Andrew Pinski <quic_apinski@quicinc.com>\n---\n gcc/tree-ssa-forwprop.cc | 121 +++++++++++++++++++--------------------\n 1 file changed, 60 insertions(+), 61 deletions(-)",
    "diff": "diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc\nindex 43b1c9d696fd..2dc77ccba1d7 100644\n--- a/gcc/tree-ssa-forwprop.cc\n+++ b/gcc/tree-ssa-forwprop.cc\n@@ -1344,12 +1344,12 @@ optimize_memcpy_to_memset (gimple_stmt_iterator *gsip, tree dest, tree src, tree\n   return true;\n }\n /* Optimizes\n-   a = c;\n-   b = a;\n+   DEST = SRC;\n+   DEST2 = DEST; # DEST2 = SRC2;\n    into\n-   a = c;\n-   b = c;\n-   GSIP is the second statement and SRC is the common\n+   DEST = SRC;\n+   DEST2 = SRC;\n+   GSIP is the first statement and SRC is the common\n    between the statements.\n */\n static bool\n@@ -1365,65 +1365,64 @@ optimize_agr_copyprop (gimple_stmt_iterator *gsip)\n   if (operand_equal_p (dest, src, 0))\n     return false;\n \n-  tree vuse = gimple_vuse (stmt);\n-  /* If the vuse is the default definition, then there is no store beforehand.  */\n-  if (SSA_NAME_IS_DEFAULT_DEF (vuse))\n-    return false;\n-  gimple *defstmt = SSA_NAME_DEF_STMT (vuse);\n-  if (!gimple_assign_load_p (defstmt)\n-      || !gimple_store_p (defstmt))\n-    return false;\n-  if (gimple_has_volatile_ops (defstmt))\n-    return false;\n-\n-  tree dest2 = gimple_assign_lhs (defstmt);\n-  tree src2 = gimple_assign_rhs1 (defstmt);\n-\n-  /* If the original store is `src2 = src2;` skip over it. */\n-  if (operand_equal_p (src2, dest2, 0))\n-    return false;\n-  if (!operand_equal_p (src, dest2, 0))\n-    return false;\n-\n-\n-  /* For 2 memory refences and using a temporary to do the copy,\n-     don't remove the temporary as the 2 memory references might overlap.\n-     Note t does not need to be decl as it could be field.\n-     See PR 22237 for full details.\n-     E.g.\n-     t = *a;\n-     *b = t;\n-     Cannot be convert into\n-     t = *a;\n-     *b = *a;\n-     Though the following is allowed to be done:\n-     t = *a;\n-     *a = t;\n-     And convert it into:\n-     t = *a;\n-     *a = *a;\n-  */\n-  if (!operand_equal_p (src2, dest, 0)\n-      && !DECL_P (dest) && !DECL_P (src2))\n-    return false;\n-\n-  if (dump_file && (dump_flags & TDF_DETAILS))\n+  tree vdef = gimple_vdef (stmt);\n+  imm_use_iterator iter;\n+  gimple *use_stmt;\n+  bool changed = false;\n+  FOR_EACH_IMM_USE_STMT (use_stmt, iter, vdef)\n     {\n-      fprintf (dump_file, \"Simplified\\n  \");\n-      print_gimple_stmt (dump_file, stmt, 0, dump_flags);\n-      fprintf (dump_file, \"after previous\\n  \");\n-      print_gimple_stmt (dump_file, defstmt, 0, dump_flags);\n-    }\n-  gimple_assign_set_rhs_from_tree (gsip, unshare_expr (src2));\n-  update_stmt (stmt);\n+      if (!gimple_assign_load_p (use_stmt)\n+\t  || !gimple_store_p (use_stmt))\n+\tcontinue;\n+      if (gimple_has_volatile_ops (use_stmt))\n+\tcontinue;\n+      tree dest2 = gimple_assign_lhs (use_stmt);\n+      tree src2 = gimple_assign_rhs1 (use_stmt);\n+      /* If the new store is `src2 = src2;` skip over it. */\n+      if (operand_equal_p (src2, dest2, 0))\n+\tcontinue;\n+      if (!operand_equal_p (dest, src2, 0))\n+\tcontinue;\n+      /* For 2 memory refences and using a temporary to do the copy,\n+\t don't remove the temporary as the 2 memory references might overlap.\n+\t Note t does not need to be decl as it could be field.\n+\t See PR 22237 for full details.\n+\t E.g.\n+\t t = *a; #DEST = SRC;\n+\t *b = t; #DEST2 = SRC2;\n+\t Cannot be convert into\n+\t t = *a;\n+\t *b = *a;\n+\t Though the following is allowed to be done:\n+\t t = *a;\n+\t *a = t;\n+\t And convert it into:\n+\t t = *a;\n+\t *a = *a;\n+       */\n+      if (!operand_equal_p (dest2, src, 0)\n+\t  && !DECL_P (dest2) && !DECL_P (src))\n+\tcontinue;\n+      if (dump_file && (dump_flags & TDF_DETAILS))\n+\t{\n+\t  fprintf (dump_file, \"Simplified\\n  \");\n+\t  print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);\n+\t  fprintf (dump_file, \"after previous\\n  \");\n+\t  print_gimple_stmt (dump_file, stmt, 0, dump_flags);\n+\t}\n+      gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);\n+      gimple_assign_set_rhs_from_tree (&gsi, unshare_expr (src));\n+      update_stmt (use_stmt);\n \n-  if (dump_file && (dump_flags & TDF_DETAILS))\n-    {\n-      fprintf (dump_file, \"into\\n  \");\n-      print_gimple_stmt (dump_file, stmt, 0, dump_flags);\n+      if (dump_file && (dump_flags & TDF_DETAILS))\n+\t{\n+\t  fprintf (dump_file, \"into\\n  \");\n+\t  print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);\n+\t}\n+      statistics_counter_event (cfun, \"copy prop for aggregate\", 1);\n+      changed = true;\n     }\n-  statistics_counter_event (cfun, \"copy prop for aggregate\", 1);\n-  return true;\n+  return changed;\n }\n \n /* *GSI_P is a GIMPLE_CALL to a builtin function.\n",
    "prefixes": [
        "v1",
        "1/6"
    ]
}