get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2235281,
    "url": "http://patchwork.ozlabs.org/api/patches/2235281/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260509013939.279561-1-pengxuan.zheng@oss.qualcomm.com/",
    "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": "<20260509013939.279561-1-pengxuan.zheng@oss.qualcomm.com>",
    "list_archive_url": null,
    "date": "2026-05-09T01:39:39",
    "name": "[v2] cselim: Allow middle_bb to have more than one statement [PR124405]",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5ffc5073bfc3eb7de3643d2ea67d6b3314a325fa",
    "submitter": {
        "id": 92245,
        "url": "http://patchwork.ozlabs.org/api/people/92245/?format=api",
        "name": "Pengxuan Zheng",
        "email": "pengxuan.zheng@oss.qualcomm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260509013939.279561-1-pengxuan.zheng@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 503472,
            "url": "http://patchwork.ozlabs.org/api/series/503472/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=503472",
            "date": "2026-05-09T01:39:39",
            "name": "[v2] cselim: Allow middle_bb to have more than one statement [PR124405]",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/503472/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2235281/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2235281/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\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=Yjo9dtNP;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=AO3Ap5Wi;\n\tdkim-atps=neutral",
            "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;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=Yjo9dtNP;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=AO3Ap5Wi",
            "sourceware.org; dmarc=none (p=none dis=none)\n header.from=oss.qualcomm.com",
            "sourceware.org;\n spf=pass smtp.mailfrom=oss.qualcomm.com",
            "sourceware.org;\n arc=none smtp.remote-ip=205.220.180.131"
        ],
        "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 4gC7wX6jl3z1yCg\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 09 May 2026 11:40:27 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [IPv6:::1])\n\tby sourceware.org (Postfix) with ESMTP id 0952F4BA2E0E\n\tfor <incoming@patchwork.ozlabs.org>; Sat,  9 May 2026 01:40:25 +0000 (GMT)",
            "from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com\n [205.220.180.131])\n by sourceware.org (Postfix) with ESMTPS id 20E684BA5435\n for <gcc-patches@gcc.gnu.org>; Sat,  9 May 2026 01:39:44 +0000 (GMT)",
            "from pps.filterd (m0279872.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 648KdfXr852271\n for <gcc-patches@gcc.gnu.org>; Sat, 9 May 2026 01:39:43 GMT",
            "from mail-dl1-f71.google.com (mail-dl1-f71.google.com\n [74.125.82.71])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e1fptjgut-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <gcc-patches@gcc.gnu.org>; Sat, 09 May 2026 01:39:43 +0000 (GMT)",
            "by mail-dl1-f71.google.com with SMTP id\n a92af1059eb24-132ad2dfaeeso58869c88.0\n for <gcc-patches@gcc.gnu.org>; Fri, 08 May 2026 18:39:43 -0700 (PDT)",
            "from hu-pzheng-lv.qualcomm.com (Global_NAT1.qualcomm.com.\n [129.46.96.20]) by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-1327821fc59sm5165728c88.7.2026.05.08.18.39.39\n for <gcc-patches@gcc.gnu.org>\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 08 May 2026 18:39:39 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 0952F4BA2E0E",
            "OpenDKIM Filter v2.11.0 sourceware.org 20E684BA5435"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 20E684BA5435",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 20E684BA5435",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778290784; cv=none;\n b=c3Q8/ckE/zwobUSdvTF2kjDTZZXVt4tEBDCt+D2JaFQAuoG/HFsUDXJLMra9wfFABxQaq0SJNxBnHrVHxz4tuNQbla3fANp5NAnsgbgPfNg3MdBwq9qM3R6hnENZjekxHC1VUYEvpD42LsfZ4bZadyq8myV8J/TQ003vgtnc9NA=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1778290784; c=relaxed/simple;\n bh=NAthtz6HWMomojGxl3S9I60PTXRAGDOyzq8I+fBSY8k=;\n h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id:\n MIME-Version;\n b=srH1qvY1QiwgOqJEEE6ECo1CVA44zvyA0dZyYq8US8PCQQBSf44vnFZmF6X6tj5+uTh1KdpW/KA7UFB8RWF8MXhhW8CyPglD7u03MBtTO5sU/GP4YbwcxiTyRWeA8YEzvI82Zdz9BnZYM0xDu2JyYi5XGVIhJk08CIZtVXoZvn4=",
        "ARC-Authentication-Results": "i=1; sourceware.org;\n dkim=pass (2048-bit key, unprotected)\n header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=Yjo9dtNP;\n dkim=pass (2048-bit key, unprotected) header.d=oss.qualcomm.com\n header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google\n header.b=AO3Ap5Wi",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n content-transfer-encoding:date:from:message-id:mime-version\n :subject:to; s=qcppdkim1; bh=5Y8GYm18tFdgSgOr57VwTsfXe/7D9y5towY\n zCNqeP5w=; b=Yjo9dtNPdUQSz8cx+J/ZU4adI3UiyAQUYB0sVfs2NA+A2nvg22v\n bCCFZDZgvnawM4Bx+zFRur4vqCdwzMN4TQdrJipGx6OKWlqUZ4NRZepWZaGS3poP\n OFXXKKKqzX5fdE/cgOQuqSa/WwbqqY+v2t1D5HfTomA6a6Qtjt6YjRZFZ9A0OWTt\n 6VUwo8Q2h/JYw+ZqW1+VXu7sR6Rkab4ZqLLFm8WBr33Szu7R7ukuTwbVr8h+mAIJ\n FKomiypFOjah4jDjZezpx4nxwlGLadBpt2wI6i0nI3b2k4M3L37sWErX5oydZdGW\n 8XSIjYLf7P7jpr9e6VcJ8xAkbk791XpMhwQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1778290781; x=1778895581; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:from:to:cc:subject:date:message-id:reply-to;\n bh=5Y8GYm18tFdgSgOr57VwTsfXe/7D9y5towYzCNqeP5w=;\n b=AO3Ap5Wi8I5RbYk3GvCWbLxoJ2MWNee5gFdCh3hXSGPCdveWtceQwYlwDlE+9h3p1m\n HfpwB7j15Abp65X+igx3qGI4Gz/SFsYskCCTMIAOtFCX2OwPCDmR6CUGyqFYt2MW9gLU\n 90h1Yztj94Q1oENZVQIEbb7eCYW+edO6+jTgRkzsTcgj1y24c5bKiQtlgZdPrz0ot3FD\n F259fFewN2a1iFRCFdj3A7EXzxHKne7AwNK9KKE7tjLJRZCOSjsKyVSW5xT1J7tltSzz\n OnuxaM0eM2LKOhEJQhYMf8iCyasTu0wW6ZQqeleC29S+GMqVI9SljRmLgY7fa7vzsOhV\n RgTg=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1778290781; x=1778895581;\n h=content-transfer-encoding:mime-version:message-id:date:subject:to\n :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=5Y8GYm18tFdgSgOr57VwTsfXe/7D9y5towYzCNqeP5w=;\n b=YEKj56J9fwv09sdzSAuD75Yp7V5OWGP1J0nKvHoa8ImGsAhxQOK2+LyhQAdnZ7EZH0\n indU2OCyGgA2r0+RT0QDVLYfhLblucGFoVapcGcZU3OSRinr3o+kIWFbsS+GxBdMYqwa\n H3qV1IumINchwoJ4LR6qetGLO8Ltq/eQXZRhT3Q6UlzogIKe7EbieaYGwwVbbuyvZ5Ly\n fj4BbdSsg5z48P6qT/+VZ88o06bVqdQzq7nDH/gfXW6y3Me30/J4IKwcZLXRrB5hMCI1\n K3uM8fz3HUyUX+5sSuL9ooD+QNQnH1fyLKDgauQcjcNA4kSKAGvEvpngY3r2baSoKXIW\n ja5g==",
        "X-Gm-Message-State": "AOJu0Yw5DsF6WqY8s+eBrxxQubiJX97Aerr4YyzOM8VZGRweFZzIPy9B\n Phkz338+5AbQCbAakZxGdjmEqSb0iMjlhUFTJSd/yOkR0fFdVm33Xc4t++ymFmkhBKzFjnK//nE\n suYDEZUzjbiT5yMUE6/B6wGXnWreJl2uDNUzmtJyw9DQv1Vm+WkPYHdPPDQ2Ck9EHEN6J",
        "X-Gm-Gg": "AeBDiev7UrcIzisozyjcK77rFo0UF/ZFRlZLQzZpCpwID4S84MWDcACzMwLBBTdtg4V\n 8fSPsR+QWLYHeXW1nP+D4370vdmMbxaDGP12jjsNfCZf70t6Hi0r49XN4BckDt1rolNenmtgOhD\n e0ndwyKn/a5/vsCEki5d9LPBPhDebDJUyl5sD67PdNznBANDVo4sqoOm0lZB9nJoYzRXPjIA/3L\n jUBvDsnIX/yvLvksmOf9sTOX7Nqdq63liX5ERV9M1aXbo/fcS2q6lUJk6hbBooWlW5xzsxxavnx\n Q5h2k9JMA1HjeDZF7K60odEPQZJao/Fd0fTn630uVKYK3BsRMLafylvMPBPoYTjRm6YyMR51FLe\n wxf1V7Omdjrgk3cPgW0E1Y8a3BzeP792v8svQSLMyomOLl/sv+MmWdusis4WuKUYY5EaGqQJ9a5\n rik9NjixZ/ufk=",
        "X-Received": [
            "by 2002:a05:7022:629:b0:130:c9cc:3395 with SMTP id\n a92af1059eb24-132a84f722amr396309c88.29.1778290781173;\n Fri, 08 May 2026 18:39:41 -0700 (PDT)",
            "by 2002:a05:7022:629:b0:130:c9cc:3395 with SMTP id\n a92af1059eb24-132a84f722amr396290c88.29.1778290780433;\n Fri, 08 May 2026 18:39:40 -0700 (PDT)"
        ],
        "From": "Pengxuan Zheng <pengxuan.zheng@oss.qualcomm.com>",
        "To": "gcc-patches@gcc.gnu.org",
        "Subject": "[PATCH v2] cselim: Allow middle_bb to have more than one statement\n [PR124405]",
        "Date": "Fri,  8 May 2026 18:39:39 -0700",
        "Message-Id": "<20260509013939.279561-1-pengxuan.zheng@oss.qualcomm.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Proofpoint-ORIG-GUID": "HaHqe-nq1bK6cOKs4vS6ETeYCNNesxvA",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNTA5MDAxNCBTYWx0ZWRfX7o1R0nbh+OUX\n oX/7jiZUcEypYC4CbDnGQLVc1JhyGilxaSM2Y39odsofpmGS2cvFbr7tlFiLdj7vmjPHhZu0+bQ\n c3D/X1EHtNKDg1aeDa9j1kejA4fIWxz3ZtWzjSkCLezMf5BnA5OLhvYkVqEHvjLS9ExwVZgD8HF\n kxrWdJ30pUe1NIfgeOc5CMDkzakKCZgROpeQCfrQdSXLaHTBb7eN9IFDbot2C/Wwn9siOYcLi57\n lcr5eQg35v1NFD9D/d7derBBcZ7jumzV33O4DWz5Q6tZv69BpvzjzXVTSIBjP4+7cKXg2nZLbsc\n k0+Ou5SVBb0WHWGlTdJHOkS5+xYrK1U6qzHZTzYxBjsEXlaaPhKW9GW2gxhkZrZjknwY2k1exGo\n CVXYXMHfvMCPbAytY7ji5/RCvhvm309ifZgAW4NbApede3uxxaQIUFnsGCXCGqzBGbvfKbzm7fw\n 4VFCsMymI+3SB8md9bA==",
        "X-Proofpoint-GUID": "HaHqe-nq1bK6cOKs4vS6ETeYCNNesxvA",
        "X-Authority-Analysis": "v=2.4 cv=IYi3n2qa c=1 sm=1 tr=0 ts=69fe905f cx=c_pps\n a=JYo30EpNSr/tUYqK9jHPoA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17\n a=Y3tniwRYLMhsA3a_:21 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22\n a=EUspDBNiAAAA:8 a=1sVCnobfY8oE4GoUMwwA:9 a=Fk4IpSoW4aLDllm1B1p-:22",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-05-09_01,2026-05-08_02,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n spamscore=0 adultscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0\n priorityscore=1501 clxscore=1015 bulkscore=0 malwarescore=0 phishscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604200000 definitions=main-2605090014",
        "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>",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "Currently, cselim requires the middle_bb to have only a single statement. This\npatch relaxes this restriction if the following pattern is found and also when\nit is safe to do the optimization.\n\nSPLIT_BB:\n  ...\n  STORE = X\n  if (cond) goto MIDDLE_BB; else goto JOIN_BB (edge E1)\nMIDDLE_BB:\n  ...\n  STORE = Y;\n  ...\n  fallthrough (edge E0)\nJOIN_BB:\n  some more\n\nBootstrapped and tested on x86_64-linux-gnu and aarch64-linux-gnu.\n\nChanges since v1:\n* v2: Revert changes to trailing_store_in_bb and do not call\n      trailing_store_in_bb to get split_assign.\n      Remove some unnecessary checks in cselim_candidate.\n      Pass the result of cselim_candidate which is the candidate store for\n      cselim as an argument to cond_store_replacement instead.\n\n\tPR tree-optimization/124405\n\ngcc/ChangeLog:\n\n\t* tree-ssa-phiopt.cc (cond_store_replacement): Make ASSIGN (the\n\tcandidate store for cselim) an argument of the function instead.\n\t(cselim_candidate): New.\n\t(pass_cselim::execute): Call cselim_candidate and pass the result to\n\tcond_store_replacement.\n\ngcc/testsuite/ChangeLog:\n\n\t* gcc.dg/tree-ssa/pr124405.c: New test.\n\nSigned-off-by: Pengxuan Zheng <pengxuan.zheng@oss.qualcomm.com>\n---\n gcc/testsuite/gcc.dg/tree-ssa/pr124405.c | 12 +++++\n gcc/tree-ssa-phiopt.cc                   | 68 +++++++++++++++++++++---\n 2 files changed, 73 insertions(+), 7 deletions(-)\n create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr124405.c",
    "diff": "diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr124405.c b/gcc/testsuite/gcc.dg/tree-ssa/pr124405.c\nnew file mode 100644\nindex 00000000000..9ba230d2b56\n--- /dev/null\n+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr124405.c\n@@ -0,0 +1,12 @@\n+/* { dg-do compile } */\n+/* { dg-options \"-O1 -fdump-tree-cselim-details\" } */\n+\n+void\n+f (int *a, int b)\n+{\n+  *a &= ~3;\n+  if (b)\n+    *a |= 1;\n+}\n+\n+/* { dg-final { scan-tree-dump-times \"Conditional store replacement happened\" 1 \"cselim\"} } */\ndiff --git a/gcc/tree-ssa-phiopt.cc b/gcc/tree-ssa-phiopt.cc\nindex 324559e6a7d..e55d6efaa2b 100644\n--- a/gcc/tree-ssa-phiopt.cc\n+++ b/gcc/tree-ssa-phiopt.cc\n@@ -2991,16 +2991,16 @@ get_non_trapping (void)\n    JOIN_BB:\n      some more\n \n-   We check that MIDDLE_BB contains only one store, that that store\n+   ASSIGN is a store in MIDDLE_BB which is the candidate for cselim.  We check\n+   that MIDDLE_BB contains only one store (i.e., ASSIGN), that that store\n    doesn't trap (not via NOTRAP, but via checking if an access to the same\n-   memory location dominates us, or the store is to a local addressable\n-   object) and that the store has a \"simple\" RHS.  */\n+   memory location dominates us, or the store is to a local addressable object)\n+   and that the store has a \"simple\" RHS.  */\n \n static bool\n-cond_store_replacement (basic_block middle_bb, basic_block join_bb,\n-\t\t\tedge e0, edge e1, hash_set<tree> *nontrap)\n+cond_store_replacement (basic_block middle_bb, basic_block join_bb, edge e0,\n+\t\t\tedge e1, gimple *assign, hash_set<tree> *nontrap)\n {\n-  gimple *assign = last_and_only_stmt (middle_bb);\n   tree lhs, rhs, name, name2;\n   gphi *newphi;\n   gassign *new_stmt;\n@@ -3289,6 +3289,58 @@ trailing_store_in_bb (basic_block bb, tree vdef, gphi *vphi, bool onlyonestore)\n   return store;\n }\n \n+/* Return the candidate store for cselim.  If there is only a single statement\n+   in MIDDLE_BB, return that statement.  Otherwise, try to find the following\n+   pattern and return the only store in MIDDLE_BB.\n+\n+   SPLIT_BB:\n+     ...\n+     STORE = X\n+     if (cond) goto MIDDLE_BB; else goto JOIN_BB (edge E1)\n+   MIDDLE_BB:\n+     ...\n+     STORE = Y;\n+     ...\n+     fallthrough (edge E0)\n+   JOIN_BB:\n+     some more\n+*/\n+\n+static gimple *\n+cselim_candidate (basic_block middle_bb, basic_block join_bb, edge e0, edge e1)\n+{\n+  gimple *middle_assign = last_and_only_stmt (middle_bb);\n+  if (middle_assign)\n+    return middle_assign;\n+\n+  gphi *vphi = get_virtual_phi (join_bb);\n+  if (!vphi)\n+    return NULL;\n+\n+  tree middle_vdef = PHI_ARG_DEF_FROM_EDGE (vphi, e0);\n+  middle_assign = trailing_store_in_bb (middle_bb, middle_vdef, vphi, true);\n+\n+  if (!middle_assign || !gimple_assign_single_p (middle_assign)\n+      || gimple_has_volatile_ops (middle_assign)\n+      || stmt_references_abnormal_ssa_name (middle_assign))\n+    return NULL;\n+\n+  tree split_vdef = PHI_ARG_DEF_FROM_EDGE (vphi, e1);\n+  gimple *split_assign = SSA_NAME_DEF_STMT (split_vdef);\n+\n+  if (!split_assign || !gimple_assign_single_p (split_assign)\n+      || gimple_has_volatile_ops (split_assign)\n+      || stmt_references_abnormal_ssa_name (split_assign))\n+    return NULL;\n+\n+  if (gimple_vdef (split_assign) != gimple_vuse (middle_assign)\n+      || !operand_equal_p (gimple_assign_lhs (middle_assign),\n+\t\t\t   gimple_assign_lhs (split_assign), 0))\n+    return NULL;\n+\n+  return middle_assign;\n+}\n+\n /* Limited Conditional store replacement.  We already know\n    that the recognized pattern looks like so:\n \n@@ -4260,7 +4312,9 @@ pass_cselim::execute (function *)\n \t optimization if the join block has more than two predecessors.  */\n       if (EDGE_COUNT (bb2->preds) > 2)\n \treturn;\n-      if (cond_store_replacement (bb1, bb2, e1, e2, nontrap))\n+\n+      gimple *assign = cselim_candidate (bb1, bb2, e1, e2);\n+      if (cond_store_replacement (bb1, bb2, e1, e2, assign, nontrap))\n \tcfgchanged = true;\n     };\n \n",
    "prefixes": [
        "v2"
    ]
}