Permalink
Browse files

merge dynop_mapping branch

git-svn-id: https://svn.parrot.org/parrot/trunk@48412 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent bd2f553 commit 15e99572cbb6eb3baad027d2dd1975f300636478 @plobsing plobsing committed Aug 11, 2010
View
@@ -463,7 +463,7 @@ bb_findadd_edge(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(Basic_block *from),
if (r && (r->type & VTADDRESS) && r->first_ins)
bb_add_edge(interp, unit, from, unit->bb_list[r->first_ins->bbindex]);
else {
- IMCC_debug(interp, DEBUG_CFG, "register branch %I ", from->end);
+ IMCC_debug(interp, DEBUG_CFG, "register branch %d ", from->end);
for (ins = from->end; ins; ins = ins->prev) {
if ((ins->type & ITBRANCH)
&& STREQ(ins->opname, "set_addr")
View
@@ -97,6 +97,7 @@ imc_compile_all_units(PARROT_INTERP)
}
IMCC_INFO(interp)->imc_units = NULL;
+ IMCC_INFO(interp)->cur_unit = NULL;
IMCC_INFO(interp)->last_unit = NULL;
}
@@ -826,7 +826,7 @@ emit_flush(PARROT_INTERP, ARGIN_NULLOK(void *param), ARGIN(IMC_Unit *unit))
(emitters[emitter]).new_sub(interp, param, unit);
for (ins = unit->instructions; ins; ins = ins->next) {
- IMCC_debug(interp, DEBUG_IMC, "emit %I\n", ins);
+ IMCC_debug(interp, DEBUG_IMC, "emit %d\n", ins);
(emitters[emitter]).emit(interp, param, unit, ins);
}
View
@@ -461,12 +461,12 @@ strength_reduce(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
ins->opnum == PARROT_OP_mul_n_nc_n) &&
(ins->symregs[0] == ins->symregs[1] ||
ins->symregs[0] == ins->symregs[2]))) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
if (ins->symregs[0] == ins->symregs[1]) {
ins->symregs[1] = ins->symregs[2];
}
tmp = INS(interp, unit, ins->opname, "", ins->symregs, 2, 0, 0);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
subst_ins(unit, ins, tmp, 1);
ins = tmp;
changes = 1;
@@ -497,7 +497,7 @@ strength_reduce(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
ins->opnum == PARROT_OP_div_n_nc ||
ins->opnum == PARROT_OP_fdiv_n_nc) &&
atof(ins->symregs[1]->name) == 1.0)) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
ins = delete_ins(unit, ins);
if (ins)
ins = ins->prev ? ins->prev : unit->instructions;
@@ -519,15 +519,15 @@ strength_reduce(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
|| ((ins->opnum == PARROT_OP_add_n_nc ||
ins->opnum == PARROT_OP_sub_n_nc) &&
atof(ins->symregs[1]->name) == 1.0)) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
--ins->symregs[1]->use_count;
if (ins->opnum == PARROT_OP_add_i_ic ||
ins->opnum == PARROT_OP_add_n_nc)
tmp = INS(interp, unit, "inc", "", ins->symregs, 1, 0, 0);
else
tmp = INS(interp, unit, "dec", "", ins->symregs, 1, 0, 0);
subst_ins(unit, ins, tmp, 1);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
ins = tmp;
changes = 1;
continue;
@@ -570,7 +570,7 @@ strength_reduce(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
atof(ins->symregs[2]->name) == 1.0)
|| (ins->opnum == PARROT_OP_mul_n_nc_n &&
atof(ins->symregs[1]->name) == 1.0)) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
if (ins->symregs[1]->type == VTCONST) {
--ins->symregs[1]->use_count;
ins->symregs[1] = ins->symregs[2];
@@ -579,7 +579,7 @@ strength_reduce(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
--ins->symregs[2]->use_count;
}
tmp = INS(interp, unit, "set", "", ins->symregs, 2, 0, 0);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
subst_ins(unit, ins, tmp, 1);
ins = tmp;
changes = 1;
@@ -600,14 +600,14 @@ strength_reduce(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
|| ((ins->opnum == PARROT_OP_mul_n_nc_n ||
ins->opnum == PARROT_OP_mul_n_nc) &&
(f = atof(ins->symregs[1]->name), FLOAT_IS_ZERO(f)))) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
r = mk_const(interp, "0", ins->symregs[0]->set);
--ins->symregs[1]->use_count;
if (ins->opsize == 4)
--ins->symregs[2]->use_count;
ins->symregs[1] = r;
tmp = INS(interp, unit, "set", "", ins->symregs, 2, 0, 0);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
subst_ins(unit, ins, tmp, 1);
ins = tmp;
changes = 1;
@@ -621,11 +621,11 @@ strength_reduce(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
|| (ins->opnum == PARROT_OP_set_n_nc &&
(f = atof(ins->symregs[1]->name), FLOAT_IS_ZERO(f)) &&
ins->symregs[1]->name[0] != '-')) {
- IMCC_debug(interp, DEBUG_OPT1, "opt1 %I => ", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "opt1 %d => ", ins);
--ins->symregs[1]->use_count;
tmp = INS(interp, unit, "null", "", ins->symregs, 1, 0, 0);
subst_ins(unit, ins, tmp, 1);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
ins = tmp;
changes = 1;
continue;
@@ -677,7 +677,7 @@ constant_propagation(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
Instruction *ins2;
IMCC_debug(interp, DEBUG_OPT2,
- "propagating constant %I => \n", ins);
+ "propagating constant %d => \n", ins);
for (ins2 = ins->next; ins2; ins2 = ins2->next) {
int i;
if (ins2->bbindex != ins->bbindex)
@@ -694,7 +694,7 @@ constant_propagation(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
SymReg *old;
IMCC_debug(interp, DEBUG_OPT2,
- "\tpropagating into %I register %i",
+ "\tpropagating into %d register %i",
ins2, i);
old = ins2->symregs[i];
ins2->symregs[i] = c;
@@ -708,7 +708,7 @@ constant_propagation(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
subst_ins(unit, ins2, tmp, 1);
any = 1;
IMCC_debug(interp, DEBUG_OPT2,
- " reduced to %I\n", tmp);
+ " reduced to %d\n", tmp);
ins2 = prev->next;
}
}
@@ -726,7 +726,7 @@ constant_propagation(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
ins2->opnum = op;
any = 1;
IMCC_debug(interp, DEBUG_OPT2,
- " -> %I\n", ins2);
+ " -> %d\n", ins2);
}
}
}
@@ -777,7 +777,7 @@ IMCC_subst_constants_umix(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(const cha
strcpy(b, r[1]->name);
r[1] = mk_const(interp, b, 'N');
tmp = INS(interp, unit, name, "", r, 2, 0, 0);
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
}
}
return tmp;
@@ -1067,7 +1067,7 @@ IMCC_subst_constants(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(const char *na
tmp = INS(interp, unit, "set", "", r, 2, 0, 0);
}
if (tmp) {
- IMCC_debug(interp, DEBUG_OPT1, "%I\n", tmp);
+ IMCC_debug(interp, DEBUG_OPT1, "%d\n", tmp);
}
*ok = 1;
return tmp;
@@ -1116,7 +1116,7 @@ branch_branch(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
!STREQ(next->symregs[0]->name, get_branch_reg(ins)->name)) {
const int regno = get_branch_regno(ins);
IMCC_debug(interp, DEBUG_OPT1,
- "found branch to branch '%s' %I\n",
+ "found branch to branch '%s' %d\n",
r->first_ins->symregs[0]->name, next);
unit->ostat.branch_branch++;
if (regno < 0)
@@ -1209,7 +1209,7 @@ branch_reorg(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
start->prev = ins;
IMCC_debug(interp, DEBUG_OPT1,
- "found branch to reorganize '%s' %I\n",
+ "found branch to reorganize '%s' %d\n",
r->first_ins->symregs[0]->name, ins);
/* unconditional jump can be eliminated */
@@ -1507,7 +1507,7 @@ dead_code_remove(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
for (ins = bb->start; ins && ins->bbindex == bbi;) {
IMCC_debug(interp, DEBUG_OPT1,
- "\tins deleted (dead block) %I\n", ins);
+ "\tins deleted (dead block) %d\n", ins);
ins = delete_ins(unit, ins);
unit->ostat.deleted_ins++;
changed++;
@@ -1525,7 +1525,7 @@ dead_code_remove(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
if ((last->type & IF_goto) && !(ins->type & ITLABEL) &&
STREQ(last->opname, "branch")) {
IMCC_debug(interp, DEBUG_OPT1,
- "unreachable ins deleted (after branch) %I\n", ins);
+ "unreachable ins deleted (after branch) %d\n", ins);
ins = delete_ins(unit, ins);
unit->ostat.deleted_ins++;
changed++;
@@ -1538,7 +1538,7 @@ dead_code_remove(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
if (ins && last && (last->type & IF_goto) && (ins->type & ITLABEL) &&
STREQ(last->opname, "branch") &&
STREQ(last->symregs[0]->name, ins->symregs[0]->name)) {
- IMCC_debug(interp, DEBUG_OPT1, "dead branch deleted %I\n", ins);
+ IMCC_debug(interp, DEBUG_OPT1, "dead branch deleted %d\n", ins);
ins = delete_ins(unit, last);
unit->ostat.deleted_ins++;
changed++;
@@ -1572,7 +1572,7 @@ used_once(PARROT_INTERP, ARGMOD(IMC_Unit *unit))
if (ins->symregs) {
SymReg * const r = ins->symregs[0];
if (r && (r->use_count == 1 && r->lhs_use_count == 1)) {
- IMCC_debug(interp, DEBUG_OPT2, "used once '%I' deleted\n", ins);
+ IMCC_debug(interp, DEBUG_OPT2, "used once '%d' deleted\n", ins);
ins = delete_ins(unit, ins);
/* find previous instruction or first instruction of this CU
Oops, something went wrong.

0 comments on commit 15e9957

Please sign in to comment.