From patchwork Mon Feb 27 05:36:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 656816 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2182199wrb; Sun, 26 Feb 2023 21:42:02 -0800 (PST) X-Google-Smtp-Source: AK7set+xy5f1XkKey6BDsXQbuNIKuZ+ImmqdQ1wQ3LKSYRkoJcIVtFXQyXL2yHwYdizqqY4GAphO X-Received: by 2002:a05:622a:134f:b0:3bf:dc2d:f29a with SMTP id w15-20020a05622a134f00b003bfdc2df29amr1344982qtk.18.1677476521937; Sun, 26 Feb 2023 21:42:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677476521; cv=none; d=google.com; s=arc-20160816; b=TMJIE5T/riTVt5yHclTeIYM2/hEzu0krUCSolOPKxLfc0PnlVpWDigiil7e7DosYeU GrhAJloB73a5+ccYQHx3oTSq1X4cgwo7i6eu6RV/gkjvtAwZ+Mc4ZrpFWGU6R2gFrKjE o271rcbKDmOC/Ffuel6djLoifRzgGJDPs9FEw9yCG6KOr51Nlkxxf1YFlTpt42PJb0dY U02Os2d4rbheNvDnEz9NLZdFM9QVdDi3BAlzBTNHMe6n9oEP9xcHjNXPBKrqXWt4QWif a+ptW1U8LDBBBY02FmqXN9OBvTsONPbckJqYH7kfawiDbM+MW+4gQ/K7Q4qPiBx0WHoI DHXg== 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=Me3y4NGZuYmWF3kVGO2rrjiIggu4967Ajmd6fpL1eaM=; b=0bWYmT93QU7wnsk7ABXvUJuUuU4Z30GMNK/+P/+E3MeKTICE+QPk0ohjM/NrZFr3Gx CwIrboDfhYJ4TjL5cb33D+ONpnCfPka8lRfhXAjALmSiYjnRbZa7P+9wUPY5Dnuvaifi XtNedmAtMefWaNdieigUwz/PK5NBmkH0BgsJm1JBm5l+GUGUDRmb4RWVJ8QCHKjv5MRX 4PCYPxcokkhQuKYRLNpYiXGlhr4UvYiV+zKFM1ZCqzsVHEkVXvQ/EJ4ZpyhRA9/H6YWg p+l+KavdGQvX0NqArDKoqqARRrtd5EO4XJy6MEiMdlv+VdXaarXUn+8oO+BRLClVvJOo +Uzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eZ1VDAE0; 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 t6-20020a05622a148600b003a55b624080si5811753qtx.48.2023.02.26.21.42.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 Feb 2023 21:42:01 -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=eZ1VDAE0; 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 1pWWCU-0002IG-Ml; Mon, 27 Feb 2023 00:37:26 -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 1pWWCR-00027u-K2 for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:37:24 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWWCP-0002Wa-Gv for qemu-devel@nongnu.org; Mon, 27 Feb 2023 00:37:23 -0500 Received: by mail-pl1-x62b.google.com with SMTP id y11so1401933plg.1 for ; Sun, 26 Feb 2023 21:37:20 -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=Me3y4NGZuYmWF3kVGO2rrjiIggu4967Ajmd6fpL1eaM=; b=eZ1VDAE0A4B68/UvZiQsA3HbY5a8VnVVkkO3IvXh9L7Yj+6d7kZT/GB8CvbBXRI/8K PQ7k4TgglZPwAq/WeFaKWdUe3cvpvgmmz66Ojsb/weewFhWyvrrlngxjSfZadTgTOl0g JjETL/kEFWEFMSZ7T1U5h4ac+3sao2AzuEKSsG3ZhqMGCFW73oTh1LH5Si5h6WDuRRXa awL4cxUDpaSSyJ6+2USLEz3TfGcQ3ZwvfXUvaRwQZ0G8oYQf25h8Lo2vrZH++doCPZVt hCDKhFPf1lrKNvr6W6DwXpda7ZPs0vFvK2nPSPP35EQjMDiVQ1CkECCJVYNMA6A1hOnp AEdA== 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=Me3y4NGZuYmWF3kVGO2rrjiIggu4967Ajmd6fpL1eaM=; b=NYQ8JALfBaXWJUeDgj88C9MNjrh743sl2DpCgkWYvOASof4SQllud6wx6dEdcy8ezN AFz9IXhZuiDGWhapUIRvDW0UAoRZJZJNV399jwJ7Opm9Niksi1pnBGskuleKuCz3wDvZ t8Swva8Jay7AND1k+0ueC+5Lq7/ADxCrUcClaqw0BjnuqU1jFwHwWyXHWceXo7sqSiZP qWhE5in6DyP5QRqDXMM40AP2YrOrahQP3eoxZUzEHAA0YpRImzYylG0ueNKET7SjrV82 0NePUXwHdWi+4oan0LOwzBPqdZAMJq8XjzslAE0yBEnQ/RuUY+q/y1mn53Z2VvtD5pWJ G7pw== X-Gm-Message-State: AO0yUKWimm1gpz5m+T/lxddssjKTH7YYNMflaicOsab6W8bzlTiKqdZj HcedXNjJk/8a+3wPUf1kveZo1Scon/aBt9HpXLI= X-Received: by 2002:a05:6a20:7351:b0:cc:c5db:ea4a with SMTP id v17-20020a056a20735100b000ccc5dbea4amr7662597pzc.33.1677476239768; Sun, 26 Feb 2023 21:37:19 -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 k12-20020aa792cc000000b005a7c892b435sm3342137pfa.25.2023.02.26.21.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Feb 2023 21:37:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, jcmvbkbc@gmail.com, kbastian@mail.uni-paderborn.de, ysato@users.sourceforge.jp, gaosong@loongson.cn, jiaxun.yang@flygoat.com, tsimpson@quicinc.com, ale@rev.ng, mrolnik@gmail.com, edgar.iglesias@gmail.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v4 05/31] tcg: Rename TEMP_LOCAL to TEMP_TB Date: Sun, 26 Feb 2023 19:36:35 -1000 Message-Id: <20230227053701.368744-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227053701.368744-1-richard.henderson@linaro.org> References: <20230227053701.368744-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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=unavailable 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 0992fb4f31..bf2af8b0fe 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(); @@ -1915,7 +1915,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: @@ -1937,7 +1937,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: @@ -2759,7 +2759,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: @@ -2804,7 +2804,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) { @@ -3497,7 +3497,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: @@ -3785,7 +3785,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: @@ -3822,7 +3822,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: