Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/810175/?format=api
{ "id": 810175, "url": "http://patchwork.ozlabs.org/api/patches/810175/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/CAFULd4Z9F8J3+hDM51fsjHcQ7XPrwdj4Geoyd53Nf4JKS+szYQ@mail.gmail.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": "<CAFULd4Z9F8J3+hDM51fsjHcQ7XPrwdj4Geoyd53Nf4JKS+szYQ@mail.gmail.com>", "list_archive_url": null, "date": "2017-09-05T13:50:00", "name": "[v2,middle-end] : Introduce memory_blockage named insn pattern", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "8dd34addd6b49ad8afb4bb3169e21e0574fdaf5f", "submitter": { "id": 808, "url": "http://patchwork.ozlabs.org/api/people/808/?format=api", "name": "Uros Bizjak", "email": "ubizjak@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/CAFULd4Z9F8J3+hDM51fsjHcQ7XPrwdj4Geoyd53Nf4JKS+szYQ@mail.gmail.com/mbox/", "series": [ { "id": 1585, "url": "http://patchwork.ozlabs.org/api/series/1585/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=1585", "date": "2017-09-05T13:50:00", "name": "[v2,middle-end] : Introduce memory_blockage named insn pattern", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/1585/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/810175/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/810175/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<gcc-patches-return-461508-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list gcc-patches@gcc.gnu.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461508-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"gvJ+WwVV\"; dkim-atps=neutral", "sourceware.org; auth=none" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmp4r3R5bz9t2R\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 5 Sep 2017 23:50:19 +1000 (AEST)", "(qmail 3778 invoked by alias); 5 Sep 2017 13:50:09 -0000", "(qmail 2307 invoked by uid 89); 5 Sep 2017 13:50:08 -0000", "from mail-ua0-f177.google.com (HELO mail-ua0-f177.google.com)\n\t(209.85.217.177) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tTue, 05 Sep 2017 13:50:02 +0000", "by mail-ua0-f177.google.com with SMTP id q29so5690835uaf.3 for\n\t<gcc-patches@gcc.gnu.org>; Tue, 05 Sep 2017 06:50:02 -0700 (PDT)", "by 10.103.99.2 with HTTP; Tue, 5 Sep 2017 06:50:00 -0700 (PDT)" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:mime-version:from:date:message-id:subject:to:cc:content-type;\n\tq=dns; s=default; b=pbELo3v8oqQDr75ar196nXZmy44st/OTsTsk9Joxt0T\n\toljifd6wo767DApg73MVXe7Kj7VdyO5STzlsbKuUaqp0QfnP3kgN+3YZ43H2Uy53\n\t4XmOMlbQlWqsumehKDGjof2ooXQmYa2LdITbtZ5u2LnG/kcUOJxip5T3BHmi2yvo\n\t=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:mime-version:from:date:message-id:subject:to:cc:content-type;\n\ts=default; bh=vS38FiQgc0vCKyPAHJAkh8h1WpY=; b=gvJ+WwVVwdyuGBxfE\n\tB1jjSB33rudTciTkQ9/I+TUQP3qqGZc33M892/yjklpz+Lf7TBR0gTDHVfQ5i1P6\n\tqYAwE+FXHBdX6n4t+qv0z/Nve7Rt0uDjQbAlM6JX1WHMrLxheTWOPiOBotEqi7jG\n\t/y3URZEHvLy+2Ar7dxtUcwg/zs=", "Mailing-List": "contact gcc-patches-help@gcc.gnu.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<gcc-patches.gcc.gnu.org>", "List-Unsubscribe": "<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>", "List-Archive": "<http://gcc.gnu.org/ml/gcc-patches/>", "List-Post": "<mailto:gcc-patches@gcc.gnu.org>", "List-Help": "<mailto:gcc-patches-help@gcc.gnu.org>", "Sender": "gcc-patches-owner@gcc.gnu.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-24.3 required=5.0 tests=AWL, BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2,\n\tGIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=", "X-HELO": "mail-ua0-f177.google.com", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net;\n\ts=20161025;\n\th=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc;\n\tbh=4JeFHCjP8vEPdToxkIWZEsBoqI+c8BdffHh3TifbBDY=;\n\tb=JvSlcCB+B1clTI+88WjEcycIQMzjmsRXz7Qe7vRq9AfE4cbCC6jEo1LTxNgENCrYWo\n\thhXJ/vRKtcYHpAqHYWpgwUDwUWsEv44/MLWJOzLhStSCvuI3kQGvd06ey1MuDxLrBfJJ\n\tJvr3j8cYu1jy+nccHhNoUBPuZT4Dqv+nHWY9uINh9MobVHcEtBVv3yZaxDbJD7boXKyx\n\th1cumFF9hgRgpa50+zibCHaHq+D0roMfHDHBKlmy6sr6OXCPbwZKTDMDw2M3Sa1FrMD2\n\tEkw+/3gnDZjYPF8xBv5Yl9yycjmI4GSRX1Ne3QRExBXmHjMoXFmrHpKutD1wvu9OgFYJ\n\tPkBw==", "X-Gm-Message-State": "AHPjjUgO7G0DAFqCgR5y/e3bZp0fNOrPTMiyN6pcm7c3ik+hll2Tqk9j\tHdUSmyMg+af0xU9cd71na6h7Te5GMA==", "X-Google-Smtp-Source": "ADKCNb7fvnw/GDegUNyicANu5KxDdDptj3yiKvO+4+Fv6ydjxl7yEMvAKb6HnbfJO69DCYp/tmgxDunbtiTR4IuA4go=", "X-Received": "by 10.176.73.169 with SMTP id e38mr2672930uad.132.1504619400851;\n\tTue, 05 Sep 2017 06:50:00 -0700 (PDT)", "MIME-Version": "1.0", "From": "Uros Bizjak <ubizjak@gmail.com>", "Date": "Tue, 5 Sep 2017 15:50:00 +0200", "Message-ID": "<CAFULd4Z9F8J3+hDM51fsjHcQ7XPrwdj4Geoyd53Nf4JKS+szYQ@mail.gmail.com>", "Subject": "[PATCH v2, middle-end]: Introduce memory_blockage named insn pattern", "To": "Alexander Monakov <amonakov@ispras.ru>", "Cc": "\"gcc-patches@gcc.gnu.org\" <gcc-patches@gcc.gnu.org>,\n\tJeff Law <law@redhat.com>", "Content-Type": "multipart/mixed; boundary=\"001a1144f678e90fb5055871808f\"" }, "content": "Revised patch, incorporates fixes from Alexander's review comments.\n\nI removed some implementation details from Alexander's description of\nmemory_blockage named pattern.\n\n\n2017-09-05 Uros Bizjak <ubizjak@gmail.com>\n\n * target-insns.def: Add memory_blockage.\n * optabs.c (expand_memory_blockage): New function.\n (expand_asm_memory_barrier): Rename ...\n (expand_asm_memory_blockage): ... to this.\n (expand_mem_thread_fence): Call expand_memory_blockage\n instead of expand_asm_memory_barrier.\n (expand_mem_singnal_fence): Ditto.\n (expand_atomic_load): Ditto.\n (expand_atomic_store): Ditto.\n * doc/md.texi (Standard Pattern Names For Generation):\n Document memory_blockage instruction pattern.\n\nBootstrapped and regression tested together with a followup x86 patch\non x86_64-linux-gnu {,-m32}.\n\nOK for mainline?\n\nUros.", "diff": "diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi\nindex 14aab9474bc2..c4c113850fe1 100644\n--- a/gcc/doc/md.texi\n+++ b/gcc/doc/md.texi\n@@ -6734,6 +6734,15 @@ scheduler and other passes from moving instructions and using register\n equivalences across the boundary defined by the blockage insn.\n This needs to be an UNSPEC_VOLATILE pattern or a volatile ASM.\n \n+@cindex @code{memory_blockage} instruction pattern\n+@item @samp{memory_blockage}\n+This pattern, if defined, represents a compiler memory barrier, and will be\n+placed at points across which RTL passes may not propagate memory accesses.\n+This instruction needs to read and write volatile BLKmode memory. It does\n+not need to generate any machine instruction. If this pattern is not defined,\n+the compiler falls back to emitting an instruction corresponding\n+to @code{asm volatile (\"\" ::: \"memory\")}.\n+\n @cindex @code{memory_barrier} instruction pattern\n @item @samp{memory_barrier}\n If the target memory model is not fully synchronous, then this pattern\ndiff --git a/gcc/optabs.c b/gcc/optabs.c\nindex b65707080eee..94060036e61f 100644\n--- a/gcc/optabs.c\n+++ b/gcc/optabs.c\n@@ -6276,10 +6276,10 @@ expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval,\n return true;\n }\n \n-/* Generate asm volatile(\"\" : : : \"memory\") as the memory barrier. */\n+/* Generate asm volatile(\"\" : : : \"memory\") as the memory blockage. */\n \n static void\n-expand_asm_memory_barrier (void)\n+expand_asm_memory_blockage (void)\n {\n rtx asm_op, clob;\n \n@@ -6295,6 +6295,17 @@ expand_asm_memory_barrier (void)\n emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, asm_op, clob)));\n }\n \n+/* Do not propagate memory accesses across this point. */\n+\n+static void\n+expand_memory_blockage (void)\n+{\n+ if (targetm.have_memory_blockage)\n+ emit_insn (gen_memory_blockage ());\n+ else\n+ expand_asm_memory_blockage ();\n+}\n+\n /* This routine will either emit the mem_thread_fence pattern or issue a \n sync_synchronize to generate a fence for memory model MEMMODEL. */\n \n@@ -6306,14 +6317,14 @@ expand_mem_thread_fence (enum memmodel model)\n if (targetm.have_mem_thread_fence ())\n {\n emit_insn (targetm.gen_mem_thread_fence (GEN_INT (model)));\n- expand_asm_memory_barrier ();\n+ expand_memory_blockage ();\n }\n else if (targetm.have_memory_barrier ())\n emit_insn (targetm.gen_memory_barrier ());\n else if (synchronize_libfunc != NULL_RTX)\n emit_library_call (synchronize_libfunc, LCT_NORMAL, VOIDmode);\n else\n- expand_asm_memory_barrier ();\n+ expand_memory_blockage ();\n }\n \n /* Emit a signal fence with given memory model. */\n@@ -6324,7 +6335,7 @@ expand_mem_signal_fence (enum memmodel model)\n /* No machine barrier is required to implement a signal fence, but\n a compiler memory barrier must be issued, except for relaxed MM. */\n if (!is_mm_relaxed (model))\n- expand_asm_memory_barrier ();\n+ expand_memory_blockage ();\n }\n \n /* This function expands the atomic load operation:\n@@ -6346,7 +6357,7 @@ expand_atomic_load (rtx target, rtx mem, enum memmodel model)\n struct expand_operand ops[3];\n rtx_insn *last = get_last_insn ();\n if (is_mm_seq_cst (model))\n-\texpand_asm_memory_barrier ();\n+\texpand_memory_blockage ();\n \n create_output_operand (&ops[0], target, mode);\n create_fixed_operand (&ops[1], mem);\n@@ -6354,7 +6365,7 @@ expand_atomic_load (rtx target, rtx mem, enum memmodel model)\n if (maybe_expand_insn (icode, 3, ops))\n \t{\n \t if (!is_mm_relaxed (model))\n-\t expand_asm_memory_barrier ();\n+\t expand_memory_blockage ();\n \t return ops[0].value;\n \t}\n delete_insns_since (last);\n@@ -6404,14 +6415,14 @@ expand_atomic_store (rtx mem, rtx val, enum memmodel model, bool use_release)\n {\n rtx_insn *last = get_last_insn ();\n if (!is_mm_relaxed (model))\n-\texpand_asm_memory_barrier ();\n+\texpand_memory_blockage ();\n create_fixed_operand (&ops[0], mem);\n create_input_operand (&ops[1], val, mode);\n create_integer_operand (&ops[2], model);\n if (maybe_expand_insn (icode, 3, ops))\n \t{\n \t if (is_mm_seq_cst (model))\n-\t expand_asm_memory_barrier ();\n+\t expand_memory_blockage ();\n \t return const0_rtx;\n \t}\n delete_insns_since (last);\ndiff --git a/gcc/target-insns.def b/gcc/target-insns.def\nindex 4669439c7e1d..75976b2f8d99 100644\n--- a/gcc/target-insns.def\n+++ b/gcc/target-insns.def\n@@ -60,6 +60,7 @@ DEF_TARGET_INSN (jump, (rtx x0))\n DEF_TARGET_INSN (load_multiple, (rtx x0, rtx x1, rtx x2))\n DEF_TARGET_INSN (mem_thread_fence, (rtx x0))\n DEF_TARGET_INSN (memory_barrier, (void))\n+DEF_TARGET_INSN (memory_blockage, (void))\n DEF_TARGET_INSN (movstr, (rtx x0, rtx x1, rtx x2))\n DEF_TARGET_INSN (nonlocal_goto, (rtx x0, rtx x1, rtx x2, rtx x3))\n DEF_TARGET_INSN (nonlocal_goto_receiver, (void))\n", "prefixes": [ "v2", "middle-end" ] }