[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 16/31] accel/tcg/plugin: Tidy plugin_gen_disable_mem_helpers
From: |
Richard Henderson |
Subject: |
[PATCH v4 16/31] accel/tcg/plugin: Tidy plugin_gen_disable_mem_helpers |
Date: |
Sun, 26 Feb 2023 19:36:46 -1000 |
Here we are creating a temp whose value needs to be replaced,
but always storing NULL into CPUState.plugin_mem_cbs.
Use tcg_constant_ptr(0) explicitly.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/plugin-gen.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index 9b793ac62c..c42a436c0c 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -630,8 +630,6 @@ static void inject_mem_disable_helper(struct
qemu_plugin_insn *plugin_insn,
/* called before finishing a TB with exit_tb, goto_tb or goto_ptr */
void plugin_gen_disable_mem_helpers(void)
{
- TCGv_ptr ptr;
-
/*
* We could emit the clearing unconditionally and be done. However, this
can
* be wasteful if for instance plugins don't track memory accesses, or if
@@ -644,10 +642,8 @@ void plugin_gen_disable_mem_helpers(void)
if (!tcg_ctx->plugin_tb->mem_helper) {
return;
}
- ptr = tcg_const_ptr(NULL);
- tcg_gen_st_ptr(ptr, cpu_env, offsetof(CPUState, plugin_mem_cbs) -
- offsetof(ArchCPU, env));
- tcg_temp_free_ptr(ptr);
+ tcg_gen_st_ptr(tcg_constant_ptr(NULL), cpu_env,
+ offsetof(CPUState, plugin_mem_cbs) - offsetof(ArchCPU,
env));
}
static void plugin_gen_tb_udata(const struct qemu_plugin_tb *ptb,
--
2.34.1
- [PATCH v4 06/31] tcg: Use noinline for major tcg_gen_code subroutines, (continued)
- [PATCH v4 06/31] tcg: Use noinline for major tcg_gen_code subroutines, Richard Henderson, 2023/02/27
- [PATCH v4 07/31] tcg: Add liveness_pass_0, Richard Henderson, 2023/02/27
- [PATCH v4 08/31] tcg: Remove TEMP_NORMAL, Richard Henderson, 2023/02/27
- [PATCH v4 09/31] tcg: Pass TCGTempKind to tcg_temp_new_internal, Richard Henderson, 2023/02/27
- [PATCH v4 11/31] tcg: Add tcg_gen_movi_ptr, Richard Henderson, 2023/02/27
- [PATCH v4 10/31] tcg: Use tcg_constant_i32 in tcg_gen_io_start, Richard Henderson, 2023/02/27
- [PATCH v4 12/31] tcg: Add tcg_temp_ebb_new_{i32,i64,ptr}, Richard Henderson, 2023/02/27
- [PATCH v4 15/31] accel/tcg/plugin: Use tcg_temp_ebb_*, Richard Henderson, 2023/02/27
- [PATCH v4 14/31] tcg: Use tcg_constant_ptr in do_dup, Richard Henderson, 2023/02/27
- [PATCH v4 16/31] accel/tcg/plugin: Tidy plugin_gen_disable_mem_helpers,
Richard Henderson <=
- [PATCH v4 13/31] tcg: Use tcg_temp_ebb_new_* in tcg/, Richard Henderson, 2023/02/27
- [PATCH v4 22/31] target/hexagon: Don't use tcg_temp_local_new_*, Richard Henderson, 2023/02/27
- [PATCH v4 25/31] target/i386: Don't use tcg_temp_local_new, Richard Henderson, 2023/02/27
- [PATCH v4 24/31] target/hppa: Don't use tcg_temp_local_new, Richard Henderson, 2023/02/27
- [PATCH v4 17/31] tcg: Don't re-use TEMP_TB temporaries, Richard Henderson, 2023/02/27
- [PATCH v4 27/31] target/ppc: Don't use tcg_temp_local_new, Richard Henderson, 2023/02/27
- [PATCH v4 18/31] tcg: Change default temp lifetime to TEMP_TB, Richard Henderson, 2023/02/27
- [PATCH v4 21/31] target/cris: Don't use tcg_temp_local_new, Richard Henderson, 2023/02/27