get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231319,
    "url": "http://patchwork.ozlabs.org/api/patches/2231319/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/93501e9a-3bc8-49d2-bc82-03271aaa75fc@redhat.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": "<93501e9a-3bc8-49d2-bc82-03271aaa75fc@redhat.com>",
    "list_archive_url": null,
    "date": "2026-04-30T15:41:30",
    "name": "[pushed,IRA] : Process operand NO_REGS class for reg cost calculation",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "84b34aaa38f6cf1ac5977c30531489234478dfc6",
    "submitter": {
        "id": 4455,
        "url": "http://patchwork.ozlabs.org/api/people/4455/?format=api",
        "name": "Vladimir Makarov",
        "email": "vmakarov@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/93501e9a-3bc8-49d2-bc82-03271aaa75fc@redhat.com/mbox/",
    "series": [
        {
            "id": 502328,
            "url": "http://patchwork.ozlabs.org/api/series/502328/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=502328",
            "date": "2026-04-30T15:41:30",
            "name": "[pushed,IRA] : Process operand NO_REGS class for reg cost calculation",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502328/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2231319/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231319/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 (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=CjxrDZGc;\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 (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=CjxrDZGc",
            "sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com",
            "sourceware.org; spf=pass smtp.mailfrom=redhat.com",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124"
        ],
        "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 4g5z225l57z1yHZ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 01 May 2026 01:42:17 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id DF348436A042\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 15:42:13 +0000 (GMT)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id B7A624371D5B\n for <gcc-patches@gcc.gnu.org>; Thu, 30 Apr 2026 15:41:38 +0000 (GMT)",
            "from mail-qt1-f199.google.com (mail-qt1-f199.google.com\n [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-299-Nz3oMKgUN-ykfb2CheciDA-1; Thu, 30 Apr 2026 11:41:36 -0400",
            "by mail-qt1-f199.google.com with SMTP id\n d75a77b69052e-50edf01172bso24983461cf.2\n for <gcc-patches@gcc.gnu.org>; Thu, 30 Apr 2026 08:41:36 -0700 (PDT)",
            "from ?IPV6:2607:f2c0:eca8:a57:559e:8217:76d2:eb22?\n ([2607:f2c0:eca8:a57:559e:8217:76d2:eb22])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b3ff43aa8asm22374926d6.30.2026.04.30.08.41.34\n for <gcc-patches@gcc.gnu.org>\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Thu, 30 Apr 2026 08:41:34 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org DF348436A042",
            "OpenDKIM Filter v2.11.0 sourceware.org B7A624371D5B"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org B7A624371D5B",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org B7A624371D5B",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777563698; cv=none;\n b=TOXmYIzJabDDzaOESA1NSz7OdGjN3zd6afNyT2nC2ofFy9cp+H2sOwmWZyGW9moua7AlG6lAtDJtVTQ6A71LCbWrN2bfo8U0xoRqmfU9BIb8X1B/oT1zcDFk3KvT0Lb2GWxhmT8fp6dqzCWuvl1pkWw2kY1rDv7X8ryqqjEAsuY=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777563698; c=relaxed/simple;\n bh=scD0d35qpW9MiR+/KPx9SpTa5lApHqkmjZIqwjimUy4=;\n h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To;\n b=byeCpvEgAIM0syakOuoUSRRA7sJXRNHqn6rdkYgIpD0of4S90ibSGrq+iECFlAQC4aGBX1maCBPFm+SnwF3HKvnfr4+2AN6WTR3HOggUNhqMHNUkWMc2MmK91aD6TU+XG3UqH7dYip3c1PKu0hZpFODswU1oX/IFA+fJunooQU0=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1777563698;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:mime-version:mime-version:content-type:content-type;\n bh=T3bnDtzDPEOB35hr27e8VE4BImhjrX80n6O4ex1g3g4=;\n b=CjxrDZGc6hGTDaScXGmp3V8Hh+FNKLWokEX7sEiAYQ7ERHMl4bJWGL7CrMgXEwPpfKLpi3\n PvojfN8Wb2cy76JWVzELDJSyvCgcYUXl9WOE73Nd8OAcUuN6EMHyBjLrqaruaCmwW8Pwog\n B2e4caUIh7E1YVwgxNCddAciqWijM10=",
        "X-MC-Unique": "Nz3oMKgUN-ykfb2CheciDA-1",
        "X-Mimecast-MFC-AGG-ID": "Nz3oMKgUN-ykfb2CheciDA_1777563695",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777563695; x=1778168495;\n h=to:subject:from:content-language:user-agent:mime-version:date\n :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=XTdVQ8S/5OuaSFXozi/3lMVAceO+3jldUH0JBMhDD/U=;\n b=QN34ZZVXEx2aZK6k2ip/cvH4TtAXJ2DBdd2Rs+y9YZSrxIWFg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[
            "by 2002:a05:6214:3f81:b0:899:f092:9da with SMTP id\n 6a1803df08f44-8b3fe7bd179mr53130076d6.28.1777563695567;\n Thu, 30 Apr 2026 08:41:35 -0700 (PDT)",
            "by 2002:a05:6214:3f81:b0:899:f092:9da with SMTP id\n 6a1803df08f44-8b3fe7bd179mr53129276d6.28.1777563695020;\n Thu, 30 Apr 2026 08:41:35 -0700 (PDT)"
        ],
        "Message-ID": "<93501e9a-3bc8-49d2-bc82-03271aaa75fc@redhat.com>",
        "Date": "Thu, 30 Apr 2026 11:41:30 -0400",
        "MIME-Version": "1.0",
        "User-Agent": "Mozilla Thunderbird",
        "From": "Vladimir Makarov <vmakarov@redhat.com>",
        "Subject": "[pushed][IRA]: Process operand NO_REGS class for reg cost calculation",
        "To": "\"gcc-patches@gcc.gnu.org\" <gcc-patches@gcc.gnu.org>",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-MFC-PROC-ID": "b1IcqdADFBP9fC7allPRMk820rFKGhCe-ei-D69ZhP4_1777563695",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Type": "multipart/mixed; boundary=\"------------uJkaOAiwni9YtOKOvWy41nYz\"",
        "Content-Language": "en-US",
        "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": "The reason for the patch is in its commit message.\n\nThe patch was successfully bootstrapped and tested on \nx86-64,aarch64,ppc64le.",
    "diff": "commit 80a89027d9859c23fdc82200ca05dfffd147281b\nAuthor: Vladimir N. Makarov <vmakarov@redhat.com>\nDate:   Thu Apr 30 09:02:51 2026 -0400\n\n    [IRA]: Process operand NO_REGS class for reg cost calculation\n    \n    In record_reg_classes there is no special processing of case op_class ==\n    NO_REGS.  It can result in very high cost of the insn alternative cost.\n    The patch fixes this and can change generated code.\n    \n    gcc/ChangeLog:\n    \n            * ira-costs.cc (record_reg_classes): Process correctly case\n            op_class == NO_REGS.\n\ndiff --git a/gcc/ira-costs.cc b/gcc/ira-costs.cc\nindex 3a42837a995..d2ea0cc49e3 100644\n--- a/gcc/ira-costs.cc\n+++ b/gcc/ira-costs.cc\n@@ -722,13 +722,21 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,\n \t\t\t}\n \t\t    }\n \n-\t\t  /* If the alternative actually allows memory, make\n-\t\t     things a bit cheaper since we won't need an extra\n-\t\t     insn to load it.  */\n-\t\t  pp->mem_cost\n-\t\t    = ((out_p ? ira_memory_move_cost[mode][op_class][0] : 0)\n-\t\t       + (in_p ? ira_memory_move_cost[mode][op_class][1] : 0)\n-\t\t       - allows_mem[i]) * frequency;\n+\t\t  if (op_class == NO_REGS)\n+\t\t    /* Although we don't need insn to reload from\n+\t\t       memory, still accessing memory is usually more\n+\t\t       expensive than a register.  */\n+\t\t    pp->mem_cost = frequency;\n+\t\t  else\n+\t\t    /* If the alternative actually allows memory, make\n+\t\t       things a bit cheaper since we won't need an\n+\t\t       extra insn to load it.  */\n+\t\t    pp->mem_cost\n+\t\t      = ((out_p\n+\t\t\t  ? ira_memory_move_cost[mode][op_class][0] : 0)\n+\t\t\t + (in_p\n+\t\t\t    ? ira_memory_move_cost[mode][op_class][1] : 0)\n+\t\t\t - allows_mem[i]) * frequency;\n \n \t\t  /* If we have assigned a class to this allocno in\n \t\t     our first pass, add a cost to this alternative\n@@ -739,16 +747,28 @@ record_reg_classes (int n_alts, int n_ops, rtx *ops,\n \t\t      enum reg_class pref_class = pref[COST_INDEX (REGNO (op))];\n \n \t\t      if (pref_class == NO_REGS)\n+\t\t\t{\n+\t\t\t  if (op_class != NO_REGS)\n+\t\t\t    alt_cost\n+\t\t\t      += ((out_p\n+\t\t\t\t   ? ira_memory_move_cost[mode][op_class][0]\n+\t\t\t\t   : 0)\n+\t\t\t\t  + (in_p\n+\t\t\t\t     ? ira_memory_move_cost[mode][op_class][1]\n+\t\t\t\t     : 0));\n+\t\t\t}\n+\t\t      else if (op_class == NO_REGS)\n \t\t\talt_cost\n \t\t\t  += ((out_p\n-\t\t\t       ? ira_memory_move_cost[mode][op_class][0] : 0)\n+\t\t\t       ? ira_memory_move_cost[mode][pref_class][0]\n+\t\t\t       : 0)\n \t\t\t      + (in_p\n-\t\t\t\t ? ira_memory_move_cost[mode][op_class][1]\n+\t\t\t\t ? ira_memory_move_cost[mode][pref_class][1]\n \t\t\t\t : 0));\n \t\t      else if (ira_reg_class_intersect\n \t\t\t       [pref_class][op_class] == NO_REGS)\n-\t\t\talt_cost\n-\t\t\t  += ira_register_move_cost[mode][pref_class][op_class];\n+\t\t\talt_cost += (ira_register_move_cost\n+\t\t\t\t     [mode][pref_class][op_class]);\n \t\t    }\n \t\t  if (REGNO (ops[i]) != REGNO (ops[j])\n \t\t      && ! find_reg_note (insn, REG_DEAD, op))\n",
    "prefixes": [
        "pushed",
        "IRA"
    ]
}