mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Don't bother to chain NOPs.
This commit is contained in:
parent
e8fa76feac
commit
05ef03e2d0
@ -47,17 +47,15 @@ static void dce_propagate(jit_State *J)
|
|||||||
pchain[ir->o] = &ir->prev;
|
pchain[ir->o] = &ir->prev;
|
||||||
} else if (!ir_sideeff(ir)) {
|
} else if (!ir_sideeff(ir)) {
|
||||||
*pchain[ir->o] = ir->prev; /* Reroute original instruction chain. */
|
*pchain[ir->o] = ir->prev; /* Reroute original instruction chain. */
|
||||||
*pchain[IR_NOP] = (IRRef1)ins;
|
|
||||||
ir->t.irt = IRT_NIL;
|
ir->t.irt = IRT_NIL;
|
||||||
ir->o = IR_NOP; /* Replace instruction with NOP. */
|
ir->o = IR_NOP; /* Replace instruction with NOP. */
|
||||||
ir->op1 = ir->op2 = 0;
|
ir->op1 = ir->op2 = 0;
|
||||||
pchain[IR_NOP] = &ir->prev;
|
ir->prev = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t);
|
if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t);
|
||||||
if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t);
|
if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t);
|
||||||
}
|
}
|
||||||
*pchain[IR_NOP] = 0; /* Terminate NOP chain. */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dead Code Elimination.
|
/* Dead Code Elimination.
|
||||||
|
@ -323,7 +323,7 @@ TRef LJ_FASTCALL lj_opt_dse_ahstore(jit_State *J)
|
|||||||
goto doemit; /* No elimination possible. */
|
goto doemit; /* No elimination possible. */
|
||||||
/* Remove redundant store from chain and replace with NOP. */
|
/* Remove redundant store from chain and replace with NOP. */
|
||||||
*refp = store->prev;
|
*refp = store->prev;
|
||||||
store->o = IR_NOP; /* Unchained NOP -- does anybody care? */
|
store->o = IR_NOP;
|
||||||
store->t.irt = IRT_NIL;
|
store->t.irt = IRT_NIL;
|
||||||
store->op1 = store->op2 = 0;
|
store->op1 = store->op2 = 0;
|
||||||
store->prev = 0;
|
store->prev = 0;
|
||||||
@ -418,7 +418,7 @@ TRef LJ_FASTCALL lj_opt_dse_ustore(jit_State *J)
|
|||||||
goto doemit; /* No elimination possible. */
|
goto doemit; /* No elimination possible. */
|
||||||
/* Remove redundant store from chain and replace with NOP. */
|
/* Remove redundant store from chain and replace with NOP. */
|
||||||
*refp = store->prev;
|
*refp = store->prev;
|
||||||
store->o = IR_NOP; /* Unchained NOP -- does anybody care? */
|
store->o = IR_NOP;
|
||||||
store->t.irt = IRT_NIL;
|
store->t.irt = IRT_NIL;
|
||||||
store->op1 = store->op2 = 0;
|
store->op1 = store->op2 = 0;
|
||||||
store->prev = 0;
|
store->prev = 0;
|
||||||
@ -511,7 +511,7 @@ TRef LJ_FASTCALL lj_opt_dse_fstore(jit_State *J)
|
|||||||
goto doemit; /* No elimination possible. */
|
goto doemit; /* No elimination possible. */
|
||||||
/* Remove redundant store from chain and replace with NOP. */
|
/* Remove redundant store from chain and replace with NOP. */
|
||||||
*refp = store->prev;
|
*refp = store->prev;
|
||||||
store->o = IR_NOP; /* Unchained NOP -- does anybody care? */
|
store->o = IR_NOP;
|
||||||
store->t.irt = IRT_NIL;
|
store->t.irt = IRT_NIL;
|
||||||
store->op1 = store->op2 = 0;
|
store->op1 = store->op2 = 0;
|
||||||
store->prev = 0;
|
store->prev = 0;
|
||||||
@ -761,7 +761,7 @@ TRef LJ_FASTCALL lj_opt_dse_xstore(jit_State *J)
|
|||||||
goto doemit; /* No elimination possible. */
|
goto doemit; /* No elimination possible. */
|
||||||
/* Remove redundant store from chain and replace with NOP. */
|
/* Remove redundant store from chain and replace with NOP. */
|
||||||
*refp = store->prev;
|
*refp = store->prev;
|
||||||
store->o = IR_NOP; /* Unchained NOP -- does anybody care? */
|
store->o = IR_NOP;
|
||||||
store->t.irt = IRT_NIL;
|
store->t.irt = IRT_NIL;
|
||||||
store->op1 = store->op2 = 0;
|
store->op1 = store->op2 = 0;
|
||||||
store->prev = 0;
|
store->prev = 0;
|
||||||
|
@ -67,7 +67,7 @@ static void rec_check_ir(jit_State *J)
|
|||||||
if (ir->prev) {
|
if (ir->prev) {
|
||||||
lua_assert(ir->prev >= nk);
|
lua_assert(ir->prev >= nk);
|
||||||
lua_assert(i >= REF_BIAS ? ir->prev < i : ir->prev > i);
|
lua_assert(i >= REF_BIAS ? ir->prev < i : ir->prev > i);
|
||||||
lua_assert(IR(ir->prev)->o == ir->o);
|
lua_assert(ir->o == IR_NOP || IR(ir->prev)->o == ir->o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user