mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
PPC: Generalize rematerialization handling.
This commit is contained in:
parent
826fb377ec
commit
167f638f91
17
src/lj_asm.c
17
src/lj_asm.c
@ -460,7 +460,20 @@ static void ra_evictset(ASMState *as, RegSet drop)
|
|||||||
/* Evict (rematerialize) all registers allocated to constants. */
|
/* Evict (rematerialize) all registers allocated to constants. */
|
||||||
static void ra_evictk(ASMState *as)
|
static void ra_evictk(ASMState *as)
|
||||||
{
|
{
|
||||||
RegSet work = ~as->freeset & RSET_ALL;
|
RegSet work;
|
||||||
|
#if !LJ_SOFTFP
|
||||||
|
work = ~as->freeset & RSET_FPR;
|
||||||
|
while (work) {
|
||||||
|
Reg r = rset_pickbot(work);
|
||||||
|
IRRef ref = regcost_ref(as->cost[r]);
|
||||||
|
if (emit_canremat(ref) && irref_isk(ref)) {
|
||||||
|
ra_rematk(as, ref);
|
||||||
|
checkmclim(as);
|
||||||
|
}
|
||||||
|
rset_clear(work, r);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
work = ~as->freeset & RSET_GPR;
|
||||||
while (work) {
|
while (work) {
|
||||||
Reg r = rset_pickbot(work);
|
Reg r = rset_pickbot(work);
|
||||||
IRRef ref = regcost_ref(as->cost[r]);
|
IRRef ref = regcost_ref(as->cost[r]);
|
||||||
@ -483,7 +496,7 @@ static Reg ra_allock(ASMState *as, int32_t k, RegSet allow)
|
|||||||
IRRef ref;
|
IRRef ref;
|
||||||
r = rset_pickbot(work);
|
r = rset_pickbot(work);
|
||||||
ref = regcost_ref(as->cost[r]);
|
ref = regcost_ref(as->cost[r]);
|
||||||
if (emit_canremat(ref) &&
|
if (ref < ASMREF_L &&
|
||||||
k == (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i))
|
k == (ra_iskref(ref) ? ra_krefk(as, ref) : IR(ref)->i))
|
||||||
return r;
|
return r;
|
||||||
rset_clear(work, r);
|
rset_clear(work, r);
|
||||||
|
Loading…
Reference in New Issue
Block a user