From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Type: text/plain 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 List-Id: 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; } } -- 2.25.1