summaryrefslogtreecommitdiffstats
path: root/include/tcg/tcg.h
diff options
context:
space:
mode:
authorRichard Henderson2021-06-04 23:26:45 +0200
committerRichard Henderson2021-06-14 02:42:40 +0200
commita80cdd3183ed85bc254cbe22ca240dc035fc6548 (patch)
tree93e6c5628e1c266ef32b3013030614d1f551ef15 /include/tcg/tcg.h
parenttcg: Move tcg_init_ctx and tcg_ctx from accel/tcg/ (diff)
downloadqemu-a80cdd3183ed85bc254cbe22ca240dc035fc6548.tar.gz
qemu-a80cdd3183ed85bc254cbe22ca240dc035fc6548.tar.xz
qemu-a80cdd3183ed85bc254cbe22ca240dc035fc6548.zip
tcg: Introduce tcg_remove_ops_after
Introduce a function to remove everything emitted since a given point. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/tcg/tcg.h')
-rw-r--r--include/tcg/tcg.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h
index e95abac9f4..1d056ed0ed 100644
--- a/include/tcg/tcg.h
+++ b/include/tcg/tcg.h
@@ -1071,6 +1071,16 @@ void tcg_op_remove(TCGContext *s, TCGOp *op);
TCGOp *tcg_op_insert_before(TCGContext *s, TCGOp *op, TCGOpcode opc);
TCGOp *tcg_op_insert_after(TCGContext *s, TCGOp *op, TCGOpcode opc);
+/**
+ * tcg_remove_ops_after:
+ * @op: target operation
+ *
+ * Discard any opcodes emitted since @op. Expected usage is to save
+ * a starting point with tcg_last_op(), speculatively emit opcodes,
+ * then decide whether or not to keep those opcodes after the fact.
+ */
+void tcg_remove_ops_after(TCGOp *op);
+
void tcg_optimize(TCGContext *s);
/* Allocate a new temporary and initialize it with a constant. */