summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--6/isel.c4
-rw-r--r--6/ra.c27
2 files changed, 20 insertions, 11 deletions
diff --git a/6/isel.c b/6/isel.c
index 0833e16..78a3568 100644
--- a/6/isel.c
+++ b/6/isel.c
@@ -699,8 +699,8 @@ void iprintf(FILE *fd, Insn *insn)
if (insn->args[0]->mode != insn->args[1]->mode)
insn->args[0] = coreg(insn->args[0]->reg.colour, insn->args[1]->mode);
/* moving a reg to itself is dumb. */
- if (insn->args[0]->reg.colour == insn->args[1]->reg.colour)
- return;
+ // if (insn->args[0]->reg.colour == insn->args[1]->reg.colour)
+ // return;
break;
default:
break;
diff --git a/6/ra.c b/6/ra.c
index 71c5b77..b6a917d 100644
--- a/6/ra.c
+++ b/6/ra.c
@@ -636,13 +636,13 @@ static int conservative(Isel *s, regid u, regid v)
/* FIXME: is this actually correct? */
static int ok(Isel *s, regid t, regid r)
{
- if (s->degree[t] >= K)
- return 0;
- if (!bshas(s->prepainted, t))
- return 0;
- if (!gbhasedge(s, t, r))
- return 0;
- return 1;
+ if (s->degree[t] < K)
+ return 1;
+ if (bshas(s->prepainted, t))
+ return 1;
+ if (gbhasedge(s, t, r))
+ return 1;
+ return 0;
}
static int combinable(Isel *s, regid u, regid v)
@@ -674,7 +674,7 @@ static void combine(Isel *s, regid u, regid v)
size_t i, j;
int has;
- if (debugopt['r'] || 1)
+ if (debugopt['r'])
printedge(stdout, "combining:", u, v);
if (wlhas(s->wlfreeze, s->nwlfreeze, v, &idx))
ldel(&s->wlfreeze, &s->nwlfreeze, idx);
@@ -698,7 +698,7 @@ static void combine(Isel *s, regid u, regid v)
}
for (t = 0; adjiter(s, v, &t); t++) {
- if (debugopt['r'] || 1)
+ if (debugopt['r'])
printedge(stdout, "combine-putedge:", v, t);
addedge(s, t, u);
decdegree(s, t);
@@ -1317,3 +1317,12 @@ void edges(Isel *s, regid u)
}
printf("\n");
}
+
+void whichwl(Isel *s, regid r)
+{
+ size_t o;
+ if (wlhas(s->wlspill, s->nwlspill, r, &o)) printf("on spill\n");
+ if (wlhas(s->wlsimp, s->nwlsimp, r, &o)) printf("on simp\n");
+ if (wlhas(s->wlfreeze, s->nwlfreeze, r, &o)) printf("on freeze\n");
+ if (wlhas(s->selstk, s->nselstk, r, &o)) printf("on selstk\n");
+}