From patchwork Sun Jul 21 14:42:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1962925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=lU3OBP1w; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WRmNb2VNgz1yZ7 for ; Mon, 22 Jul 2024 00:42:53 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6FD1D3858C33 for ; Sun, 21 Jul 2024 14:42:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x22c.google.com (mail-oi1-x22c.google.com [IPv6:2607:f8b0:4864:20::22c]) by sourceware.org (Postfix) with ESMTPS id A23E7385E45C for ; Sun, 21 Jul 2024 14:42:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A23E7385E45C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A23E7385E45C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::22c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721572955; cv=none; b=IDFu5DMTH+vP7Ej8wppSlkknThz1Rg7qC3jgXp17n59VSX7+3TbG1nUGajW4xwqj+vE74gVESAVfcZs/fz6wrVx2Bo2OqwKMhfu8U8Ao9gj4oQ72ezQbUeSbWX5PigMHtbYF/VBTcP0Wu8LTV/p6qeLXukEMRAmX0tzRrl93Ad0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721572955; c=relaxed/simple; bh=gEWunRo+7nUZjdaZN7NWD9DmWT0ZPBCtHGhRHY7Ubig=; h=DKIM-Signature:Message-ID:Date:MIME-Version:From:Subject:To; b=lc1eAcTiAAfoZspD6nq0qM59IpQ8xQE7nt7gABVtuRWjcXOvNfg11us6++y6uE1krHGSa4gcO9FY9p9VnqKRvjfJYfvq2U3IEIPfkd8Jb8RNXFJy3jdQkBHBTVCoBO8YP9+rCRwUcinOUebMS1UcxG/UQtK2qDfrnqd90SdC/E0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3d92df7e83cso1728898b6e.0 for ; Sun, 21 Jul 2024 07:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721572952; x=1722177752; darn=gcc.gnu.org; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=AtIhqMJfeHjbI/D4vLyRrO7mrhyNK8Af8fnZgPtBD4o=; b=lU3OBP1waOLnEJtnpkx9Ez1e9cw99jejr8NmsgCa6ASA0aHiZqITPh2p9YaJkcn6Tn VJNO2gc0OsKh4Qc64krXPwyAYjLRny5wVuy1oAa1fSvbMTD4tCp0iir+7xhCHE7bmpFU 6KEl87iDyknYc2hrM+ZlAeomFojoJIsPxVaHfLEvrGyr6X7qAeYftrfM75cw2H5fvGUe QGwzSzW5J6HMHLOGqYl60XbzprAFhI+792xytCfaEx2bQq7soikeY2V1dmPHZbw5BvPv T4QIOFdD4hQnlBOep0cb6Rf9o3AfycWx6vJuhj18d64ZGdOzKpJ6wd+BGxM7jq2KgkBB WdvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721572952; x=1722177752; h=to:subject:from:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AtIhqMJfeHjbI/D4vLyRrO7mrhyNK8Af8fnZgPtBD4o=; b=TKVKom+pOI8nstExmurFoMFN7Zg5BLJNWUJPtZuC3nnJ+FncIsFT2C1YNLl392eSgz DO3RZe2GVjPIcrZRaGfJIrUnutSDVdUtG1Nk99jBmMCBstzPvDg56md2qOyA1r5eM6fH vQkcJEJ16a3yUHKqVv7f5dsFq8sryZDT1rDIKLQom1GG1Q1BLmZeZ6zm97Wgfjnv8TQO 8U3kpHv/Xa1TWxgFT777Iqctix3ZqPpVl8tYYwPb6ayYr0o0n62XPMPWMFpSt4DwyLzL t2fF2eggp9AtczoZv81HZIiwsQs76w+X8MdfuVax2VeXLeIXLKLNWlWJl7gfUSXYOmE1 YcRA== X-Gm-Message-State: AOJu0YzvY5i8y9suWT10xnMEmBGaVnZMT/ZzzsJSssnx1IW7gNnceeoJ mzhYkJP/NgHGfbx93VyIcW/cj3W+BB1RqwPTguOsGz/pHn20fzRVNe8AOyyM X-Google-Smtp-Source: AGHT+IFDm0Qkku1nlr/QFIJBDYDQf5RJrWSlnGRf9DjXBVnglwfgnsODilF2cb8gnoywDAfB4Ef5AA== X-Received: by 2002:a05:6808:1812:b0:3d9:3290:6430 with SMTP id 5614622812f47-3dad73b8c34mr5574091b6e.2.1721572952344; Sun, 21 Jul 2024 07:42:32 -0700 (PDT) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3dae098fd97sm1118015b6e.26.2024.07.21.07.42.31 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 21 Jul 2024 07:42:31 -0700 (PDT) Message-ID: <2779f1f1-38c3-460b-84dd-9bc49b3f3367@gmail.com> Date: Sun, 21 Jul 2024 08:42:30 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Content-Language: en-US From: Jeff Law Subject: [committed][PR rtl-optimization/115877][2/n] Improve liveness computation for constant initialization To: "gcc-patches@gcc.gnu.org" X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org While debugging pr115877, I noticed we were failing to remove the destination register from LIVENOW bitmap when it was set to a constant value. ie (set (dest) (const_int)). This was a trivial oversight in safe_for_live_propagation. I don't have an example of this affecting code generation, but it certainly could. More importantly, by making LIVENOW more accurate it's easier to debug when LIVENOW differs from expectations. As with the prior patch this has been tested as part of a larger patchset with the crosses as well as individually on x86_64. Pushing to the trunk, Jeff PR rtl-optimization/115877 gcc/ * ext-dce.cc (safe_for_live_propagation): Handle RTX_CONST_OBJ. diff --git a/gcc/ext-dce.cc b/gcc/ext-dce.cc index 6d4b8858ec6..cbecfc53dba 100644 --- a/gcc/ext-dce.cc +++ b/gcc/ext-dce.cc @@ -69,6 +69,7 @@ safe_for_live_propagation (rtx_code code) switch (GET_RTX_CLASS (code)) { case RTX_OBJ: + case RTX_CONST_OBJ: return true; case RTX_COMPARE: