mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-23 06:25:12 +00:00
tcg: Remove unused opcodes
We no longer need INDEX_op_end to terminate the list, nor do we need 5 forms of nop, since we just remove the TCGOp instead. Backports commit 15fc7daa770764cc795158cbb525569f156f3659 from qemu
This commit is contained in:
parent
70f28c8bd5
commit
255a160c66
|
@ -27,15 +27,6 @@
|
|||
*/
|
||||
|
||||
/* predefined ops */
|
||||
DEF(end, 0, 0, 0, TCG_OPF_NOT_PRESENT) /* must be kept first */
|
||||
DEF(nop, 0, 0, 0, TCG_OPF_NOT_PRESENT)
|
||||
DEF(nop1, 0, 0, 1, TCG_OPF_NOT_PRESENT)
|
||||
DEF(nop2, 0, 0, 2, TCG_OPF_NOT_PRESENT)
|
||||
DEF(nop3, 0, 0, 3, TCG_OPF_NOT_PRESENT)
|
||||
|
||||
/* variable number of parameters */
|
||||
DEF(nopn, 0, 0, 1, TCG_OPF_NOT_PRESENT)
|
||||
|
||||
DEF(discard, 1, 0, 0, TCG_OPF_NOT_PRESENT)
|
||||
DEF(set_label, 0, 0, 1, TCG_OPF_BB_END | TCG_OPF_NOT_PRESENT)
|
||||
|
||||
|
|
|
@ -1290,7 +1290,6 @@ void tcg_op_remove(TCGContext *s, TCGOp *op)
|
|||
{
|
||||
int next = op->next;
|
||||
int prev = op->prev;
|
||||
TCGOp opp = {0};
|
||||
|
||||
if (next >= 0) {
|
||||
s->gen_op_buf[next].prev = prev;
|
||||
|
@ -1303,10 +1302,7 @@ void tcg_op_remove(TCGContext *s, TCGOp *op)
|
|||
s->gen_first_op_idx = next;
|
||||
}
|
||||
|
||||
opp.opc = INDEX_op_nop;
|
||||
opp.next = -1;
|
||||
opp.prev = -1;
|
||||
*op = opp;
|
||||
memset(op, -1, sizeof(*op));
|
||||
|
||||
#ifdef CONFIG_PROFILER
|
||||
s->del_op_count++;
|
||||
|
@ -1445,8 +1441,6 @@ static void tcg_liveness_analysis(TCGContext *s)
|
|||
}
|
||||
break;
|
||||
case INDEX_op_debug_insn_start:
|
||||
case INDEX_op_nop:
|
||||
case INDEX_op_end:
|
||||
break;
|
||||
case INDEX_op_discard:
|
||||
/* mark the temporary as dead */
|
||||
|
@ -1549,10 +1543,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 */
|
||||
|
@ -2323,7 +2314,7 @@ static void dump_op_count(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
for(i = INDEX_op_end; i < NB_OPS; i++) {
|
||||
for(i = 0; i < NB_OPS; i++) {
|
||||
qemu_log("%s %" PRId64 "\n", s->tcg_op_defs[i].name, tcg_table_op_count[i]);
|
||||
}
|
||||
}
|
||||
|
@ -2400,7 +2391,6 @@ static inline int tcg_gen_code_common(TCGContext *s,
|
|||
tcg_reg_alloc_movi(s, args, dead_args, sync_args);
|
||||
break;
|
||||
case INDEX_op_debug_insn_start:
|
||||
case INDEX_op_nop:
|
||||
break;
|
||||
case INDEX_op_discard:
|
||||
temp_dead(s, args[0]);
|
||||
|
|
Loading…
Reference in a new issue