[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/12] tcg: Rename and adjust liveness_pass_1 helper
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 09/12] tcg: Rename and adjust liveness_pass_1 helpers |
Date: |
Tue, 27 Nov 2018 21:38:31 -0800 |
No need for a "tcg_" prefix for a static function; we already
have another "la_" prefix for indicating liveness analysis.
Pass in nb_globals and nb_temps, as we will already have them
in registers for other loops within the parent function.
Signed-off-by: Richard Henderson <address@hidden>
---
tcg/tcg.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 82f9a66d31..27814df882 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2389,10 +2389,8 @@ static void reachable_code_pass(TCGContext *s)
/* liveness analysis: end of function: all temps are dead, and globals
should be in memory. */
-static void tcg_la_func_end(TCGContext *s)
+static void la_func_end(TCGContext *s, int ng, int nt)
{
- int ng = s->nb_globals;
- int nt = s->nb_temps;
int i;
for (i = 0; i < ng; ++i) {
@@ -2405,10 +2403,8 @@ static void tcg_la_func_end(TCGContext *s)
/* liveness analysis: end of basic block: all temps are dead, globals
and local temps should be in memory. */
-static void tcg_la_bb_end(TCGContext *s)
+static void la_bb_end(TCGContext *s, int ng, int nt)
{
- int ng = s->nb_globals;
- int nt = s->nb_temps;
int i;
for (i = 0; i < ng; ++i) {
@@ -2427,9 +2423,10 @@ static void tcg_la_bb_end(TCGContext *s)
static void liveness_pass_1(TCGContext *s)
{
int nb_globals = s->nb_globals;
+ int nb_temps = s->nb_temps;
TCGOp *op, *op_prev;
- tcg_la_func_end(s);
+ la_func_end(s, nb_globals, nb_temps);
QTAILQ_FOREACH_REVERSE_SAFE(op, &s->ops, TCGOpHead, link, op_prev) {
int i, nb_iargs, nb_oargs;
@@ -2624,7 +2621,7 @@ static void liveness_pass_1(TCGContext *s)
/* if end of basic block, update */
if (def->flags & TCG_OPF_BB_END) {
- tcg_la_bb_end(s);
+ la_bb_end(s, nb_globals, nb_temps);
} else if (def->flags & TCG_OPF_SIDE_EFFECTS) {
/* globals should be synced to memory */
for (i = 0; i < nb_globals; i++) {
--
2.17.2
- [Qemu-devel] [PATCH 01/12] tcg: Add preferred_reg argument to tcg_reg_alloc, (continued)
- [Qemu-devel] [PATCH 01/12] tcg: Add preferred_reg argument to tcg_reg_alloc, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 02/12] tcg: Add preferred_reg argument to temp_load, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 03/12] tcg: Add preferred_reg argument to temp_sync, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 04/12] tcg: Add preferred_reg argument to tcg_reg_alloc_do_movi, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 05/12] tcg: Add output_pref to TCGOp, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 06/12] tcg: Improve register allocation for matching constraints, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 10/12] tcg: Split out more subroutines from liveness_pass_1, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 12/12] tcg: Record register preferences during liveness, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 11/12] tcg: Add TCG_OPF_BB_EXIT, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 08/12] tcg: Reindent parts of liveness_pass_1, Richard Henderson, 2018/11/28
- [Qemu-devel] [PATCH 09/12] tcg: Rename and adjust liveness_pass_1 helpers,
Richard Henderson <=
- [Qemu-devel] [PATCH 07/12] tcg: Dump register preference info with liveness, Richard Henderson, 2018/11/28
- Re: [Qemu-devel] [PATCH 00/12] tcg: Improve register allocation for calls, Emilio G. Cota, 2018/11/28