aboutsummaryrefslogtreecommitdiff
path: root/src/lj_opt_mem.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_opt_mem.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lj_opt_mem.c b/src/lj_opt_mem.c
index 4d2e9664..7e364f0b 100644
--- a/src/lj_opt_mem.c
+++ b/src/lj_opt_mem.c
@@ -277,6 +277,20 @@ int LJ_FASTCALL lj_opt_fwd_href_nokey(jit_State *J)
277 return 1; /* No conflict. Can fold to niltv. */ 277 return 1; /* No conflict. Can fold to niltv. */
278} 278}
279 279
280/* Check whether there's no aliasing NEWREF for the left operand. */
281int LJ_FASTCALL lj_opt_fwd_tptr(jit_State *J, IRRef lim)
282{
283 IRRef ta = fins->op1;
284 IRRef ref = J->chain[IR_NEWREF];
285 while (ref > lim) {
286 IRIns *newref = IR(ref);
287 if (ta == newref->op1 || aa_table(J, ta, newref->op1) != ALIAS_NO)
288 return 0; /* Conflict. */
289 ref = newref->prev;
290 }
291 return 1; /* No conflict. Can safely FOLD/CSE. */
292}
293
280/* ASTORE/HSTORE elimination. */ 294/* ASTORE/HSTORE elimination. */
281TRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J) 295TRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J)
282{ 296{