tcg: Reindent parts of liveness_pass_1

There are two blocks of the form

    if (foo) {
        stuff1;
        goto bar;
    } else {
    baz:
        stuff2;
    }

which have unnecessary and confusing indentation.
Remove the else and unindent stuff2.

Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
Richard Henderson 2018-11-27 13:32:33 -08:00
parent 1894f69a61
commit 152c35aab4

139
tcg/tcg.c
View File

@ -2436,47 +2436,46 @@ static void liveness_pass_1(TCGContext *s)
} }
} }
goto do_remove; goto do_remove;
} else { }
do_not_remove_call: do_not_remove_call:
/* output args are dead */ /* output args are dead */
for (i = 0; i < nb_oargs; i++) { for (i = 0; i < nb_oargs; i++) {
arg_ts = arg_temp(op->args[i]); arg_ts = arg_temp(op->args[i]);
if (arg_ts->state & TS_DEAD) { if (arg_ts->state & TS_DEAD) {
arg_life |= DEAD_ARG << i; arg_life |= DEAD_ARG << i;
}
if (arg_ts->state & TS_MEM) {
arg_life |= SYNC_ARG << i;
}
arg_ts->state = TS_DEAD;
} }
if (arg_ts->state & TS_MEM) {
arg_life |= SYNC_ARG << i;
}
arg_ts->state = TS_DEAD;
}
if (!(call_flags & (TCG_CALL_NO_WRITE_GLOBALS | if (!(call_flags & (TCG_CALL_NO_WRITE_GLOBALS |
TCG_CALL_NO_READ_GLOBALS))) { TCG_CALL_NO_READ_GLOBALS))) {
/* globals should go back to memory */ /* globals should go back to memory */
for (i = 0; i < nb_globals; i++) { for (i = 0; i < nb_globals; i++) {
s->temps[i].state = TS_DEAD | TS_MEM; s->temps[i].state = TS_DEAD | TS_MEM;
}
} else if (!(call_flags & TCG_CALL_NO_READ_GLOBALS)) {
/* globals should be synced to memory */
for (i = 0; i < nb_globals; i++) {
s->temps[i].state |= TS_MEM;
}
} }
} else if (!(call_flags & TCG_CALL_NO_READ_GLOBALS)) {
/* globals should be synced to memory */
for (i = 0; i < nb_globals; i++) {
s->temps[i].state |= TS_MEM;
}
}
/* record arguments that die in this helper */ /* record arguments that die in this helper */
for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) { for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) {
arg_ts = arg_temp(op->args[i]); arg_ts = arg_temp(op->args[i]);
if (arg_ts && arg_ts->state & TS_DEAD) { if (arg_ts && arg_ts->state & TS_DEAD) {
arg_life |= DEAD_ARG << i; arg_life |= DEAD_ARG << i;
}
} }
/* input arguments are live for preceding opcodes */ }
for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) { /* input arguments are live for preceding opcodes */
arg_ts = arg_temp(op->args[i]); for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) {
if (arg_ts) { arg_ts = arg_temp(op->args[i]);
arg_ts->state &= ~TS_DEAD; if (arg_ts) {
} arg_ts->state &= ~TS_DEAD;
} }
} }
} }
@ -2580,43 +2579,47 @@ static void liveness_pass_1(TCGContext *s)
goto do_not_remove; goto do_not_remove;
} }
} }
do_remove: goto do_remove;
tcg_op_remove(s, op); }
} else { goto do_not_remove;
do_not_remove:
/* output args are dead */
for (i = 0; i < nb_oargs; i++) {
arg_ts = arg_temp(op->args[i]);
if (arg_ts->state & TS_DEAD) {
arg_life |= DEAD_ARG << i;
}
if (arg_ts->state & TS_MEM) {
arg_life |= SYNC_ARG << i;
}
arg_ts->state = TS_DEAD;
}
/* if end of basic block, update */ do_remove:
if (def->flags & TCG_OPF_BB_END) { tcg_op_remove(s, op);
tcg_la_bb_end(s); break;
} else if (def->flags & TCG_OPF_SIDE_EFFECTS) {
/* globals should be synced to memory */
for (i = 0; i < nb_globals; i++) {
s->temps[i].state |= TS_MEM;
}
}
/* record arguments that die in this opcode */ do_not_remove:
for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { /* output args are dead */
arg_ts = arg_temp(op->args[i]); for (i = 0; i < nb_oargs; i++) {
if (arg_ts->state & TS_DEAD) { arg_ts = arg_temp(op->args[i]);
arg_life |= DEAD_ARG << i; if (arg_ts->state & TS_DEAD) {
} arg_life |= DEAD_ARG << i;
} }
/* input arguments are live for preceding opcodes */ if (arg_ts->state & TS_MEM) {
for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) { arg_life |= SYNC_ARG << i;
arg_temp(op->args[i])->state &= ~TS_DEAD;
} }
arg_ts->state = TS_DEAD;
}
/* if end of basic block, update */
if (def->flags & TCG_OPF_BB_END) {
tcg_la_bb_end(s);
} else if (def->flags & TCG_OPF_SIDE_EFFECTS) {
/* globals should be synced to memory */
for (i = 0; i < nb_globals; i++) {
s->temps[i].state |= TS_MEM;
}
}
/* record arguments that die in this opcode */
for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) {
arg_ts = arg_temp(op->args[i]);
if (arg_ts->state & TS_DEAD) {
arg_life |= DEAD_ARG << i;
}
}
/* input arguments are live for preceding opcodes */
for (i = nb_oargs; i < nb_oargs + nb_iargs; i++) {
arg_temp(op->args[i])->state &= ~TS_DEAD;
} }
break; break;
} }