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

@@ -773,7 +773,7 @@ static void asm_newref(ASMState *as, IRIns *ir)
{
const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_tab_newkey];
IRRef args[3];
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 */
@@ -894,9 +894,7 @@ static void asm_fload(ASMState *as, IRIns *ir)
static void asm_fstore(ASMState *as, IRIns *ir)
{
if (ir->r == RID_SINK) { /* Sink store. */
asm_snap_prep(as);
} else {
if (ir->r != RID_SINK) {
Reg src = ra_alloc1(as, ir->op2, RSET_GPR);
IRIns *irf = IR(ir->op1);
Reg idx = ra_alloc1(as, irf->op1, rset_exclude(RSET_GPR, src));
@@ -918,10 +916,8 @@ static void asm_xload(ASMState *as, IRIns *ir)
static void asm_xstore(ASMState *as, IRIns *ir, int32_t ofs)
{
IRIns *irb;
if (ir->r == RID_SINK) { /* Sink store. */
asm_snap_prep(as);
if (ir->r == RID_SINK)
return;
}
if (ofs == 0 && mayfuse(as, ir->op2) && (irb = IR(ir->op2))->o == IR_BSWAP &&
ra_noreg(irb->r) && (irt_isint(ir->t) || irt_isu32(ir->t))) {
/* Fuse BSWAP with XSTORE to stwbrx. */
@@ -978,10 +974,8 @@ static void asm_ahustore(ASMState *as, IRIns *ir)
RegSet allow = RSET_GPR;
Reg idx, src = RID_NONE, type = RID_NONE;
int32_t ofs = AHUREF_LSX;
if (ir->r == RID_SINK) { /* Sink store. */
asm_snap_prep(as);
if (ir->r == RID_SINK)
return;
}
if (irt_isnum(ir->t)) {
src = ra_alloc1(as, ir->op2, RSET_FPR);
} else {
@@ -1761,9 +1755,7 @@ static void asm_hiop(ASMState *as, IRIns *ir)
return;
} else if ((ir-1)->o == IR_XSTORE) {
as->curins--; /* Handle both stores here. */
if ((ir-1)->r == RID_SINK) {
asm_snap_prep(as);
} else {
if ((ir-1)->r != RID_SINK) {
asm_xstore(as, ir, 0);
asm_xstore(as, ir-1, 4);
}