diff options
Diffstat (limited to 'src/lj_opt_loop.c')
-rw-r--r-- | src/lj_opt_loop.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lj_opt_loop.c b/src/lj_opt_loop.c index c5919ca0..2eacb7d7 100644 --- a/src/lj_opt_loop.c +++ b/src/lj_opt_loop.c | |||
@@ -352,10 +352,12 @@ static void loop_unroll(LoopState *lps) | |||
352 | irr = IR(ref); | 352 | irr = IR(ref); |
353 | goto phiconv; | 353 | goto phiconv; |
354 | } | 354 | } |
355 | } else if (ref != REF_DROP && irr->o == IR_CONV && | 355 | } else if (ref != REF_DROP && ref > invar && |
356 | ref > invar && irr->op1 < invar) { | 356 | ((irr->o == IR_CONV && irr->op1 < invar) || |
357 | /* May need an extra PHI for a CONV. */ | 357 | (irr->o == IR_ALEN && irr->op2 < invar && |
358 | ref = irr->op1; | 358 | irr->op2 != REF_NIL))) { |
359 | /* May need an extra PHI for a CONV or ALEN hint. */ | ||
360 | ref = irr->o == IR_CONV ? irr->op1 : irr->op2; | ||
359 | irr = IR(ref); | 361 | irr = IR(ref); |
360 | phiconv: | 362 | phiconv: |
361 | if (ref < invar && !irref_isk(ref) && !irt_isphi(irr->t)) { | 363 | if (ref < invar && !irref_isk(ref) && !irt_isphi(irr->t)) { |