1 From 16f29b266435c7eaffc5081c6bba4651d56a8ce8 Mon Sep 17 00:00:00 2001
2 From: Aurelien Jarno <aurelien@aurel32.net>
3 Date: Thu, 6 Sep 2012 16:47:13 +0200
4 Subject: [PATCH] tcg/optimize: split expression simplification
6 Split expression simplification in multiple parts so that a given op
7 can appear multiple times. This patch should not change anything.
9 Reviewed-by: Richard Henderson <rth@twiddle.net>
10 Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
11 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
13 tcg/optimize.c | 14 +++++++++++++-
14 1 file changed, 13 insertions(+), 1 deletion(-)
16 diff --git a/tcg/optimize.c b/tcg/optimize.c
17 index 9c65474..63f970d 100644
20 @@ -322,7 +322,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
24 - /* Simplify expression if possible. */
25 + /* Simplify expression for "op r, a, 0 => mov r, a" cases */
29 @@ -352,6 +352,12 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
37 + /* Simplify expression for "op r, a, 0 => movi r, 0" cases */
40 if ((temps[args[2]].state == TCG_TEMP_CONST
41 && temps[args[2]].val == 0)) {
42 @@ -362,6 +368,12 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
50 + /* Simplify expression for "op r, a, a => mov r, a" cases */
54 if (args[1] == args[2]) {