aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2020-10-09 08:23:52 -0500
committerRichard Henderson <richard.henderson@linaro.org>2020-10-27 09:48:07 -0700
commitcd0372c515c4732d8bd3777cdd995c139c7ed7ea (patch)
treee70d93030951b1f5adf2d1ab6b0d39dd0f8f76ab /tcg
parentb4cb76e6208cf6b5bb39404c6d44a6514eb6842a (diff)
downloadqemu-cd0372c515c4732d8bd3777cdd995c139c7ed7ea.zip
qemu-cd0372c515c4732d8bd3777cdd995c139c7ed7ea.tar.gz
qemu-cd0372c515c4732d8bd3777cdd995c139c7ed7ea.tar.bz2
tcg/optimize: Flush data at labels not TCG_OPF_BB_END
We can easily propagate temp values through the entire extended basic block (in this case, the set of blocks connected by fallthru), simply by not discarding the register state at the branch. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/optimize.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 220f460..9952c28 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1484,29 +1484,30 @@ void tcg_optimize(TCGContext *s)
}
}
}
- goto do_reset_output;
+ /* fall through */
default:
do_default:
- /* Default case: we know nothing about operation (or were unable
- to compute the operation result) so no propagation is done.
- We trash everything if the operation is the end of a basic
- block, otherwise we only trash the output args. "mask" is
- the non-zero bits mask for the first output arg. */
- if (def->flags & TCG_OPF_BB_END) {
- bitmap_zero(temps_used.l, nb_temps);
- } else {
- do_reset_output:
- for (i = 0; i < nb_oargs; i++) {
- reset_temp(op->args[i]);
- /* Save the corresponding known-zero bits mask for the
- first output argument (only one supported so far). */
- if (i == 0) {
- arg_info(op->args[i])->mask = mask;
- }
+ /*
+ * Default case: we know nothing about operation (or were unable
+ * to compute the operation result) so no propagation is done.
+ */
+ for (i = 0; i < nb_oargs; i++) {
+ reset_temp(op->args[i]);
+ /*
+ * Save the corresponding known-zero bits mask for the
+ * first output argument (only one supported so far).
+ */
+ if (i == 0) {
+ arg_info(op->args[i])->mask = mask;
}
}
break;
+
+ case INDEX_op_set_label:
+ /* Trash everything at the start of a new extended bb. */
+ bitmap_zero(temps_used.l, nb_temps);
+ break;
}
/* Eliminate duplicate and redundant fence instructions. */