peterdelevoryas / rpms / qemu

Forked from rpms/qemu 2 years ago
Clone

Blame 0042-revert-TCG-fix-copy-propagation.patch

5544c1
From 2b8d0049e88c17749ccb978509d3f8fda180d35f Mon Sep 17 00:00:00 2001
5544c1
From: Aurelien Jarno <aurelien@aurel32.net>
5544c1
Date: Mon, 10 Sep 2012 13:14:12 +0200
5544c1
Subject: [PATCH] revert "TCG: fix copy propagation"
5544c1
5544c1
Given the copy propagation breakage on 32-bit hosts has been fixed
5544c1
commit e31b0a7c050711884ad570fe73df806520953618 can be reverted.
5544c1
5544c1
Cc: Blue Swirl <blauwirbel@gmail.com>
5544c1
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
5544c1
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1
---
5544c1
 tcg/optimize.c | 15 ++++++---------
5544c1
 tcg/tcg.h      |  5 -----
5544c1
 2 files changed, 6 insertions(+), 14 deletions(-)
5544c1
5544c1
diff --git a/tcg/optimize.c b/tcg/optimize.c
5544c1
index fba0ed9..10d9773 100644
5544c1
--- a/tcg/optimize.c
5544c1
+++ b/tcg/optimize.c
5544c1
@@ -107,15 +107,12 @@ static TCGOpcode op_to_movi(TCGOpcode op)
5544c1
     }
5544c1
 }
5544c1
 
5544c1
-static void tcg_opt_gen_mov(TCGContext *s, TCGArg *gen_args, TCGArg dst,
5544c1
-                            TCGArg src, int nb_temps, int nb_globals)
5544c1
+static void tcg_opt_gen_mov(TCGArg *gen_args, TCGArg dst, TCGArg src,
5544c1
+                            int nb_temps, int nb_globals)
5544c1
 {
5544c1
         reset_temp(dst, nb_temps, nb_globals);
5544c1
         assert(temps[src].state != TCG_TEMP_COPY);
5544c1
-        /* Don't try to copy if one of temps is a global or either one
5544c1
-           is local and another is register */
5544c1
-        if (src >= nb_globals && dst >= nb_globals &&
5544c1
-            tcg_arg_is_local(s, src) == tcg_arg_is_local(s, dst)) {
5544c1
+        if (src >= nb_globals) {
5544c1
             assert(temps[src].state != TCG_TEMP_CONST);
5544c1
             if (temps[src].state != TCG_TEMP_HAS_COPY) {
5544c1
                 temps[src].state = TCG_TEMP_HAS_COPY;
5544c1
@@ -444,7 +441,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
5544c1
                     gen_opc_buf[op_index] = INDEX_op_nop;
5544c1
                 } else {
5544c1
                     gen_opc_buf[op_index] = op_to_mov(op);
5544c1
-                    tcg_opt_gen_mov(s, gen_args, args[0], args[1],
5544c1
+                    tcg_opt_gen_mov(gen_args, args[0], args[1],
5544c1
                                     nb_temps, nb_globals);
5544c1
                     gen_args += 2;
5544c1
                 }
5544c1
@@ -482,7 +479,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
5544c1
                     gen_opc_buf[op_index] = INDEX_op_nop;
5544c1
                 } else {
5544c1
                     gen_opc_buf[op_index] = op_to_mov(op);
5544c1
-                    tcg_opt_gen_mov(s, gen_args, args[0], args[1], nb_temps,
5544c1
+                    tcg_opt_gen_mov(gen_args, args[0], args[1], nb_temps,
5544c1
                                     nb_globals);
5544c1
                     gen_args += 2;
5544c1
                 }
5544c1
@@ -507,7 +504,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
5544c1
                 break;
5544c1
             }
5544c1
             if (temps[args[1]].state != TCG_TEMP_CONST) {
5544c1
-                tcg_opt_gen_mov(s, gen_args, args[0], args[1],
5544c1
+                tcg_opt_gen_mov(gen_args, args[0], args[1],
5544c1
                                 nb_temps, nb_globals);
5544c1
                 gen_args += 2;
5544c1
                 args += 2;
5544c1
diff --git a/tcg/tcg.h b/tcg/tcg.h
5544c1
index d710694..8fbbc81 100644
5544c1
--- a/tcg/tcg.h
5544c1
+++ b/tcg/tcg.h
5544c1
@@ -458,11 +458,6 @@ static inline TCGv_i64 tcg_temp_local_new_i64(void)
5544c1
 void tcg_temp_free_i64(TCGv_i64 arg);
5544c1
 char *tcg_get_arg_str_i64(TCGContext *s, char *buf, int buf_size, TCGv_i64 arg);
5544c1
 
5544c1
-static inline bool tcg_arg_is_local(TCGContext *s, TCGArg arg)
5544c1
-{
5544c1
-    return s->temps[arg].temp_local;
5544c1
-}
5544c1
-
5544c1
 #if defined(CONFIG_DEBUG_TCG)
5544c1
 /* If you call tcg_clear_temp_count() at the start of a section of
5544c1
  * code which is not supposed to leak any TCG temporaries, then
5544c1
-- 
5544c1
1.7.12.1
5544c1