From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: agraf@suse.de, thuth@redhat.com, lvivier@redhat.com,
benh@kernel.crashing.org, qemu-devel@nongnu.org,
qemu-ppc@nongnu.org, David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 58/64] ppc: Don't generate dead code on unconditional branches
Date: Wed, 7 Sep 2016 20:29:37 +1000 [thread overview]
Message-ID: <1473244183-31510-59-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1473244183-31510-1-git-send-email-david@gibson.dropbear.id.au>
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
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 <benh@kernel.crashing.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
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
next prev parent reply other threads:[~2016-09-07 10:28 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 10:28 [Qemu-devel] [PULL 00/64] ppc-for-2.8 queue 20160907 David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 01/64] xics_kvm: drop extra checking of kernel_xics_fd David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 02/64] hw/ppc: include fdt helper routine in a common file David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 03/64] target-ppc: Introduce Power9 family David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 04/64] target-ppc: Introduce POWER ISA 3.0 flag David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 05/64] target-ppc: adding addpcis instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 06/64] target-ppc: add cmprb instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 07/64] target-ppc: add modulo word operations David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 08/64] target-ppc: add modulo dword operations David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 09/64] target-ppc: add cnttzd[.] instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 10/64] target-ppc: add cnttzw[.] instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 11/64] target-ppc: add cmpeqb instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 12/64] target-ppc: add setb instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 13/64] target-ppc: add maddld instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 14/64] target-ppc: add maddhd and maddhdu instruction David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 15/64] target-ppc: introduce opc4 for Expanded Opcode David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 16/64] ppc: Provide basic raise_exception_* functions David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 17/64] ppc: Move classic fp ops out of translate.c David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 18/64] ppc: Move embedded spe " David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 19/64] ppc: Move DFP " David Gibson
2016-09-07 10:28 ` [Qemu-devel] [PULL 20/64] ppc: Move VMX " David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 21/64] ppc: Move VSX " David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 22/64] ppc: Rename fload_invalid_op_excp to float_invalid_op_excp David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 23/64] ppc: Make float_invalid_op_excp() pass the return address David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 24/64] ppc: Make float_check_status() " David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 25/64] ppc: Don't update the NIP in floating point generated code David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 26/64] ppc: FP exceptions are always precise David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 27/64] ppc: Don't update NIP in lswi/lswx/stswi/stswx David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 28/64] ppc: Don't update NIP in lmw/stmw/icbi David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 29/64] ppc: Make tlb_fill() use new exception helper David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 30/64] ppc: Fix source NIP on SLB related interrupts David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 31/64] ppc: Don't update NIP in DCR access routines David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 32/64] ppc: Don't update NIP in facility unavailable interrupts David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 33/64] ppc: Don't update NIP BookE 2.06 tlbwe David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 34/64] ppc: Don't update NIP on conditional trap instructions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 35/64] ppc: Don't update NIP if not taking alignment exceptions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 36/64] ppc: Don't update NIP in dcbz and lscbx David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 37/64] ppc: Make alignment exceptions suck less David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 38/64] ppc: Handle unconditional (always/never) traps at translation time David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 39/64] ppc: Speed up dcbz David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 40/64] ppc: Fix CFAR updates David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 41/64] ppc: Don't set access_type on all load/stores on hash64 David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 42/64] ppc: Use a helper to generate "LE unsupported" alignment interrupts David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 43/64] ppc: load/store multiple and string insns don't do LE David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 44/64] target-ppc: implement branch-less divw[o][.] David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 45/64] target-ppc: implement branch-less divd[o][.] David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 46/64] target-ppc: add dtstsfi[q] instructions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 47/64] target-ppc: add vabsdu[b, h, w] instructions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 48/64] target-ppc: add vcmpnez[b, h, w][.] instructions David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 49/64] target-ppc: add vslv instruction David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 50/64] target-ppc: add vsrv instruction David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 51/64] target-ppc: add extswsli[.] instruction David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 52/64] ppc: Rename #include'd .c files to .inc.c David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 53/64] hw/ppc: use error_report instead of fprintf David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 54/64] hw/ppc: add a ppc_create_page_sizes_prop() helper routine David Gibson
2016-09-14 13:59 ` Alex Bennée
2016-09-14 14:33 ` Cédric Le Goater
2016-09-14 14:40 ` Cédric Le Goater
2016-09-07 10:29 ` [Qemu-devel] [PULL 55/64] ppc: Fix macio ESCC legacy mapping David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 56/64] ppc: Fix catching some segfaults in user mode David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 57/64] ppc: Stop dumping state on all exceptions in linux-user David Gibson
2016-09-07 10:29 ` David Gibson [this message]
2016-09-07 10:29 ` [Qemu-devel] [PULL 59/64] ppc: Improve flags for helpers loading/writing the time facilities David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 60/64] ppc: Improve the exception helpers flags David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 61/64] ppc: Improve a few more helper flags David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 62/64] spapr: implement H_CHANGE_LOGICAL_LAN_MAC h_call David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 63/64] tests: Resort check-qtest entries in Makefile.include David Gibson
2016-09-07 10:29 ` [Qemu-devel] [PULL 64/64] tests: Check serial output of firmware boot of some machines David Gibson
2016-09-07 12:02 ` [Qemu-devel] [PULL 00/64] ppc-for-2.8 queue 20160907 no-reply
2016-09-08 11:07 ` Peter Maydell
2016-09-14 14:00 ` Alex Bennée
2016-09-14 14:21 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1473244183-31510-59-git-send-email-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=benh@kernel.crashing.org \
--cc=lvivier@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).