mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
x86/x64 backend: keep invariants on the right rather than fusing loads.
This commit is contained in:
parent
4f0d3e8262
commit
e9cab5a763
@ -2483,9 +2483,12 @@ static int swapops(ASMState *as, IRIns *ir)
|
||||
return 1; /* Swap if left already has a register. */
|
||||
if (ra_samehint(ir->r, irr->r))
|
||||
return 1; /* Swap if dest and right have matching hints. */
|
||||
if (ir->op1 < as->loopref && !irt_isphi(irl->t) &&
|
||||
!(ir->op2 < as->loopref && !irt_isphi(irr->t)))
|
||||
return 1; /* Swap invariants to the right. */
|
||||
if (as->curins > as->loopref) { /* In variant part? */
|
||||
if (ir->op2 < as->loopref && !irt_isphi(irr->t))
|
||||
return 0; /* Keep invariants on the right. */
|
||||
if (ir->op1 < as->loopref && !irt_isphi(irl->t))
|
||||
return 1; /* Swap invariants to the right. */
|
||||
}
|
||||
if (opisfusableload(irl->o))
|
||||
return 1; /* Swap fusable loads to the right. */
|
||||
return 0; /* Otherwise don't swap. */
|
||||
|
Loading…
Reference in New Issue
Block a user