diff options
author | Mike Pall <mike> | 2010-12-31 01:00:54 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-12-31 01:00:54 +0100 |
commit | 65b194a2f89eb315029724af56354bb527021192 (patch) | |
tree | d932b57effed9283029f49f8ec82b3182d615cc0 /src/lj_opt_fold.c | |
parent | dc4b82c33d04930bbc2e54673ebea41ffa3368fc (diff) | |
download | luajit-65b194a2f89eb315029724af56354bb527021192.tar.gz luajit-65b194a2f89eb315029724af56354bb527021192.tar.bz2 luajit-65b194a2f89eb315029724af56354bb527021192.zip |
Copy destination type for CONV from ir->t to op2, too.
Diffstat (limited to 'src/lj_opt_fold.c')
-rw-r--r-- | src/lj_opt_fold.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c index 8f05e7c8..4790d245 100644 --- a/src/lj_opt_fold.c +++ b/src/lj_opt_fold.c | |||
@@ -781,11 +781,9 @@ LJFOLDF(cse_conv) | |||
781 | IRRef ref = J->chain[IR_CONV]; | 781 | IRRef ref = J->chain[IR_CONV]; |
782 | while (ref > op1) { | 782 | while (ref > op1) { |
783 | IRIns *ir = IR(ref); | 783 | IRIns *ir = IR(ref); |
784 | /* CSE also depends on the target type! | 784 | /* Commoning with stronger checks is ok. */ |
785 | ** OTOH commoning with stronger checks is ok, too. | 785 | if (ir->op1 == op1 && (ir->op2 & IRCONV_MODEMASK) == op2 && |
786 | */ | 786 | irt_isguard(ir->t) >= guard) |
787 | if (ir->op1 == op1 && irt_sametype(ir->t, fins->t) && | ||
788 | (ir->op2 & IRCONV_MODEMASK) == op2 && irt_isguard(ir->t) >= guard) | ||
789 | return ref; | 787 | return ref; |
790 | ref = ir->prev; | 788 | ref = ir->prev; |
791 | } | 789 | } |
@@ -1773,7 +1771,7 @@ retry: | |||
1773 | key += (uint32_t)IR(fins->op2)->o; | 1771 | key += (uint32_t)IR(fins->op2)->o; |
1774 | *fright = *IR(fins->op2); | 1772 | *fright = *IR(fins->op2); |
1775 | } else { | 1773 | } else { |
1776 | key += (fins->op2 & 0xffu); /* For IRFPM_* and IRFL_*. */ | 1774 | key += (fins->op2 & 0x3ffu); /* Literal mask. Must include IRCONV_*MASK. */ |
1777 | } | 1775 | } |
1778 | 1776 | ||
1779 | /* Check for a match in order from most specific to least specific. */ | 1777 | /* Check for a match in order from most specific to least specific. */ |