Update LuaJIT to the latest 2.1.0 source (f3c8569)

This commit is contained in:
Alex Szpakowski
2021-12-03 20:50:23 -04:00
parent 4f24e5473f
commit c3986a9541
216 changed files with 6026 additions and 1838 deletions
+31 -4
View File
@@ -3,7 +3,7 @@
** AA: Alias Analysis using high-level semantic disambiguation.
** FWD: Load Forwarding (L2L) + Store Forwarding (S2L).
** DSE: Dead-Store Elimination.
** Copyright (C) 2005-2020 Mike Pall. See Copyright Notice in luajit.h
** Copyright (C) 2005-2021 Mike Pall. See Copyright Notice in luajit.h
*/
#define lj_opt_mem_c
@@ -364,7 +364,10 @@ TRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J)
/* Different value: try to eliminate the redundant store. */
if (ref > J->chain[IR_LOOP]) { /* Quick check to avoid crossing LOOP. */
IRIns *ir;
/* Check for any intervening guards (includes conflicting loads). */
/* Check for any intervening guards (includes conflicting loads).
** Note that lj_tab_keyindex and lj_vm_next don't need guards,
** since they are followed by at least one guarded VLOAD.
*/
for (ir = IR(J->cur.nins-1); ir > store; ir--)
if (irt_isguard(ir->t) || ir->o == IR_ALEN)
goto doemit; /* No elimination possible. */
@@ -620,8 +623,9 @@ TRef LJ_FASTCALL lj_opt_dse_fstore(jit_State *J)
goto doemit;
break; /* Otherwise continue searching. */
case ALIAS_MUST:
if (store->op2 == val) /* Same value: drop the new store. */
return DROPFOLD;
if (store->op2 == val &&
!(xr->op2 >= IRFL_SBUF_W && xr->op2 <= IRFL_SBUF_R))
return DROPFOLD; /* Same value: drop the new store. */
/* Different value: try to eliminate the redundant store. */
if (ref > J->chain[IR_LOOP]) { /* Quick check to avoid crossing LOOP. */
IRIns *ir;
@@ -642,6 +646,29 @@ doemit:
return EMITFOLD; /* Otherwise we have a conflict or simply no match. */
}
/* Check whether there's no aliasing buffer op between IRFL_SBUF_*. */
int LJ_FASTCALL lj_opt_fwd_sbuf(jit_State *J, IRRef lim)
{
IRRef ref;
if (J->chain[IR_BUFPUT] > lim)
return 0; /* Conflict. */
ref = J->chain[IR_CALLS];
while (ref > lim) {
IRIns *ir = IR(ref);
if (ir->op2 >= IRCALL_lj_strfmt_putint && ir->op2 < IRCALL_lj_buf_tostr)
return 0; /* Conflict. */
ref = ir->prev;
}
ref = J->chain[IR_CALLL];
while (ref > lim) {
IRIns *ir = IR(ref);
if (ir->op2 >= IRCALL_lj_strfmt_putint && ir->op2 < IRCALL_lj_buf_tostr)
return 0; /* Conflict. */
ref = ir->prev;
}
return 1; /* No conflict. Can safely FOLD/CSE. */
}
/* -- XLOAD forwarding and XSTORE elimination ----------------------------- */
/* Find cdata allocation for a reference (if any). */