From patchwork Wed Mar 1 02:56:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 657771 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp3270492wrb; Tue, 28 Feb 2023 19:01:40 -0800 (PST) X-Google-Smtp-Source: AK7set+gs185t8ZcavLSkLm5JiblmfebnLQTC/oYSSOugugxpMArKBi3lOmFaPvNSMkBizek2+LX X-Received: by 2002:a05:6214:5189:b0:56f:37a:4562 with SMTP id kl9-20020a056214518900b0056f037a4562mr10118938qvb.13.1677639700307; Tue, 28 Feb 2023 19:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677639700; cv=none; d=google.com; s=arc-20160816; b=KUpP6HoFuCKYWOWBByKHjZrPn34axVK8dyuXEnUAjM6z9jD0c1ygcizIbk1Na+VSXL x0Jll4yrOMIl7OyhIP2YDfniZFKycGFEhD0a9dV/e8bnnsyTqAE4hplb131U+u14ujnY fbZBRAv2glOTgkv2ppjtDl+4BWntBhnvLCvLgq4feMlNPRfHRbHayMXEkX62jO6gVsV4 gVYSAYkyEp8Dl0A4Pi7mxOi1oT85t168BG+R3TH5VlyR8K1DqAL/YRc/YK5g7KD98DWj AdbZ/D+fkUJbtON69kucHOWQFlU6wkYfpFf1Z7JE8qATHVqDM9jx66uz/qSiy9H7fZrV Behw== 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=M2NBP13EM52qCn1A0tAj+x1oLpvUSw9ltK5udCzPr2s=; b=f+35mZO4dw69H37gUg5Wa3uT1ZZwg9kLKILL6cg0Tk4/t86uxouUqI9n0DJLDpUrD5 Jjwy2T54fdYr6hUC1xNqdIp+1ReYAXZIGRCSM121094wqGQotZ9CVhMD1d3IoHfwgx+3 HelmmkcPxZIut3hK7l/xf28gBFrSVK3MyKUh3WxMXyKLbvfxDwsJm9kVCA4gZl9+ImCs CQJAZyiu+OJVYjmClatffUdYGW0LOVO6f6SsJMBinTiQJwa6OcIwRmD506Wx67JQGBQT ar3/muKv/jgC0Veucj9DpwRJd5wSzGJQYPRaW6gtME8hJYlau4NDsNd/rbUg2W00JhTP d7Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CqeZljab; 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 r16-20020ae9d610000000b0073ba4a541d8si9451496qkk.656.2023.02.28.19.01.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Feb 2023 19:01:40 -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=CqeZljab; 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 1pXCfA-0002o0-HJ; Tue, 28 Feb 2023 21:57:52 -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 1pXCf8-0002Qw-Es for qemu-devel@nongnu.org; Tue, 28 Feb 2023 21:57:50 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXCf6-00031u-Cj for qemu-devel@nongnu.org; Tue, 28 Feb 2023 21:57:50 -0500 Received: by mail-pj1-x102d.google.com with SMTP id y2so11899334pjg.3 for ; Tue, 28 Feb 2023 18:57:47 -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=M2NBP13EM52qCn1A0tAj+x1oLpvUSw9ltK5udCzPr2s=; b=CqeZljablAzCCuzhfWXvskNgCkCfrP8di08s+LsCuxM+82ieEOTfFBJ/3uhZcSFGZd LcQmqVPS2G6mOMmONJsQ5i69TBDy5cP85FmWr7XMgUaU/vOGZitEzca3TafZ2/DhnEsD ySy8b7Dk/UG9qStVAWmzNZVdjOI0Cux2GuEyBeUzd6fiaTNkxHHvKRdLVykHJTBsEAzN r4/a0mD/ZWlxv2IVb+rJnw92dWd0KQevNlBSq1H1iFoaNQbiZ3sXdjzm0mPHTNLKr9jU 3pcs74FlVJrllzU9SiMJc14E1iXlA+KKEu33tnoop4EyymeVudxMVUackwHr1zFpAJEC a/Dw== 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=M2NBP13EM52qCn1A0tAj+x1oLpvUSw9ltK5udCzPr2s=; b=e4XUx8kSpbU+XBe9gYALy6O2DbbG0asOZn/DlMzpI++IFYNNvh5J/jDj+wat1w8QvK qERRZPDwHe+lGM6gKgtDk8jZawkaDPLLSwhB8PG4kSQebTkCsnn6XAjWac46pcZNjDuw Jm/6A2GREbPmMeRL9VRa+k9DbCMcfj66umIoqivVMBaVBUcUmDOi1SlkftcbYup2hA8p zbQc9EFW7/795TO8NyJ3BJ05TnWvmhP9AsErde75apGorrdhEnJiVObu/tEfrwv//e1/ IvCm7blecK79dtQjuI832CqVWuHyrZZHn/pS0VfrXzV0MZDIHzFFI3izvLKlYwavkLDq i5sg== X-Gm-Message-State: AO0yUKUcrT8V3sx/Qdqosx1NTbeNIsgqQdgSsqJ4F3gswN+qu+9jE3nL RrTXl3fAo6ZAqQuS4lFCUl6LowVljIPhN8z11Sw= X-Received: by 2002:a17:902:e807:b0:19d:b20:4d1a with SMTP id u7-20020a170902e80700b0019d0b204d1amr5334176plg.60.1677639467539; Tue, 28 Feb 2023 18:57:47 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id jg15-20020a17090326cf00b0019adbef6a63sm7210120plb.235.2023.02.28.18.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 18:57:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 36/62] tcg: Rename TEMP_LOCAL to TEMP_TB Date: Tue, 28 Feb 2023 16:56:17 -1000 Message-Id: <20230301025643.1227244-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230301025643.1227244-1-richard.henderson@linaro.org> References: <20230301025643.1227244-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- 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 59854f95b1..2010e746ca 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -433,11 +433,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 9739e4830f..1a31a30a0d 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -1257,7 +1257,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; @@ -1368,7 +1368,7 @@ void tcg_temp_free_internal(TCGTemp *ts) */ return; case TEMP_NORMAL: - case TEMP_LOCAL: + case TEMP_TB: break; default: g_assert_not_reached(); @@ -1914,7 +1914,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: @@ -1936,7 +1936,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: @@ -2758,7 +2758,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: @@ -2803,7 +2803,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) { @@ -3496,7 +3496,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: @@ -3784,7 +3784,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: @@ -3821,7 +3821,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: