ref: b350574a9345bc0f4bdd603c336457d2268060f6
parent: 7793ebdf61e4082843444877b6b62411537cb243
author: Ori Bernstein <[email protected]>
date: Tue Feb 5 10:34:08 EST 2013
Remove nop moves.
--- a/6/ra.c
+++ b/6/ra.c
@@ -1010,6 +1010,11 @@
new = NULL;
nnew = 0;
for (j = 0; j < bb->ni; j++) {
+ insn = bb->il[j];
+ if (ismove(insn)) {
+ if (getalias(s, insn->args[0]->reg.id) == getalias(s, insn->args[1]->reg.id))
+ continue;
+ }
/* if there is a remapping, insert the loads and stores as needed */
if (remap(s, bb->il[j], use, &nuse, def, &ndef)) {
for (i = 0; i < nuse; i++) {
@@ -1318,11 +1323,3 @@
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");
-}