Cover Letter Detail
Show a cover letter.
GET /api/covers/2217618/?format=api
{ "id": 2217618, "url": "http://patchwork.ozlabs.org/api/covers/2217618/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/cover/20260330090714.868443-1-philipp.tomsich@vrull.eu/", "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": "<20260330090714.868443-1-philipp.tomsich@vrull.eu>", "list_archive_url": null, "date": "2026-03-30T09:07:12", "name": "[0/2] ext-dce: narrow sign-extending loads when upper bits are dead", "submitter": { "id": 80556, "url": "http://patchwork.ozlabs.org/api/people/80556/?format=api", "name": "Philipp Tomsich", "email": "philipp.tomsich@vrull.eu" }, "mbox": "http://patchwork.ozlabs.org/project/gcc/cover/20260330090714.868443-1-philipp.tomsich@vrull.eu/mbox/", "series": [ { "id": 497982, "url": "http://patchwork.ozlabs.org/api/series/497982/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=497982", "date": "2026-03-30T09:07:14", "name": "ext-dce: narrow sign-extending loads when upper bits are dead", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497982/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/2217618/comments/", "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=vrull.eu header.i=@vrull.eu header.a=rsa-sha256\n header.s=google header.b=q6ZsNZOI;\n\tdkim-atps=neutral", "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;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=vrull.eu header.i=@vrull.eu header.a=rsa-sha256\n header.s=google header.b=q6ZsNZOI", "sourceware.org;\n dmarc=none (p=none dis=none) header.from=vrull.eu", "sourceware.org; spf=pass smtp.mailfrom=vrull.eu", "server2.sourceware.org;\n arc=none smtp.remote-ip=209.85.167.44" ], "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 4fklnC4kZLz1yG8\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 20:09:35 +1100 (AEDT)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 772884BA2E28\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 09:09:33 +0000 (GMT)", "from mail-lf1-f44.google.com (mail-lf1-f44.google.com\n [209.85.167.44])\n by sourceware.org (Postfix) with ESMTPS id F349E4B7A1C7\n for <gcc-patches@gcc.gnu.org>; Mon, 30 Mar 2026 09:07:20 +0000 (GMT)", "by mail-lf1-f44.google.com with SMTP id\n 2adb3069b0e04-59e58404f28so644544e87.2\n for <gcc-patches@gcc.gnu.org>; Mon, 30 Mar 2026 02:07:20 -0700 (PDT)", "from ubuntu-focal.. ([2a01:4f9:3a:1e26::2])\n by smtp.gmail.com with ESMTPSA id\n 2adb3069b0e04-5a2b144e99bsm1552448e87.56.2026.03.30.02.07.18\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 30 Mar 2026 02:07:18 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 772884BA2E28", "OpenDKIM Filter v2.11.0 sourceware.org F349E4B7A1C7" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org F349E4B7A1C7", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org F349E4B7A1C7", "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1774861642; cv=none;\n b=RDj8j4xe9oQa0bhtXERFv6PoUtNwmPchOnwbvcaevWShxjnCvh72d+Uewa4NKRmzHa5pcSsPLmeBkPoZjEBbhMX8IW7bdyeZZa5Y/CKrayTzjB9TAG2Vkg8PJuQaLGGUG0awKzXkZtyl/o2jp3/6E908v6ApIFrLtNXBtAbSUeM=", "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1774861642; c=relaxed/simple;\n bh=8YjAAKUTZ5vecmlFIzVR78v1d346FkigOzofzqV1+AM=;\n h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version;\n b=EA/v/PpIQz9WgfIuX9XMk7Zh+ZiGhLDXZojpt23Lh3jCgwDiLGqIwf31E7sWHzTLCKnYYMwIDuUVpAbfsNPfpY0Yzb2IZeW4s12MIZWJOvKwVZzbd/rlHldJIak7kFGfEMjIiZDtHnDe+e3HcCMRohV4shjYJu7xHYvf8yKQmqk=", "ARC-Authentication-Results": "i=1; server2.sourceware.org", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=vrull.eu; s=google; t=1774861639; x=1775466439; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=sgab0ILhZ19tNhrfrFofpDqfvMB5E6E2NgIQwxgTwec=;\n b=q6ZsNZOIja65PDJ2V6JCy2MV0fpN56S0U1PJyuDqUcE3FoJ2R7qXiP3LEytVV3fls3\n xlCw2dx/TG6pMEfDEByS/5moASJsmUR/DSAX2VMrE3eqnS72h98Dx2Q0I2jOXUWLaTXF\n /6vjgIQWgFe636m6Q43j2xWyvXC3LJcC8GaqLv6YTLdw3S0Wp8PgtuLIYgnJ/9cEJYTa\n 8saSnYfqAK1GFCkod6kVewFVilkL/Erp+t1h5gjhgVB55ZA+1Ulm4nlhNdlZkk/NlJdw\n cfEz1IVXmP1U+nHarwj16FelLXDXVdEvw8A5EUrX4g+A5LZSZt61NkTuCPnikOIf0mwV\n IfdQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774861639; x=1775466439;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sgab0ILhZ19tNhrfrFofpDqfvMB5E6E2NgIQwxgTwec=;\n b=TMrzbmbLqZ+2O0pc5BPxn5aIHe8ywOPNn9rL3prrkU+xtJxHws7yNe01xXOkK67l7h\n 8nwD3MZ4PjWI+t6YJlza46yeTD1MRHIo8Y5VlNHi3ECth+oHpOkma4tMqOBGm3mpnVwa\n 2mAQNMIOB3qQZKH5SPCCnzd2DqzCFWM943qOyx2vocHpZ7q0aNQirfn968kWcM8+1CB/\n kJ00naA9IXga9kcGGjI2fNkwJfeTEwFPXUqWev0Ip9u+H4MRU74UXtlZphR+6f0hQfyi\n zl9KFkgb023Rpgnp+mQf6CbUG55GX7JMtzMfaIKGWvOAUbOh9Y08gvkN+D2LlbgvijNz\n fmZA==", "X-Gm-Message-State": "AOJu0YxDdTVEtxJWcxL1WBqe59KC2f063rm/IQVVWjSkckE7uIDlAK7s\n Lm8nu6JYzRQadB0JysMqTPWzDX5XMEheDlIZi0rUa9kgRn6ev3OxetT8iPG8fPnxlBAzTMnKNFy\n JJNUZ/Zg=", "X-Gm-Gg": "ATEYQzyXHmJyzeFSS6mOrR0nSNdXB/OVEjP2H+n9MMubisyTkQyXpkegLrjMb2k4ec/\n BF2jkzeL1/pY6iJzxhLFw9GR4qDKnmfcQQPJ0fBS5mReYPkHtJDDMJp4RVlfurzrnM/TbaN1EId\n q+aWSN7G/kVaiWneMGEF/I2l1l90Os74GUwQf5Fiatbu/a9+EPh2dIOt+h8/s8ib1/mv1pkumvF\n F2eLwZ6MBSBIGkUyzmScpYzrm8nUmeqnFgF0cFTip3LQL9abQXVk3rWC3GKvU0oIrxUa/BC/uXd\n CDRF3TrN6BxXAtxHzhD2Qhkm8mPg2jFFD40Xoqtud10Ht3geAdXB+ZmRbRvAPJr6PLkRjpKKR/p\n hbb0clhJ73jdf7qgZNBPIRji1gtXpyWlHfBcVk04OSNS2tY+AOG7IClKMo81ZWc4YoO0kHgMKr7\n h4fnWOULGg1ouHdxxEZ76y5SPLDbYTgwzBQCV3ntEI9mrWQJlZRG0/", "X-Received": "by 2002:a05:6512:1152:b0:5a2:7798:9990 with SMTP id\n 2adb3069b0e04-5a2ab7e8bc2mr2004846e87.1.1774861639222;\n Mon, 30 Mar 2026 02:07:19 -0700 (PDT)", "From": "Philipp Tomsich <philipp.tomsich@vrull.eu>", "To": "gcc-patches@gcc.gnu.org", "Cc": "Philipp Tomsich <philipp.tomsich@vrull.eu>", "Subject": "[PATCH 0/2] ext-dce: narrow sign-extending loads when upper bits are\n dead", "Date": "Mon, 30 Mar 2026 11:07:12 +0200", "Message-Id": "<20260330090714.868443-1-philipp.tomsich@vrull.eu>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "This 2-patch series teaches the ext-dce pass to replace sign-extending\nloads with zero-extending loads when the bit-level liveness analysis\ndetermines the sign-extended bits are dead.\n\nThe ext-dce pass already correctly identifies dead sign bits and can\noptimise sign_extend(REG) -> subreg(REG). However,\next_dce_try_optimize_extension bails out when the inner operand is MEM,\nmissing opportunities such as lh -> lhu (RISC-V), ldrsh -> ldrh\n(AArch64), and movswl -> movzwl (x86).\n\nPatch 1 fixes a pre-existing off-by-one in ext_dce_process_uses where\n`size >= 32` incorrectly marks bits 32-63 as live for SImode lowpart\nsubregs, blocking lw -> lwu narrowing on RV64.\n\nPatch 2 adds handling for SIGN_EXTEND of MEM: when the sign bits are\ndead, it generates ZERO_EXTEND(MEM) and uses validate_change to let\nthe backend confirm it has a matching pattern. This is\ntarget-independent -- any backend with zero-extending load patterns\nbenefits.\n\nBootstrapped and regression tested on AArch64 and x86.\n\n\nPhilipp Tomsich (2):\n ext-dce: fix off-by-one in subreg liveness for 32-bit modes\n ext-dce: narrow sign-extending loads to zero-extending when upper bits\n are dead\n\n gcc/ext-dce.cc | 48 +++++++++++++++-\n gcc/testsuite/gcc.target/aarch64/ext-dce-1.c | 58 ++++++++++++++++++++\n gcc/testsuite/gcc.target/riscv/ext-dce-2.c | 58 ++++++++++++++++++++\n gcc/testsuite/gcc.target/riscv/ext-dce-3.c | 33 +++++++++++\n 4 files changed, 196 insertions(+), 1 deletion(-)\n create mode 100644 gcc/testsuite/gcc.target/aarch64/ext-dce-1.c\n create mode 100644 gcc/testsuite/gcc.target/riscv/ext-dce-2.c\n create mode 100644 gcc/testsuite/gcc.target/riscv/ext-dce-3.c" }