Skip to content

Commit

Permalink
accel/tcg: Avoid load of icount_decr if unused
Browse files Browse the repository at this point in the history
With CF_NOIRQ and without !CF_USE_ICOUNT, the load isn't used.
Avoid emitting it.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
  • Loading branch information
rth7680 authored and Michael Tokarev committed Sep 20, 2023
1 parent 64e355f commit 48e5f09
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions accel/tcg/translator.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@ bool translator_io_start(DisasContextBase *db)

static TCGOp *gen_tb_start(uint32_t cflags)
{
TCGv_i32 count = tcg_temp_new_i32();
TCGv_i32 count = NULL;
TCGOp *icount_start_insn = NULL;

tcg_gen_ld_i32(count, cpu_env,
offsetof(ArchCPU, neg.icount_decr.u32) -
offsetof(ArchCPU, env));
if ((cflags & CF_USE_ICOUNT) || !(cflags & CF_NOIRQ)) {
count = tcg_temp_new_i32();
tcg_gen_ld_i32(count, cpu_env,
offsetof(ArchCPU, neg.icount_decr.u32) -
offsetof(ArchCPU, env));
}

if (cflags & CF_USE_ICOUNT) {
/*
Expand Down

0 comments on commit 48e5f09

Please sign in to comment.