mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-08 07:34:07 +00:00
Add stricter check for sinking PHIs.
This commit is contained in:
parent
4da7ffc34b
commit
c22d698e17
@ -47,7 +47,7 @@ static int sink_phidep(jit_State *J, IRRef ref)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check whether a value is a sinkable PHI or a non-PHI. */
|
/* Check whether a value is a sinkable PHI or loop-invariant. */
|
||||||
static int sink_checkphi(jit_State *J, IRIns *ira, IRRef ref)
|
static int sink_checkphi(jit_State *J, IRIns *ira, IRRef ref)
|
||||||
{
|
{
|
||||||
if (ref >= REF_FIRST) {
|
if (ref >= REF_FIRST) {
|
||||||
@ -57,7 +57,8 @@ static int sink_checkphi(jit_State *J, IRIns *ira, IRRef ref)
|
|||||||
ira->prev++;
|
ira->prev++;
|
||||||
return 1; /* Sinkable PHI. */
|
return 1; /* Sinkable PHI. */
|
||||||
}
|
}
|
||||||
return !sink_phidep(J, ref); /* Must be a non-PHI then. */
|
/* Otherwise the value must be loop-invariant. */
|
||||||
|
return ref < J->loopref && !sink_phidep(J, ref);
|
||||||
}
|
}
|
||||||
return 1; /* Constant (non-PHI). */
|
return 1; /* Constant (non-PHI). */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user