summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <orib@google.com>2013-02-05 15:34:08 -0500
committerOri Bernstein <orib@google.com>2013-02-05 15:34:08 -0500
commitb350574a9345bc0f4bdd603c336457d2268060f6 (patch)
tree14bb00f6daff443f14ef4e3c44b46d55d22e9755
parent7793ebdf61e4082843444877b6b62411537cb243 (diff)
downloadmc-b350574a9345bc0f4bdd603c336457d2268060f6.tar.gz
Remove nop moves.
-rw-r--r--6/ra.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/6/ra.c b/6/ra.c
index b6a917d..e377d3b 100644
--- a/6/ra.c
+++ b/6/ra.c
@@ -1010,6 +1010,11 @@ static void rewritebb(Isel *s, Asmbb *bb)
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 @@ 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");
-}