Blame 0072-tcg-optimize-optimize-op-r-a-a-mov-r-a.patch
|
|
5544c1 |
From e38329760e40a354e37d11c7f5d8c86cdb90736c Mon Sep 17 00:00:00 2001
|
|
|
5544c1 |
From: Aurelien Jarno <aurelien@aurel32.net>
|
|
|
5544c1 |
Date: Tue, 18 Sep 2012 19:11:32 +0200
|
|
|
5544c1 |
Subject: [PATCH] tcg/optimize: optimize "op r, a, a => mov r, a"
|
|
|
5544c1 |
|
|
|
5544c1 |
Now that we can easily detect all copies, we can optimize the
|
|
|
5544c1 |
"op r, a, a => mov r, a" case a bit more.
|
|
|
5544c1 |
|
|
|
5544c1 |
Reviewed-by: Richard Henderson <rth@twiddle.net>
|
|
|
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 | 2 +-
|
|
|
5544c1 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
5544c1 |
|
|
|
5544c1 |
diff --git a/tcg/optimize.c b/tcg/optimize.c
|
|
|
5544c1 |
index aeb2225..b9a7da9 100644
|
|
|
5544c1 |
--- a/tcg/optimize.c
|
|
|
5544c1 |
+++ b/tcg/optimize.c
|
|
|
5544c1 |
@@ -524,7 +524,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
|
|
|
5544c1 |
switch (op) {
|
|
|
5544c1 |
CASE_OP_32_64(or):
|
|
|
5544c1 |
CASE_OP_32_64(and):
|
|
|
5544c1 |
- if (args[1] == args[2]) {
|
|
|
5544c1 |
+ if (temps_are_copies(args[1], args[2])) {
|
|
|
5544c1 |
if (temps_are_copies(args[0], args[1])) {
|
|
|
5544c1 |
gen_opc_buf[op_index] = INDEX_op_nop;
|
|
|
5544c1 |
} else {
|
|
|
5544c1 |
--
|
|
|
5544c1 |
1.7.12.1
|
|
|
5544c1 |
|