Remove unneeded snapshot preps for sunk stores.

This commit is contained in:
Mike Pall
2012-07-03 23:19:45 +02:00
parent d5b9d84538
commit 4da7ffc34b
4 changed files with 19 additions and 53 deletions

View File

@@ -1155,7 +1155,7 @@ static void asm_newref(ASMState *as, IRIns *ir)
IRRef args[3];
IRIns *irkey;
Reg tmp;
if (ir->r == RID_SINK) /* Sink newref. */
if (ir->r == RID_SINK)
return;
args[0] = ASMREF_L; /* lua_State *L */
args[1] = ir->op1; /* GCtab *t */
@@ -1261,10 +1261,8 @@ static void asm_fxstore(ASMState *as, IRIns *ir)
RegSet allow = RSET_GPR;
Reg src = RID_NONE, osrc = RID_NONE;
int32_t k = 0;
if (ir->r == RID_SINK) { /* Sink store. */
asm_snap_prep(as);
if (ir->r == RID_SINK)
return;
}
/* The IRT_I16/IRT_U16 stores should never be simplified for constant
** values since mov word [mem], imm16 has a length-changing prefix.
*/
@@ -1378,10 +1376,8 @@ static void asm_ahuvload(ASMState *as, IRIns *ir)
static void asm_ahustore(ASMState *as, IRIns *ir)
{
if (ir->r == RID_SINK) { /* Sink store. */
asm_snap_prep(as);
if (ir->r == RID_SINK)
return;
}
if (irt_isnum(ir->t)) {
Reg src = ra_alloc1(as, ir->op2, RSET_FPR);
asm_fuseahuref(as, ir->op1, RSET_GPR);
@@ -2261,9 +2257,7 @@ static void asm_hiop(ASMState *as, IRIns *ir)
asm_comp_int64(as, ir);
return;
} else if ((ir-1)->o == IR_XSTORE) {
if ((ir-1)->r == RID_SINK)
asm_snap_prep(as);
else
if ((ir-1)->r != RID_SINK)
asm_fxstore(as, ir);
return;
}