[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 19/27] accel/tcg/plugin: Use copy_op in append_{udata, mem}_cb
From: |
Richard Henderson |
Subject: |
[PATCH v4 19/27] accel/tcg/plugin: Use copy_op in append_{udata, mem}_cb |
Date: |
Tue, 13 Dec 2022 15:25:33 -0600 |
Better to re-use the existing function for copying ops.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
Cc: Alex Bennée <alex.bennee@linaro.org>
---
accel/tcg/plugin-gen.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index 77e6823d6b..a6aaacd053 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -415,11 +415,11 @@ static TCGOp *append_udata_cb(const struct
qemu_plugin_dyn_cb *cb,
op = copy_const_ptr(&begin_op, op, cb->userp);
/* copy the ld_i32, but note that we only have to copy it once */
- begin_op = QTAILQ_NEXT(begin_op, link);
- tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32);
if (*cb_idx == -1) {
- op = tcg_op_insert_after(tcg_ctx, op, INDEX_op_ld_i32);
- memcpy(op->args, begin_op->args, sizeof(op->args));
+ op = copy_op(&begin_op, op, INDEX_op_ld_i32);
+ } else {
+ begin_op = QTAILQ_NEXT(begin_op, link);
+ tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32);
}
/* call */
@@ -462,11 +462,11 @@ static TCGOp *append_mem_cb(const struct
qemu_plugin_dyn_cb *cb,
op = copy_const_ptr(&begin_op, op, cb->userp);
/* copy the ld_i32, but note that we only have to copy it once */
- begin_op = QTAILQ_NEXT(begin_op, link);
- tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32);
if (*cb_idx == -1) {
- op = tcg_op_insert_after(tcg_ctx, op, INDEX_op_ld_i32);
- memcpy(op->args, begin_op->args, sizeof(op->args));
+ op = copy_op(&begin_op, op, INDEX_op_ld_i32);
+ } else {
+ begin_op = QTAILQ_NEXT(begin_op, link);
+ tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32);
}
/* extu_tl_i64 */
--
2.34.1
Re: [PATCH v4 20/27] tcg: Vary the allocation size for TCGOp, Alex Bennée, 2022/12/19
[PATCH v4 19/27] accel/tcg/plugin: Use copy_op in append_{udata, mem}_cb,
Richard Henderson <=
[PATCH v4 25/27] tcg: Move ffi_cif pointer into TCGHelperInfo, Richard Henderson, 2022/12/13
[PATCH v4 22/27] tcg: Reorg function calls, Richard Henderson, 2022/12/13
[PATCH v4 26/27] tcg/aarch64: Merge tcg_out_callr into tcg_out_call, Richard Henderson, 2022/12/13
[PATCH v4 27/27] tcg: Add TCGHelperInfo argument to tcg_out_call, Richard Henderson, 2022/12/13
Re: [PATCH v4 00/27] tcg misc patches, Richard Henderson, 2022/12/18