summaryrefslogtreecommitdiff
path: root/src/lj_opt_dce.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_opt_dce.c')
-rw-r--r--src/lj_opt_dce.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lj_opt_dce.c b/src/lj_opt_dce.c
index 253fe3d2..0587262d 100644
--- a/src/lj_opt_dce.c
+++ b/src/lj_opt_dce.c
@@ -47,17 +47,15 @@ static void dce_propagate(jit_State *J)
47 pchain[ir->o] = &ir->prev; 47 pchain[ir->o] = &ir->prev;
48 } else if (!ir_sideeff(ir)) { 48 } else if (!ir_sideeff(ir)) {
49 *pchain[ir->o] = ir->prev; /* Reroute original instruction chain. */ 49 *pchain[ir->o] = ir->prev; /* Reroute original instruction chain. */
50 *pchain[IR_NOP] = (IRRef1)ins;
51 ir->t.irt = IRT_NIL; 50 ir->t.irt = IRT_NIL;
52 ir->o = IR_NOP; /* Replace instruction with NOP. */ 51 ir->o = IR_NOP; /* Replace instruction with NOP. */
53 ir->op1 = ir->op2 = 0; 52 ir->op1 = ir->op2 = 0;
54 pchain[IR_NOP] = &ir->prev; 53 ir->prev = 0;
55 continue; 54 continue;
56 } 55 }
57 if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t); 56 if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t);
58 if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t); 57 if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t);
59 } 58 }
60 *pchain[IR_NOP] = 0; /* Terminate NOP chain. */
61} 59}
62 60
63/* Dead Code Elimination. 61/* Dead Code Elimination.