]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Add IR_XBAR, a barrier against XLOAD/XSTORE optimizations.
authorMike Pall <mike>
Mon, 7 Feb 2011 20:59:25 +0000 (21:59 +0100)
committerMike Pall <mike>
Mon, 7 Feb 2011 20:59:25 +0000 (21:59 +0100)
src/lj_asm.c
src/lj_ir.h
src/lj_opt_fold.c
src/lj_opt_mem.c

index acad3b2594cbdc46755ce2926a545870f905e865..c349c990189a8872feb59e6e92f8a9dcf0b8b850 100644 (file)
@@ -3991,7 +3991,7 @@ static void asm_ir(ASMState *as, IRIns *ir)
   switch ((IROp)ir->o) {
   /* Miscellaneous ops. */
   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_HIOP: asm_hiop(as, ir); break;
 
index ae5339392343f58868d658276b4a697727abbe8a..a29fca6fb3b19fdd1e913d2792fa2e28775500cc 100644 (file)
   _(CNEW,      AW, ref, ref) \
   _(CNEWI,     NW, ref, ref)  /* CSE is ok, not marked as A. */ \
   \
-  /* Write barriers. */ \
+  /* Barriers. */ \
   _(TBAR,      S , ref, ___) \
   _(OBAR,      S , ref, ref) \
+  _(XBAR,      S , ___, ___) \
   \
   /* Type conversions. */ \
   _(CONV,      N , ref, lit) \
index f4872046cfe60b2f53b67d794e5f8547c79c203a..e5ed7adee349132a6855b304e5706a0b112d6476 100644 (file)
@@ -1895,6 +1895,7 @@ LJFOLD(NEWREF any any)  /* Treated like a store. */
 LJFOLD(CALLS any any)
 LJFOLD(CALLL any any)  /* Safeguard fallback. */
 LJFOLD(CALLXS any any)
+LJFOLD(XBAR)
 LJFOLD(RETF any any)  /* Modifies BASE. */
 LJFOLD(TNEW any any)
 LJFOLD(TDUP any)
index 211c329a6ece340c24513180675db4a9d263f318..6062be70f536c27e2e2d525c4a2b0af922e1c49c 100644 (file)
@@ -676,6 +676,7 @@ TRef LJ_FASTCALL lj_opt_fwd_xload(jit_State *J)
   ref = J->chain[IR_XSTORE];
 retry:
   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) {
     IRIns *store = IR(ref);
     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];
   IRRef ref = *refp;
   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. */
     IRIns *store = IR(ref);
     switch (aa_xref(J, xr, fins, store)) {