diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-08-16 17:43:35 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:31 -0400 |
commit | c62b1754424046fea6abe3413f736a9483fa22a7 (patch) | |
tree | 7b9e11561c6fe98762f9df9e738b8041d7a8ee4f /lisc/rega.c | |
parent | 0d5b5cefcba8e4ce7e3917628d367331968e7725 (diff) | |
download | roux-c62b1754424046fea6abe3413f736a9483fa22a7.tar.gz |
fix two heuristics in rega
There was a typo that made always the same successor to be selected for register allocation hinting. Also, I now attempt to prioritize hints over succeccor's choices as it appears to give slightly better results... Now that I think about it, the code re-using the most frequent successor block's assignment might be dead because all registers have hints if they got assigned once. To investigate.
Diffstat (limited to 'lisc/rega.c')
-rw-r--r-- | lisc/rega.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisc/rega.c b/lisc/rega.c index dc01ce0..53807d4 100644 --- a/lisc/rega.c +++ b/lisc/rega.c @@ -311,13 +311,14 @@ rega(Fn *fn) if (b->s1 && b1->loop <= b->s1->loop) b1 = b->s1; if (b->s2 && b1->loop <= b->s2->loop) - b1 = b->s1; + b1 = b->s2; /* try to reuse the register * assignment of the most frequent * successor */ if (b1 != b) for (t=Tmp0; t<fn->ntmp; t++) + if (tmp[t].hint == -1) if (BGET(b->out, t)) if ((r = rfind(&beg[b1->id], t)) != -1) radd(&cur, t, r); |