diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_asm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c index 70d94c39..3d4060b2 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c | |||
@@ -2483,9 +2483,12 @@ static int swapops(ASMState *as, IRIns *ir) | |||
2483 | return 1; /* Swap if left already has a register. */ | 2483 | return 1; /* Swap if left already has a register. */ |
2484 | if (ra_samehint(ir->r, irr->r)) | 2484 | if (ra_samehint(ir->r, irr->r)) |
2485 | return 1; /* Swap if dest and right have matching hints. */ | 2485 | return 1; /* Swap if dest and right have matching hints. */ |
2486 | if (ir->op1 < as->loopref && !irt_isphi(irl->t) && | 2486 | if (as->curins > as->loopref) { /* In variant part? */ |
2487 | !(ir->op2 < as->loopref && !irt_isphi(irr->t))) | 2487 | if (ir->op2 < as->loopref && !irt_isphi(irr->t)) |
2488 | return 1; /* Swap invariants to the right. */ | 2488 | return 0; /* Keep invariants on the right. */ |
2489 | if (ir->op1 < as->loopref && !irt_isphi(irl->t)) | ||
2490 | return 1; /* Swap invariants to the right. */ | ||
2491 | } | ||
2489 | if (opisfusableload(irl->o)) | 2492 | if (opisfusableload(irl->o)) |
2490 | return 1; /* Swap fusable loads to the right. */ | 2493 | return 1; /* Swap fusable loads to the right. */ |
2491 | return 0; /* Otherwise don't swap. */ | 2494 | return 0; /* Otherwise don't swap. */ |