summaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2018-11-27 13:32:33 -0800
committerRichard Henderson <richard.henderson@linaro.org>2018-12-26 06:57:57 +1100
commit152c35aab43213335e1ae8b865d259c0222dd110 (patch)
tree3747c42b4930e34d2f7be211ffcaa81b53938676 /tcg
parent1894f69a612b35c2a39b44a824da04d74bfe324a (diff)
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>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c137
1 files changed, 70 insertions, 67 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index e2ae04d1d0..696a45f7f8 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -2436,47 +2436,46 @@ static void liveness_pass_1(TCGContext *s)
}
}
goto do_remove;
- } else {
- do_not_remove_call:
+ }
+ do_not_remove_call:
- /* 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;
+ /* 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 (!(call_flags & (TCG_CALL_NO_WRITE_GLOBALS |
- TCG_CALL_NO_READ_GLOBALS))) {
- /* globals should go back to memory */
- for (i = 0; i < nb_globals; i++) {
- 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;
- }
+ if (!(call_flags & (TCG_CALL_NO_WRITE_GLOBALS |
+ TCG_CALL_NO_READ_GLOBALS))) {
+ /* globals should go back to memory */
+ for (i = 0; i < nb_globals; i++) {
+ 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;
+ }
+ }
- /* record arguments that die in this helper */
- for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) {
- arg_ts = arg_temp(op->args[i]);
- if (arg_ts && arg_ts->state & TS_DEAD) {
- arg_life |= DEAD_ARG << i;
- }
+ /* record arguments that die in this helper */
+ for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) {
+ arg_ts = arg_temp(op->args[i]);
+ if (arg_ts && arg_ts->state & TS_DEAD) {
+ arg_life |= DEAD_ARG << i;
}
- /* input arguments are live for preceding opcodes */
- for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) {
- arg_ts = arg_temp(op->args[i]);
- if (arg_ts) {
- arg_ts->state &= ~TS_DEAD;
- }
+ }
+ /* input arguments are live for preceding opcodes */
+ for (i = nb_oargs; i < nb_iargs + nb_oargs; i++) {
+ arg_ts = arg_temp(op->args[i]);
+ if (arg_ts) {
+ arg_ts->state &= ~TS_DEAD;
}
}
}
@@ -2580,44 +2579,48 @@ static void liveness_pass_1(TCGContext *s)
goto do_not_remove;
}
}
- do_remove:
- tcg_op_remove(s, op);
- } else {
- 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;
- }
+ goto do_remove;
+ }
+ goto do_not_remove;
- /* 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;
- }
+ do_remove:
+ tcg_op_remove(s, op);
+ break;
+
+ 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;
+ }
- /* 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;
- }
+ /* 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;
}
- /* 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;
+ }
+
+ /* 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;
}
op->life = arg_life;