From patchwork Sun Nov 5 18:49:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 161764 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2261351vqu; Sun, 5 Nov 2023 10:50:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGV2C55Rtayc39vgGsUvHDVr88gSjqy8HJokZx9lxYdfBSZxSKL2xVr59prk/IJSf1F8YoX X-Received: by 2002:ad4:4103:0:b0:670:b327:c86f with SMTP id i3-20020ad44103000000b00670b327c86fmr12210626qvp.17.1699210206954; Sun, 05 Nov 2023 10:50:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699210206; cv=pass; d=google.com; s=arc-20160816; b=PucPvCaYXZlS6/Naph+YWt/WnbtxwzoFszdZZPYxxuDXfB5Neuj2SyG7jzgMWvB7KZ 0YP6z4/E9HbHqy/M3y9ztu963WJbgS9jLlaIju+F69UB9k6vJ38HOaM0I0h2opIeVFHN pIODipsR7PammqqIKNdxX/602lgbsH8/sAX5VQPdFJ9rW+QWdtYNnVbaGuLjq/8guJEx ntnizMAGGCR6YZOI99++JqXT38Thunt85DoLdFj7JeTFAfYx4jSYdEBjCSdIymvlHHCf a7++qet/Q7+G05umgztR6d3GN8kUhKYMlT4x0U0TPKpJtsB2bTfr65bZTIh/iq+0tx5d wHVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:in-reply-to:date:references:subject:cc:mail-followup-to :to:from:arc-filter:dmarc-filter:delivered-to; bh=xmh/fEeyg0+hPdB4fuEzbgq4IGyogayBPc2RQZyoMfU=; fh=+zKahnQ9dI9rCMQA/vTUSn1PPyLwgfSULGOjxoIZkos=; b=cTQJlZMj7vLe5lmeTYQ2qIUDprd107Vt8ovxpRG5AdoB67xwj4prE8rID3eHZ2UF4B D41X5S2vr6LxwgNqxhCpaSVzZNDmQlvNzu/tOTcPdGLeeCmFoDwh/l88t+Mlsu66td3n IRC1VaeMfFePqXw6tDWbdXuQwZ7t3pUPei12WoVmB+YAQifpI7Y+TVjaEFkkwbyqXx2i 9zhYCU3oiHe9I5ib8rOmzj++VcUrEwi6O0JEyLoSsStZC88KVTRrKq56TllHphCrqB29 h20PgKv0nhp1BlAgCfQyAD+35E/csjH9CL9aAvc/yFg9F5i6RtfnxnWELT94x3h2E1rp g/bA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l16-20020a056214029000b0065b10dbcd58si4464622qvv.9.2023.11.05.10.50.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 10:50:06 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B3B0A385802F for ; Sun, 5 Nov 2023 18:50:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id AF487385701B for ; Sun, 5 Nov 2023 18:49:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF487385701B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF487385701B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699210184; cv=none; b=tSBpdfJ9issUo0Nv6UTjz59GSkw93iOGAXXUimGeifFJPkFburztCgOrlL9bTJUKy9p0M6g6r6rIXfl7506T5K2VbEfZX/GlnRA1SnNTH69UsinFOTfeN9TWR+ofOQVMH6aJq7fp63zxyVSxSsC/EiXpFLfzJG+HFt3xvx5Id9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699210184; c=relaxed/simple; bh=XBcUiHb7RLX8+jUUDITs7Z+kTBawIfBlGnINMFq6FVE=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=plDEbyWB02dVawc12ETMdtg/BIb1TKM8Ua7BUT9OzO6+M/y8Wk46q9Da4pU3BL/azzHw1ZIPCi9QZufPkFVcAvLe1DWwR8t8nPFcrFfkZhmX6cicd4Xf8Qn+gGEZsec85gfAULdijkpNpXJWSn/z0NYZTvm/EXfwZCaDHZT0yPs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4E04EC15; Sun, 5 Nov 2023 10:50:27 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0A63E3F703; Sun, 5 Nov 2023 10:49:42 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, jlaw@ventanamicro.com, richard.sandiford@arm.com Cc: jlaw@ventanamicro.com Subject: [PATCH 10/12] mode-switching: Use 1-based edge aux fields References: Date: Sun, 05 Nov 2023 18:49:41 +0000 In-Reply-To: (Richard Sandiford's message of "Sun, 05 Nov 2023 18:45:29 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-23.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781751041910873632 X-GMAIL-MSGID: 1781751041910873632 The pass used the edge aux field to record which mode change should happen on the edge, with -1 meaning "none". It's more convenient for later patches to leave aux zero for "none", and use numbers based at 1 to record a change. gcc/ * mode-switching.cc (commit_mode_sets): Use 1-based edge aux values. --- gcc/mode-switching.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gcc/mode-switching.cc b/gcc/mode-switching.cc index 7a5c4993d65..1815b397dd0 100644 --- a/gcc/mode-switching.cc +++ b/gcc/mode-switching.cc @@ -106,10 +106,10 @@ commit_mode_sets (struct edge_list *edge_list, int e, struct bb_info *info) for (int ed = NUM_EDGES (edge_list) - 1; ed >= 0; ed--) { edge eg = INDEX_EDGE (edge_list, ed); - int mode; - if ((mode = (int)(intptr_t)(eg->aux)) != -1) + if (eg->aux) { + int mode = (int) (intptr_t) eg->aux - 1; HARD_REG_SET live_at_edge; basic_block src_bb = eg->src; int cur_mode = info[src_bb->index].mode_out; @@ -728,14 +728,12 @@ optimize_mode_switching (void) { edge eg = INDEX_EDGE (edge_list, ed); - eg->aux = (void *)(intptr_t)-1; - for (i = 0; i < no_mode; i++) { int m = targetm.mode_switching.priority (entity_map[j], i); if (mode_bit_p (insert[ed], j, m)) { - eg->aux = (void *)(intptr_t)m; + eg->aux = (void *) (intptr_t) (m + 1); break; } }