aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2011-02-07 21:59:25 +0100
committerMike Pall <mike>2011-02-07 21:59:25 +0100
commit97d0874ff5dc878758f79ceef5509cc632779c53 (patch)
treed7527912e89c4af827302b0a9ca2f0634d8ead15
parent0a50356b6f7d256af36fbf564b73c5721681cb56 (diff)
downloadluajit-97d0874ff5dc878758f79ceef5509cc632779c53.tar.gz
luajit-97d0874ff5dc878758f79ceef5509cc632779c53.tar.bz2
luajit-97d0874ff5dc878758f79ceef5509cc632779c53.zip
Add IR_XBAR, a barrier against XLOAD/XSTORE optimizations.
-rw-r--r--src/lj_asm.c2
-rw-r--r--src/lj_ir.h3
-rw-r--r--src/lj_opt_fold.c1
-rw-r--r--src/lj_opt_mem.c2
4 files changed, 6 insertions, 2 deletions
diff --git a/src/lj_asm.c b/src/lj_asm.c
index acad3b25..c349c990 100644
--- a/src/lj_asm.c
+++ b/src/lj_asm.c
@@ -3991,7 +3991,7 @@ static void asm_ir(ASMState *as, IRIns *ir)
3991 switch ((IROp)ir->o) { 3991 switch ((IROp)ir->o) {
3992 /* Miscellaneous ops. */ 3992 /* Miscellaneous ops. */
3993 case IR_LOOP: asm_loop(as); break; 3993 case IR_LOOP: asm_loop(as); break;
3994 case IR_NOP: lua_assert(!ra_used(ir)); break; 3994 case IR_NOP: case IR_XBAR: lua_assert(!ra_used(ir)); break;
3995 case IR_PHI: asm_phi(as, ir); break; 3995 case IR_PHI: asm_phi(as, ir); break;
3996 case IR_HIOP: asm_hiop(as, ir); break; 3996 case IR_HIOP: asm_hiop(as, ir); break;
3997 3997
diff --git a/src/lj_ir.h b/src/lj_ir.h
index ae533939..a29fca6f 100644
--- a/src/lj_ir.h
+++ b/src/lj_ir.h
@@ -115,9 +115,10 @@
115 _(CNEW, AW, ref, ref) \ 115 _(CNEW, AW, ref, ref) \
116 _(CNEWI, NW, ref, ref) /* CSE is ok, not marked as A. */ \ 116 _(CNEWI, NW, ref, ref) /* CSE is ok, not marked as A. */ \
117 \ 117 \
118 /* Write barriers. */ \ 118 /* Barriers. */ \
119 _(TBAR, S , ref, ___) \ 119 _(TBAR, S , ref, ___) \
120 _(OBAR, S , ref, ref) \ 120 _(OBAR, S , ref, ref) \
121 _(XBAR, S , ___, ___) \
121 \ 122 \
122 /* Type conversions. */ \ 123 /* Type conversions. */ \
123 _(CONV, N , ref, lit) \ 124 _(CONV, N , ref, lit) \
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c
index f4872046..e5ed7ade 100644
--- a/src/lj_opt_fold.c
+++ b/src/lj_opt_fold.c
@@ -1895,6 +1895,7 @@ LJFOLD(NEWREF any any) /* Treated like a store. */
1895LJFOLD(CALLS any any) 1895LJFOLD(CALLS any any)
1896LJFOLD(CALLL any any) /* Safeguard fallback. */ 1896LJFOLD(CALLL any any) /* Safeguard fallback. */
1897LJFOLD(CALLXS any any) 1897LJFOLD(CALLXS any any)
1898LJFOLD(XBAR)
1898LJFOLD(RETF any any) /* Modifies BASE. */ 1899LJFOLD(RETF any any) /* Modifies BASE. */
1899LJFOLD(TNEW any any) 1900LJFOLD(TNEW any any)
1900LJFOLD(TDUP any) 1901LJFOLD(TDUP any)
diff --git a/src/lj_opt_mem.c b/src/lj_opt_mem.c
index 211c329a..6062be70 100644
--- a/src/lj_opt_mem.c
+++ b/src/lj_opt_mem.c
@@ -676,6 +676,7 @@ TRef LJ_FASTCALL lj_opt_fwd_xload(jit_State *J)
676 ref = J->chain[IR_XSTORE]; 676 ref = J->chain[IR_XSTORE];
677retry: 677retry:
678 if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS]; 678 if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS];
679 if (J->chain[IR_XBAR] > lim) lim = J->chain[IR_XBAR];
679 while (ref > lim) { 680 while (ref > lim) {
680 IRIns *store = IR(ref); 681 IRIns *store = IR(ref);
681 switch (aa_xref(J, xr, fins, store)) { 682 switch (aa_xref(J, xr, fins, store)) {
@@ -738,6 +739,7 @@ TRef LJ_FASTCALL lj_opt_dse_xstore(jit_State *J)
738 IRRef1 *refp = &J->chain[IR_XSTORE]; 739 IRRef1 *refp = &J->chain[IR_XSTORE];
739 IRRef ref = *refp; 740 IRRef ref = *refp;
740 if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS]; 741 if (J->chain[IR_CALLXS] > lim) lim = J->chain[IR_CALLXS];
742 if (J->chain[IR_XBAR] > lim) lim = J->chain[IR_XBAR];
741 while (ref > lim) { /* Search for redundant or conflicting stores. */ 743 while (ref > lim) { /* Search for redundant or conflicting stores. */
742 IRIns *store = IR(ref); 744 IRIns *store = IR(ref);
743 switch (aa_xref(J, xr, fins, store)) { 745 switch (aa_xref(J, xr, fins, store)) {