[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 11/60] tcg/optimize: Split out init_arguments
From: |
Richard Henderson |
Subject: |
[PULL v2 11/60] tcg/optimize: Split out init_arguments |
Date: |
Thu, 28 Oct 2021 21:32:40 -0700 |
There was no real reason for calls to have separate code here.
Unify init for calls vs non-calls using the call path, which
handles TCG_CALL_DUMMY_ARG.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Luis Pires <luis.pires@eldorado.org.br>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/optimize.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/tcg/optimize.c b/tcg/optimize.c
index b875d76354..019c5aaf81 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -128,11 +128,6 @@ static void init_ts_info(OptContext *ctx, TCGTemp *ts)
}
}
-static void init_arg_info(OptContext *ctx, TCGArg arg)
-{
- init_ts_info(ctx, arg_temp(arg));
-}
-
static TCGTemp *find_better_copy(TCGContext *s, TCGTemp *ts)
{
TCGTemp *i, *g, *l;
@@ -606,6 +601,16 @@ static bool swap_commutative2(TCGArg *p1, TCGArg *p2)
return false;
}
+static void init_arguments(OptContext *ctx, TCGOp *op, int nb_args)
+{
+ for (int i = 0; i < nb_args; i++) {
+ TCGTemp *ts = arg_temp(op->args[i]);
+ if (ts) {
+ init_ts_info(ctx, ts);
+ }
+ }
+}
+
/* Propagate constants and copies, fold constant expressions. */
void tcg_optimize(TCGContext *s)
{
@@ -636,19 +641,11 @@ void tcg_optimize(TCGContext *s)
if (opc == INDEX_op_call) {
nb_oargs = TCGOP_CALLO(op);
nb_iargs = TCGOP_CALLI(op);
- for (i = 0; i < nb_oargs + nb_iargs; i++) {
- TCGTemp *ts = arg_temp(op->args[i]);
- if (ts) {
- init_ts_info(&ctx, ts);
- }
- }
} else {
nb_oargs = def->nb_oargs;
nb_iargs = def->nb_iargs;
- for (i = 0; i < nb_oargs + nb_iargs; i++) {
- init_arg_info(&ctx, op->args[i]);
- }
}
+ init_arguments(&ctx, op, nb_oargs + nb_iargs);
/* Do copy propagation */
for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) {
--
2.25.1
- [PULL v2 06/60] tcg/optimize: Rename "mask" to "z_mask", (continued)
- [PULL v2 06/60] tcg/optimize: Rename "mask" to "z_mask", Richard Henderson, 2021/10/29
- [PULL v2 07/60] tcg/optimize: Split out OptContext, Richard Henderson, 2021/10/29
- [PULL v2 08/60] tcg/optimize: Remove do_default label, Richard Henderson, 2021/10/29
- [PULL v2 10/60] tcg/optimize: Move prev_mb into OptContext, Richard Henderson, 2021/10/29
- [PULL v2 13/60] tcg/optimize: Split out fold_call, Richard Henderson, 2021/10/29
- [PULL v2 12/60] tcg/optimize: Split out copy_propagate, Richard Henderson, 2021/10/29
- [PULL v2 15/60] tcg/optimize: Change fail return for do_constant_folding_cond*, Richard Henderson, 2021/10/29
- [PULL v2 17/60] tcg/optimize: Split out finish_folding, Richard Henderson, 2021/10/29
- [PULL v2 16/60] tcg/optimize: Return true from tcg_opt_gen_{mov, movi}, Richard Henderson, 2021/10/29
- [PULL v2 18/60] tcg/optimize: Use a boolean to avoid a mass of continues, Richard Henderson, 2021/10/29
- [PULL v2 11/60] tcg/optimize: Split out init_arguments,
Richard Henderson <=
- [PULL v2 14/60] tcg/optimize: Drop nb_oargs, nb_iargs locals, Richard Henderson, 2021/10/29
- [PULL v2 19/60] tcg/optimize: Split out fold_mb, fold_qemu_{ld,st}, Richard Henderson, 2021/10/29
- [PULL v2 22/60] tcg/optimize: Split out fold_brcond2, Richard Henderson, 2021/10/29
- [PULL v2 20/60] tcg/optimize: Split out fold_const{1,2}, Richard Henderson, 2021/10/29
- [PULL v2 25/60] tcg/optimize: Split out fold_mulu2_i32, Richard Henderson, 2021/10/29
- [PULL v2 21/60] tcg/optimize: Split out fold_setcond2, Richard Henderson, 2021/10/29
- [PULL v2 24/60] tcg/optimize: Split out fold_setcond, Richard Henderson, 2021/10/29
- [PULL v2 26/60] tcg/optimize: Split out fold_addsub2_i32, Richard Henderson, 2021/10/29
- [PULL v2 27/60] tcg/optimize: Split out fold_movcond, Richard Henderson, 2021/10/29
- [PULL v2 28/60] tcg/optimize: Split out fold_extract2, Richard Henderson, 2021/10/29