diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-11-02 12:26:47 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-11-02 12:26:47 +0000 |
commit | 5208e5c87e679b7d9e767c2ad2ae98b733e6f802 (patch) | |
tree | d955fa0a8d167d98482ae8f29895fcd4db89fb95 | |
parent | 76ef7500813a7a13b3e75ac9fd6893635aeb9ba9 (diff) |
Revert "tcg/optimize: Flush data at labels not TCG_OPF_BB_END"revert-branch-stuff
This reverts commit cd0372c515c4732d8bd3777cdd995c139c7ed7ea.
-rw-r--r-- | tcg/optimize.c | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c index 9952c28bdc..220f4601d5 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1484,30 +1484,29 @@ void tcg_optimize(TCGContext *s) } } } - /* fall through */ + goto do_reset_output; default: do_default: - /* - * 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; + /* 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; + } } } 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. */ |