[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-8.1.2 35/45] accel/tcg: Avoid load of icount_decr if unused
From: |
Michael Tokarev |
Subject: |
[Stable-8.1.2 35/45] accel/tcg: Avoid load of icount_decr if unused |
Date: |
Wed, 4 Oct 2023 11:01:56 +0300 |
From: Richard Henderson <richard.henderson@linaro.org>
With CF_NOIRQ and without !CF_USE_ICOUNT, the load isn't used.
Avoid emitting it.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
(cherry picked from commit f47a90dacca8f74210a2675bdde7ab3856872b94)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c
index 1a6a5448c8..a3983019a5 100644
--- a/accel/tcg/translator.c
+++ b/accel/tcg/translator.c
@@ -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) {
/*
--
2.39.2
- [Stable-8.1.2 26/45] migration: Fix race that dest preempt thread close too early, (continued)
- [Stable-8.1.2 26/45] migration: Fix race that dest preempt thread close too early, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 17/45] tests/file-io-error: New test, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 22/45] accel/tcg: mttcg remove false-negative halted assertion, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 29/45] migration: Fix possible race when shutting down to_dst_file, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 30/45] migration: Remove redundant cleanup of postcopy_qemufile_src, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 28/45] migration: Fix possible races when shutting down the return path, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 31/45] migration: Consolidate return path closing code, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 33/45] migration: Move return path cleanup to main migration thread, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 32/45] migration: Replace the return path retry logic, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 34/45] softmmu: Use async_run_on_cpu in tcg_commit, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 35/45] accel/tcg: Avoid load of icount_decr if unused,
Michael Tokarev <=
- [Stable-8.1.2 39/45] accel/tcg: Always set CF_LAST_IO with CF_NOIRQ, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 40/45] accel/tcg: Always require can_do_io, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 43/45] esp: use correct type for esp_dma_enable() in sysbus_esp_gpio_demux(), Michael Tokarev, 2023/10/04
- [Stable-8.1.2 41/45] target/tricore: Fix RCPW/RRPW_INSERT insns for width = 0, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 38/45] accel/tcg: Improve setting of can_do_io at start of TB, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 37/45] accel/tcg: Track current value of can_do_io in the TB, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 42/45] optionrom: Remove build-id section, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 36/45] accel/tcg: Hoist CF_MEMI_ONLY check outside translation loop, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 45/45] scsi-disk: ensure that FORMAT UNIT commands are terminated, Michael Tokarev, 2023/10/04
- [Stable-8.1.2 44/45] esp: restrict non-DMA transfer length to that of available data, Michael Tokarev, 2023/10/04