summaryrefslogtreecommitdiff
path: root/src/lj_opt_mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_opt_mem.c')
-rw-r--r--src/lj_opt_mem.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/src/lj_opt_mem.c b/src/lj_opt_mem.c
index 94fc4ad8..882ba6c5 100644
--- a/src/lj_opt_mem.c
+++ b/src/lj_opt_mem.c
@@ -307,14 +307,7 @@ TRef LJ_FASTCALL lj_opt_fwd_uload(jit_State *J)
307 307
308conflict: 308conflict:
309 /* Try to find a matching load. Below the conflicting store, if any. */ 309 /* Try to find a matching load. Below the conflicting store, if any. */
310 ref = J->chain[IR_ULOAD]; 310 return lj_opt_cselim(J, lim);
311 while (ref > lim) {
312 IRIns *load = IR(ref);
313 if (load->op1 == uref)
314 return ref; /* Load forwarding. */
315 ref = load->prev;
316 }
317 return EMITFOLD; /* Conflict or no match. */
318} 311}
319 312
320/* USTORE elimination. */ 313/* USTORE elimination. */
@@ -405,14 +398,7 @@ TRef LJ_FASTCALL lj_opt_fwd_fload(jit_State *J)
405 398
406conflict: 399conflict:
407 /* Try to find a matching load. Below the conflicting store, if any. */ 400 /* Try to find a matching load. Below the conflicting store, if any. */
408 ref = J->chain[IR_FLOAD]; 401 return lj_opt_cselim(J, lim);
409 while (ref > lim) {
410 IRIns *load = IR(ref);
411 if (load->op1 == oref && load->op2 == fid)
412 return ref; /* Load forwarding. */
413 ref = load->prev;
414 }
415 return EMITFOLD; /* Otherwise we have a conflict or simply no match. */
416} 402}
417 403
418/* FSTORE elimination. */ 404/* FSTORE elimination. */
@@ -458,10 +444,10 @@ doemit:
458 return EMITFOLD; /* Otherwise we have a conflict or simply no match. */ 444 return EMITFOLD; /* Otherwise we have a conflict or simply no match. */
459} 445}
460 446
461/* -- TLEN forwarding ----------------------------------------------------- */ 447/* -- Forwarding of lj_tab_len -------------------------------------------- */
462 448
463/* This is rather simplistic right now, but better than nothing. */ 449/* This is rather simplistic right now, but better than nothing. */
464TRef LJ_FASTCALL lj_opt_fwd_tlen(jit_State *J) 450TRef LJ_FASTCALL lj_opt_fwd_tab_len(jit_State *J)
465{ 451{
466 IRRef tab = fins->op1; /* Table reference. */ 452 IRRef tab = fins->op1; /* Table reference. */
467 IRRef lim = tab; /* Search limit. */ 453 IRRef lim = tab; /* Search limit. */
@@ -484,14 +470,7 @@ TRef LJ_FASTCALL lj_opt_fwd_tlen(jit_State *J)
484 } 470 }
485 471
486 /* Try to find a matching load. Below the conflicting store, if any. */ 472 /* Try to find a matching load. Below the conflicting store, if any. */
487 ref = J->chain[IR_TLEN]; 473 return lj_opt_cselim(J, lim);
488 while (ref > lim) {
489 IRIns *tlen = IR(ref);
490 if (tlen->op1 == tab)
491 return ref; /* Load forwarding. */
492 ref = tlen->prev;
493 }
494 return EMITFOLD; /* Otherwise we have a conflict or simply no match. */
495} 474}
496 475
497/* -- ASTORE/HSTORE previous type analysis -------------------------------- */ 476/* -- ASTORE/HSTORE previous type analysis -------------------------------- */