[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 60/66] ppc: Don't generate dead code on unconditional b
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 60/66] ppc: Don't generate dead code on unconditional branches |
Date: |
Tue, 6 Sep 2016 13:40:47 +1000 |
From: Benjamin Herrenschmidt <address@hidden>
We are always generating the "else" case of the condition even when
generating an unconditional branch that will never hit it.
Signed-off-by: Benjamin Herrenschmidt <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target-ppc/translate.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 0a5a3e2..618334a 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3480,8 +3480,10 @@ static inline void gen_bcond(DisasContext *ctx, int type)
} else {
gen_goto_tb(ctx, 0, li);
}
- gen_set_label(l1);
- gen_goto_tb(ctx, 1, ctx->nip);
+ if ((bo & 0x14) != 0x14) {
+ gen_set_label(l1);
+ gen_goto_tb(ctx, 1, ctx->nip);
+ }
} else {
if (NARROW_MODE(ctx)) {
tcg_gen_andi_tl(cpu_nip, target, (uint32_t)~3);
@@ -3489,9 +3491,11 @@ static inline void gen_bcond(DisasContext *ctx, int type)
tcg_gen_andi_tl(cpu_nip, target, ~3);
}
tcg_gen_exit_tb(0);
- gen_set_label(l1);
- gen_update_nip(ctx, ctx->nip);
- tcg_gen_exit_tb(0);
+ if ((bo & 0x14) != 0x14) {
+ gen_set_label(l1);
+ gen_update_nip(ctx, ctx->nip);
+ tcg_gen_exit_tb(0);
+ }
}
if (type == BCOND_LR || type == BCOND_CTR || type == BCOND_TAR) {
tcg_temp_free(target);
--
2.7.4
- [Qemu-ppc] [PULL 52/66] target-ppc: add vsrv instruction, (continued)
- [Qemu-ppc] [PULL 52/66] target-ppc: add vsrv instruction, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 46/66] target-ppc: implement branch-less divw[o][.], David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 43/66] ppc: Use a helper to generate "LE unsupported" alignment interrupts, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 58/66] ppc: Fix catching some segfaults in user mode, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 44/66] ppc: load/store multiple and string insns don't do LE, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 39/66] ppc: Handle unconditional (always/never) traps at translation time, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 57/66] ppc: Fix macio ESCC legacy mapping, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 63/66] ppc: Improve a few more helper flags, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 61/66] ppc: Improve flags for helpers loading/writing the time facilities, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 62/66] ppc: Improve the exception helpers flags, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 60/66] ppc: Don't generate dead code on unconditional branches,
David Gibson <=
- [Qemu-ppc] [PULL 65/66] tests: Resort check-qtest entries in Makefile.include, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 19/66] ppc: Move DFP ops out of translate.c, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 66/66] tests: Check serial output of firmware boot of some machines, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 50/66] target-ppc: add vcmpnez[b, h, w][.] instructions, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 30/66] ppc: Rework NIP updates vs. exception generation, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 21/66] ppc: Move VSX ops out of translate.c, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 47/66] target-ppc: implement branch-less divd[o][.], David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 54/66] ppc: Rename #include'd .c files to .inc.c, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 59/66] ppc: Stop dumping state on all exceptions in linux-user, David Gibson, 2016/09/05
- [Qemu-ppc] [PULL 17/66] ppc: Move classic fp ops out of translate.c, David Gibson, 2016/09/05