diff options
author | Richard Henderson <rth@twiddle.net> | 2014-03-30 16:51:54 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2015-02-12 21:21:38 -0800 |
commit | 0c627cdca20155753a536c51385abb73941a59a0 (patch) | |
tree | 3dd962f8a65c7734c193590f661387fcb9fb804e /tcg/tcg.c | |
parent | c45cb8bb89fc798489869982c4c463b26ce43d7b (diff) |
tcg: Remove opcodes instead of noping them out
With the linked list scheme we need not leave nops in the stream
that we need to process later.
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r-- | tcg/tcg.c | 28 |
1 files changed, 24 insertions, 4 deletions
@@ -1244,6 +1244,29 @@ void tcg_add_target_add_op_defs(const TCGTargetOpDef *tdefs) #endif } +void tcg_op_remove(TCGContext *s, TCGOp *op) +{ + int next = op->next; + int prev = op->prev; + + if (next >= 0) { + s->gen_op_buf[next].prev = prev; + } else { + s->gen_last_op_idx = prev; + } + if (prev >= 0) { + s->gen_op_buf[prev].next = next; + } else { + s->gen_first_op_idx = next; + } + + *op = (TCGOp){ .opc = INDEX_op_nop, .next = -1, .prev = -1 }; + +#ifdef CONFIG_PROFILER + s->del_op_count++; +#endif +} + #ifdef USE_LIVENESS_ANALYSIS /* liveness analysis: end of function: all temps are dead, and globals should be in memory. */ @@ -1466,10 +1489,7 @@ static void tcg_liveness_analysis(TCGContext *s) } } do_remove: - op->opc = INDEX_op_nop; -#ifdef CONFIG_PROFILER - s->del_op_count++; -#endif + tcg_op_remove(s, op); } else { do_not_remove: /* output args are dead */ |