Always walk IR constants in ascending order.

Prerequisite for embedding 64 bit constants directly in the IR.
Contributed by Peter Cawley.
This commit is contained in:
Mike Pall
2016-05-22 23:45:40 +02:00
parent 3152ed98ea
commit a4067978b6
2 changed files with 7 additions and 3 deletions

View File

@@ -166,8 +166,8 @@ static void sink_remark_phi(jit_State *J)
/* Sweep instructions and tag sunken allocations and stores. */
static void sink_sweep_ins(jit_State *J)
{
IRIns *ir, *irfirst = IR(J->cur.nk);
for (ir = IR(J->cur.nins-1) ; ir >= irfirst; ir--) {
IRIns *ir, *irbase = IR(REF_BASE);
for (ir = IR(J->cur.nins-1) ; ir >= irbase; ir--) {
switch (ir->o) {
case IR_ASTORE: case IR_HSTORE: case IR_FSTORE: case IR_XSTORE: {
IRIns *ira = sink_checkalloc(J, ir);
@@ -217,6 +217,10 @@ static void sink_sweep_ins(jit_State *J)
break;
}
}
for (ir = IR(J->cur.nk); ir < irbase; ir++) {
irt_clearmark(ir->t);
ir->prev = REGSP_INIT;
}
}
/* Allocation sinking and store sinking.