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/optimize.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/optimize.c')
-rw-r--r-- | tcg/optimize.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c index f2b8acf1e0..973fbb4729 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -758,7 +758,7 @@ static void tcg_constant_folding(TCGContext *s) break; do_mov3: if (temps_are_copies(args[0], args[1])) { - op->opc = INDEX_op_nop; + tcg_op_remove(s, op); } else { tcg_opt_gen_mov(s, op, args, opc, args[0], args[1]); } @@ -916,7 +916,7 @@ static void tcg_constant_folding(TCGContext *s) if (affected == 0) { assert(nb_oargs == 1); if (temps_are_copies(args[0], args[1])) { - op->opc = INDEX_op_nop; + tcg_op_remove(s, op); } else if (temps[args[1]].state != TCG_TEMP_CONST) { tcg_opt_gen_mov(s, op, args, opc, args[0], args[1]); } else { @@ -948,7 +948,7 @@ static void tcg_constant_folding(TCGContext *s) CASE_OP_32_64(and): if (temps_are_copies(args[1], args[2])) { if (temps_are_copies(args[0], args[1])) { - op->opc = INDEX_op_nop; + tcg_op_remove(s, op); } else { tcg_opt_gen_mov(s, op, args, opc, args[0], args[1]); } @@ -979,7 +979,7 @@ static void tcg_constant_folding(TCGContext *s) switch (opc) { CASE_OP_32_64(mov): if (temps_are_copies(args[0], args[1])) { - op->opc = INDEX_op_nop; + tcg_op_remove(s, op); break; } if (temps[args[1]].state != TCG_TEMP_CONST) { @@ -1074,7 +1074,7 @@ static void tcg_constant_folding(TCGContext *s) op->opc = INDEX_op_br; args[0] = args[3]; } else { - op->opc = INDEX_op_nop; + tcg_op_remove(s, op); } break; } @@ -1084,7 +1084,7 @@ static void tcg_constant_folding(TCGContext *s) tmp = do_constant_folding_cond(opc, args[1], args[2], args[5]); if (tmp != 2) { if (temps_are_copies(args[0], args[4-tmp])) { - op->opc = INDEX_op_nop; + tcg_op_remove(s, op); } else if (temps[args[4-tmp]].state == TCG_TEMP_CONST) { tcg_opt_gen_movi(s, op, args, opc, args[0], temps[args[4-tmp]].val); @@ -1177,7 +1177,7 @@ static void tcg_constant_folding(TCGContext *s) args[0] = args[5]; } else { do_brcond_false: - op->opc = INDEX_op_nop; + tcg_op_remove(s, op); } } else if ((args[4] == TCG_COND_LT || args[4] == TCG_COND_GE) && temps[args[2]].state == TCG_TEMP_CONST |