mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
x86: Don't spill an explicit REF_BASE in the IR.
Thanks to Vyacheslav Egorov.
This commit is contained in:
parent
37e1e70313
commit
747feb6e4e
@ -325,11 +325,11 @@ static Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow)
|
|||||||
as->mrm.base = as->mrm.idx = RID_NONE;
|
as->mrm.base = as->mrm.idx = RID_NONE;
|
||||||
return RID_MRM;
|
return RID_MRM;
|
||||||
}
|
}
|
||||||
} else if (ir->o == IR_KINT64) {
|
} else if (ref == REF_BASE || ir->o == IR_KINT64) {
|
||||||
RegSet avail = as->freeset & ~as->modset & RSET_GPR;
|
RegSet avail = as->freeset & ~as->modset & RSET_GPR;
|
||||||
lua_assert(allow != RSET_EMPTY);
|
lua_assert(allow != RSET_EMPTY);
|
||||||
if (!(avail & (avail-1))) { /* Fuse if less than two regs available. */
|
if (!(avail & (avail-1))) { /* Fuse if less than two regs available. */
|
||||||
as->mrm.ofs = ptr2addr(ir_kint64(ir));
|
as->mrm.ofs = ptr2addr(ref == REF_BASE ? (void *)&J2G(as->J)->jit_base : (void *)ir_kint64(ir));
|
||||||
as->mrm.base = as->mrm.idx = RID_NONE;
|
as->mrm.base = as->mrm.idx = RID_NONE;
|
||||||
return RID_MRM;
|
return RID_MRM;
|
||||||
}
|
}
|
||||||
@ -369,7 +369,7 @@ static Reg asm_fuseload(ASMState *as, IRRef ref, RegSet allow)
|
|||||||
return RID_MRM;
|
return RID_MRM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(as->freeset & allow) && !irref_isk(ref) &&
|
if (!(as->freeset & allow) && !emit_canremat(ref) &&
|
||||||
(allow == RSET_EMPTY || ra_hasspill(ir->s) || iscrossref(as, ref)))
|
(allow == RSET_EMPTY || ra_hasspill(ir->s) || iscrossref(as, ref)))
|
||||||
goto fusespill;
|
goto fusespill;
|
||||||
return ra_allocref(as, ref, allow);
|
return ra_allocref(as, ref, allow);
|
||||||
|
Loading…
Reference in New Issue
Block a user