mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Add IR_XBAR, a barrier against XLOAD/XSTORE optimizations.
This commit is contained in:
parent
0a50356b6f
commit
97d0874ff5
@ -3991,7 +3991,7 @@ static void asm_ir(ASMState *as, IRIns *ir)
|
|||||||
switch ((IROp)ir->o) {
|
switch ((IROp)ir->o) {
|
||||||
/* Miscellaneous ops. */
|
/* Miscellaneous ops. */
|
||||||
case IR_LOOP: asm_loop(as); break;
|
case IR_LOOP: asm_loop(as); break;
|
||||||
case IR_NOP: lua_assert(!ra_used(ir)); break;
|
case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break;
|
||||||
case IR_PHI: asm_phi(as, ir); break;
|
case IR_PHI: asm_phi(as, ir); break;
|
||||||
case IR_HIOP: asm_hiop(as, ir); break;
|
case IR_HIOP: asm_hiop(as, ir); break;
|
||||||
|
|
||||||
|
@ -115,9 +115,10 @@
|
|||||||
_(CNEW, AW, ref, ref) \
|
_(CNEW, AW, ref, ref) \
|
||||||
_(CNEWI, NW, ref, ref) /* CSE is ok, not marked as A. */ \
|
_(CNEWI, NW, ref, ref) /* CSE is ok, not marked as A. */ \
|
||||||
\
|
\
|
||||||
/* Write barriers. */ \
|
/* Barriers. */ \
|
||||||
_(TBAR, S , ref, ___) \
|
_(TBAR, S , ref, ___) \
|
||||||
_(OBAR, S , ref, ref) \
|
_(OBAR, S , ref, ref) \
|
||||||
|
_(XBAR, S , ___, ___) \
|
||||||
\
|
\
|
||||||
/* Type conversions. */ \
|
/* Type conversions. */ \
|
||||||
_(CONV, N , ref, lit) \
|
_(CONV, N , ref, lit) \
|
||||||
|
@ -1895,6 +1895,7 @@ LJFOLD(NEWREF any any) /* Treated like a store. */
|
|||||||
LJFOLD(CALLS any any)
|
LJFOLD(CALLS any any)
|
||||||
LJFOLD(CALLL any any) /* Safeguard fallback. */
|
LJFOLD(CALLL any any) /* Safeguard fallback. */
|
||||||
LJFOLD(CALLXS any any)
|
LJFOLD(CALLXS any any)
|
||||||
|
LJFOLD(XBAR)
|
||||||
LJFOLD(RETF any any) /* Modifies BASE. */
|
LJFOLD(RETF any any) /* Modifies BASE. */
|
||||||
LJFOLD(TNEW any any)
|
LJFOLD(TNEW any any)
|
||||||
LJFOLD(TDUP any)
|
LJFOLD(TDUP any)
|
||||||
|
@ -676,6 +676,7 @@ TRef LJ_FASTCALL lj_opt_fwd_xload(jit_State *J)
|
|||||||
ref = J->chain[IR_XSTORE];
|
ref = J->chain[IR_XSTORE];
|
||||||
retry:
|
retry:
|
||||||
if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS];
|
if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS];
|
||||||
|
if (J->chain[IR_XBAR] > lim) lim = J->chain[IR_XBAR];
|
||||||
while (ref > lim) {
|
while (ref > lim) {
|
||||||
IRIns *store = IR(ref);
|
IRIns *store = IR(ref);
|
||||||
switch (aa_xref(J, xr, fins, store)) {
|
switch (aa_xref(J, xr, fins, store)) {
|
||||||
@ -738,6 +739,7 @@ TRef LJ_FASTCALL lj_opt_dse_xstore(jit_State *J)
|
|||||||
IRRef1 *refp = &J->chain[IR_XSTORE];
|
IRRef1 *refp = &J->chain[IR_XSTORE];
|
||||||
IRRef ref = *refp;
|
IRRef ref = *refp;
|
||||||
if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS];
|
if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS];
|
||||||
|
if (J->chain[IR_XBAR] > lim) lim = J->chain[IR_XBAR];
|
||||||
while (ref > lim) { /* Search for redundant or conflicting stores. */
|
while (ref > lim) { /* Search for redundant or conflicting stores. */
|
||||||
IRIns *store = IR(ref);
|
IRIns *store = IR(ref);
|
||||||
switch (aa_xref(J, xr, fins, store)) {
|
switch (aa_xref(J, xr, fins, store)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user