From patchwork Mon Jan 30 20:59:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 648575 Delivered-To: patch@linaro.org Received: by 2002:a17:906:c198:b0:888:9ecf:6623 with SMTP id g24csp894906ejz; Mon, 30 Jan 2023 13:00:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXsnmjnqZ8E4aHXtrFGjoC7+zQr4nfNRkv2+Qk9+X2CWGSVFRCdl25u4jNX4EqqZh2O9LKxO X-Received: by 2002:ac8:610f:0:b0:3b6:9c63:5ca1 with SMTP id a15-20020ac8610f000000b003b69c635ca1mr55401153qtm.43.1675112435395; Mon, 30 Jan 2023 13:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675112435; cv=none; d=google.com; s=arc-20160816; b=MkBjYKlG5IouLXjy0SDFiZSSE5YEZDWGAVN7JCDFUdBosdvfOt4xx4fBl3nPPkEOx6 mfe59GHmEKSRefknzUMZ8tJ9hgTUU/aYeEgcUigo/8dn3QPzfRT1xn0NtE4b0Sr405lW QDP8jO2WTsFcMFl86pq0eO77HSdawXjeiKkjrwpK/G52h0/lUk+MbJFAhb4WVqguxBWq Tp7okhfOYwgZjHfrhCWXNFSSh0B25FOpFQN3b/6Va+y9BCEMRsdzrVRQMk9aupeIfyQD FSm5Dd1SE8S0hC0CWQITdEd9BtWps9X+clM7ZMXIkl+r5H3g9htlPhp6js8ediClwI9h XNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2E58Iw876uTd6FlkZzM6tT65+aYePaxETl7ncokxgbo=; b=qbhCg1Ue0VDy3JvMkkuozWTJJeJIMyA8aAFIMXvYLe4lDNrWqSLC+3sgn5+ke1/Hkn V5UkoL3Y8sIAs8R/LNvWkM/mVklq5t1BU7jGAp7B2vZ7W1w31QmLFzkAIGsWYfszs/z1 3klsxGNKXj2BkHZ3dpYZe3DfuXV4QNa0lHxnfIigX47u8TCcawAUViXttawYZYddR5Hg GsGgELXfEm+uk+R2K1P0bM9dblpBBIDLIaeji9e6b544STGrwsW5CHm2glYCY/ZnC9ir H+ehtx1z63nNLoCs0aEyJoOm/jkPk1HV6Sc1K1qm58Or8LT9uL9e/64z5Gv+TlIjJHS3 BjuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJmPGhhH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v14-20020a05622a188e00b003b635b87abbsi6907417qtc.11.2023.01.30.13.00.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jan 2023 13:00:35 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aJmPGhhH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMbFu-00088f-QI; Mon, 30 Jan 2023 15:59:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMbFp-0007c4-OT for qemu-devel@nongnu.org; Mon, 30 Jan 2023 15:59:54 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMbFn-0005Ey-4W for qemu-devel@nongnu.org; Mon, 30 Jan 2023 15:59:53 -0500 Received: by mail-pf1-x435.google.com with SMTP id z1so5765894pfg.12 for ; Mon, 30 Jan 2023 12:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2E58Iw876uTd6FlkZzM6tT65+aYePaxETl7ncokxgbo=; b=aJmPGhhHMw3nd1pu8s4Nymoo+IbHVRRTxMEAOpjvhDbMkrE2+d1jPlZmF8dnl/RV9a 02JSqUc0qSZHfdU8NCRE5Ydjd5rSkCR8R3BxKuXQlVvp2bAEg1u7JAb/21FiyLasB4EM segxId4yj45iZwsrtKC1gOX47TuDPtIOoDjOQSXSAVc3GSagpjtq5SJx5CAVLXo1GwRi QLNkRm7rl67nQJH9iS6FQFDisFwx/p1HQ0V+O8c1VFpd4og1vNKQpZhr8pVV9uAPMpTW eqUmUN4z+b3noT7zrc88l0g+WeEsQL/LFYByGgiLEfj4T06DXaoYIcN/l4xtmxzYzCFr vW0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2E58Iw876uTd6FlkZzM6tT65+aYePaxETl7ncokxgbo=; b=2VjbZP1Ntbdl5uvyFvf5c13wzeJB0DpEYeYJa1/VihumBXWQDu6No0HPHwcCJ6VhrH 1cc293KT+tchRc61mL7rJCD6yRM3/ACh9wQnGcs+bhglZ/M3QOtzAD3dTjy7Uo0Kfgvv 7UoE5IdHJdewT0JllDPuaw+jA6LgpmlbC3+4h0IiqXvoh8OAi5f3iXZornwFcOwr2pzP 4VpeKTxaXfFij5qyYrTrGNegi2V47yt5CigOs5mtX/6Qy8nilN2sWIdyB6f/Sb3Wmolw quvB7rxVZrqfkAmScjDPKj/cud0+1Ku12QpZflPevPvXiIa0o6G5KQm5lZnIaMQlWTQr 63bQ== X-Gm-Message-State: AO0yUKXk/814i5R1qPvuAsUOnYx2Zk0EO9uYacBzPMOX2tRq0TdTBUt9 ivowivMPn6NFuwljqMheCPQwixH/VF2P5H2S X-Received: by 2002:aa7:9159:0:b0:592:d3ce:fdd1 with SMTP id 25-20020aa79159000000b00592d3cefdd1mr10999950pfi.25.1675112389336; Mon, 30 Jan 2023 12:59:49 -0800 (PST) Received: from stoup.. (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id x10-20020aa79a4a000000b00593eb3a5e44sm102933pfj.37.2023.01.30.12.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 12:59:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, cota@braap.org Subject: [PATCH 05/27] tcg: Rename TEMP_LOCAL to TEMP_TB Date: Mon, 30 Jan 2023 10:59:13 -1000 Message-Id: <20230130205935.1157347-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230130205935.1157347-1-richard.henderson@linaro.org> References: <20230130205935.1157347-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Use TEMP_TB as that is more explicit about the default lifetime of the data. While "global" and "local" used to be contrasting, we have more lifetimes than that now. Do not yet rename tcg_temp_local_new_*, just the enum. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/tcg/tcg.h | 12 ++++++++---- tcg/optimize.c | 2 +- tcg/tcg.c | 18 +++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 7a8e4bbdd7..8786607510 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -431,11 +431,15 @@ typedef enum TCGTempVal { typedef enum TCGTempKind { /* Temp is dead at the end of all basic blocks. */ TEMP_NORMAL, - /* Temp is live across conditional branch, but dead otherwise. */ + /* + * Temp is dead at the end of the extended basic block (EBB), + * the single-entry multiple-exit region that falls through + * conditional branches. + */ TEMP_EBB, - /* Temp is saved across basic blocks but dead at the end of TBs. */ - TEMP_LOCAL, - /* Temp is saved across both basic blocks and translation blocks. */ + /* Temp is live across the entire translation block, but dead at end. */ + TEMP_TB, + /* Temp is live across the entire translation block, and between them. */ TEMP_GLOBAL, /* Temp is in a fixed register. */ TEMP_FIXED, diff --git a/tcg/optimize.c b/tcg/optimize.c index 763bca9ea6..ce05989c39 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -190,7 +190,7 @@ static TCGTemp *find_better_copy(TCGContext *s, TCGTemp *ts) } else if (i->kind > ts->kind) { if (i->kind == TEMP_GLOBAL) { g = i; - } else if (i->kind == TEMP_LOCAL) { + } else if (i->kind == TEMP_TB) { l = i; } } diff --git a/tcg/tcg.c b/tcg/tcg.c index fc0de1dccc..3e12053229 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1258,7 +1258,7 @@ TCGTemp *tcg_global_mem_new_internal(TCGType type, TCGv_ptr base, TCGTemp *tcg_temp_new_internal(TCGType type, bool temp_local) { TCGContext *s = tcg_ctx; - TCGTempKind kind = temp_local ? TEMP_LOCAL : TEMP_NORMAL; + TCGTempKind kind = temp_local ? TEMP_TB : TEMP_NORMAL; TCGTemp *ts; int idx, k; @@ -1369,7 +1369,7 @@ void tcg_temp_free_internal(TCGTemp *ts) */ return; case TEMP_NORMAL: - case TEMP_LOCAL: + case TEMP_TB: break; default: g_assert_not_reached(); @@ -1913,7 +1913,7 @@ static void tcg_reg_alloc_start(TCGContext *s) case TEMP_EBB: val = TEMP_VAL_DEAD; /* fall through */ - case TEMP_LOCAL: + case TEMP_TB: ts->mem_allocated = 0; break; default: @@ -1935,7 +1935,7 @@ static char *tcg_get_arg_str_ptr(TCGContext *s, char *buf, int buf_size, case TEMP_GLOBAL: pstrcpy(buf, buf_size, ts->name); break; - case TEMP_LOCAL: + case TEMP_TB: snprintf(buf, buf_size, "loc%d", idx - s->nb_globals); break; case TEMP_EBB: @@ -2757,7 +2757,7 @@ static void la_bb_end(TCGContext *s, int ng, int nt) switch (ts->kind) { case TEMP_FIXED: case TEMP_GLOBAL: - case TEMP_LOCAL: + case TEMP_TB: state = TS_DEAD | TS_MEM; break; case TEMP_NORMAL: @@ -2802,7 +2802,7 @@ static void la_bb_sync(TCGContext *s, int ng, int nt) int state; switch (ts->kind) { - case TEMP_LOCAL: + case TEMP_TB: state = ts->state; ts->state = state | TS_MEM; if (state != TS_DEAD) { @@ -3494,7 +3494,7 @@ static void temp_free_or_dead(TCGContext *s, TCGTemp *ts, int free_or_dead) case TEMP_FIXED: return; case TEMP_GLOBAL: - case TEMP_LOCAL: + case TEMP_TB: new_type = TEMP_VAL_MEM; break; case TEMP_NORMAL: @@ -3782,7 +3782,7 @@ static void tcg_reg_alloc_bb_end(TCGContext *s, TCGRegSet allocated_regs) TCGTemp *ts = &s->temps[i]; switch (ts->kind) { - case TEMP_LOCAL: + case TEMP_TB: temp_save(s, ts, allocated_regs); break; case TEMP_NORMAL: @@ -3819,7 +3819,7 @@ static void tcg_reg_alloc_cbranch(TCGContext *s, TCGRegSet allocated_regs) * Keep tcg_debug_asserts for safety. */ switch (ts->kind) { - case TEMP_LOCAL: + case TEMP_TB: tcg_debug_assert(ts->val_type != TEMP_VAL_REG || ts->mem_coherent); break; case TEMP_NORMAL: