[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 58/64] ppc: Don't generate dead code on unconditional
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 58/64] ppc: Don't generate dead code on unconditional branches |
Date: |
Wed, 7 Sep 2016 20:29:37 +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-devel] [PULL 51/64] target-ppc: add extswsli[.] instruction, (continued)
- [Qemu-devel] [PULL 51/64] target-ppc: add extswsli[.] instruction, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 53/64] hw/ppc: use error_report instead of fprintf, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 41/64] ppc: Don't set access_type on all load/stores on hash64, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 39/64] ppc: Speed up dcbz, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 40/64] ppc: Fix CFAR updates, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 55/64] ppc: Fix macio ESCC legacy mapping, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 46/64] target-ppc: add dtstsfi[q] instructions, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 22/64] ppc: Rename fload_invalid_op_excp to float_invalid_op_excp, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 36/64] ppc: Don't update NIP in dcbz and lscbx, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 61/64] ppc: Improve a few more helper flags, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 58/64] ppc: Don't generate dead code on unconditional branches,
David Gibson <=
- [Qemu-devel] [PULL 59/64] ppc: Improve flags for helpers loading/writing the time facilities, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 52/64] ppc: Rename #include'd .c files to .inc.c, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 62/64] spapr: implement H_CHANGE_LOGICAL_LAN_MAC h_call, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 56/64] ppc: Fix catching some segfaults in user mode, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 57/64] ppc: Stop dumping state on all exceptions in linux-user, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 63/64] tests: Resort check-qtest entries in Makefile.include, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 64/64] tests: Check serial output of firmware boot of some machines, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 45/64] target-ppc: implement branch-less divd[o][.], David Gibson, 2016/09/07
- [Qemu-devel] [PULL 21/64] ppc: Move VSX ops out of translate.c, David Gibson, 2016/09/07
- [Qemu-devel] [PULL 17/64] ppc: Move classic fp ops out of translate.c, David Gibson, 2016/09/07