aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2012-09-18 19:11:32 +0200
committerAurelien Jarno <aurelien@aurel32.net>2012-09-22 15:10:21 +0200
commit0aba1c7376ad325202f328211ab6dfcae94c7f2a (patch)
treeac07b857fbb6b859307a6c9b0230aa9103c912bc
parent1ff8c5418a680d6766493908eaa07cc11dce7f13 (diff)
tcg/optimize: optimize "op r, a, a => mov r, a"
Now that we can easily detect all copies, we can optimize the "op r, a, a => mov r, a" case a bit more. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r--tcg/optimize.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcg/optimize.c b/tcg/optimize.c
index aeb2225f2a..b9a7da920f 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -524,7 +524,7 @@ static TCGArg *tcg_constant_folding(TCGContext *s, uint16_t *tcg_opc_ptr,
switch (op) {
CASE_OP_32_64(or):
CASE_OP_32_64(and):
- if (args[1] == args[2]) {
+ if (temps_are_copies(args[1], args[2])) {
if (temps_are_copies(args[0], args[1])) {
gen_opc_buf[op_index] = INDEX_op_nop;
} else {