aboutsummaryrefslogtreecommitdiff
path: root/src/lj_opt_fold.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_opt_fold.c')
-rw-r--r--src/lj_opt_fold.c10
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. */