aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2010-12-09 16:08:55 +0100
committerMike Pall <mike>2010-12-09 16:08:55 +0100
commite9cab5a763b72e146a5faf49d06562e0e111b626 (patch)
treeeda045d73d7faff843153445322bf1006776fefb
parent4f0d3e8262506bccbb80a5cf265aea56bb778bb0 (diff)
downloadluajit-e9cab5a763b72e146a5faf49d06562e0e111b626.tar.gz
luajit-e9cab5a763b72e146a5faf49d06562e0e111b626.tar.bz2
luajit-e9cab5a763b72e146a5faf49d06562e0e111b626.zip
x86/x64 backend: keep invariants on the right rather than fusing loads.
-rw-r--r--src/lj_asm.c9
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. */