tcg/optimize: Use a boolean to avoid a mass of continues

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>
This commit is contained in:
Richard Henderson 2021-08-24 11:08:21 -07:00
parent 137f1f4429
commit 404a148d89

View File

@ -713,6 +713,7 @@ void tcg_optimize(TCGContext *s)
uint64_t z_mask, partmask, affected, tmp; uint64_t z_mask, partmask, affected, tmp;
TCGOpcode opc = op->opc; TCGOpcode opc = op->opc;
const TCGOpDef *def; const TCGOpDef *def;
bool done = false;
/* Calls are special. */ /* Calls are special. */
if (opc == INDEX_op_call) { if (opc == INDEX_op_call) {
@ -1212,8 +1213,8 @@ void tcg_optimize(TCGContext *s)
allocator where needed and possible. Also detect copies. */ allocator where needed and possible. Also detect copies. */
switch (opc) { switch (opc) {
CASE_OP_32_64_VEC(mov): CASE_OP_32_64_VEC(mov):
tcg_opt_gen_mov(&ctx, op, op->args[0], op->args[1]); done = tcg_opt_gen_mov(&ctx, op, op->args[0], op->args[1]);
continue; break;
case INDEX_op_dup_vec: case INDEX_op_dup_vec:
if (arg_is_const(op->args[1])) { if (arg_is_const(op->args[1])) {
@ -1602,7 +1603,9 @@ void tcg_optimize(TCGContext *s)
break; break;
} }
finish_folding(&ctx, op); if (!done) {
finish_folding(&ctx, op);
}
/* Eliminate duplicate and redundant fence instructions. */ /* Eliminate duplicate and redundant fence instructions. */
if (ctx.prev_mb) { if (ctx.prev_mb) {