]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tcg: Optimize past conditional branches
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 17 Oct 2023 02:10:42 +0000 (19:10 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Sun, 22 Oct 2023 23:32:28 +0000 (16:32 -0700)
We already register allocate through extended basic blocks,
optimize through extended basic blocks as well.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
tcg/optimize.c

index 3013eb04e6075e7e1f9828426b046f86ca5e4f57..2db5177c32ce1b96c232da30a72c7e4f4442b003 100644 (file)
@@ -688,12 +688,14 @@ static void finish_folding(OptContext *ctx, TCGOp *op)
     int i, nb_oargs;
 
     /*
-     * For an opcode that ends a BB, reset all temp data.
-     * We do no cross-BB optimization.
+     * We only optimize extended basic blocks.  If the opcode ends a BB
+     * and is not a conditional branch, reset all temp data.
      */
     if (def->flags & TCG_OPF_BB_END) {
-        memset(&ctx->temps_used, 0, sizeof(ctx->temps_used));
         ctx->prev_mb = NULL;
+        if (!(def->flags & TCG_OPF_COND_BRANCH)) {
+            memset(&ctx->temps_used, 0, sizeof(ctx->temps_used));
+        }
         return;
     }