diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-02-21 21:22:05 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-02-21 21:22:05 -0500 |
commit | 4be29d40305917d3c4bdb9e9c795ea68e415c748 (patch) | |
tree | bbc143df4ccaa69f9e9108fad61a21a12f6b74d8 /lisc | |
parent | 804194767298594ae32663e5ff08b2375e1f5fb3 (diff) | |
download | roux-4be29d40305917d3c4bdb9e9c795ea68e415c748.tar.gz |
do not spill dead phis
Regalloc will be able to handle these spurious phis, however, some other spurious dead instructions can be emitted. It would be better to get rid of them upfront; maybe by modifying isel, or by inserting a proper dce pass. An example of that undesirable behavior is exposed below. @l1 %foo =w ... @l2 %dead =w phi @l1 %foo, ...
Diffstat (limited to 'lisc')
-rw-r--r-- | lisc/spill.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisc/spill.c b/lisc/spill.c index 06c748d..5875fc0 100644 --- a/lisc/spill.c +++ b/lisc/spill.c @@ -492,7 +492,8 @@ spill(Fn *fn) if (BGET(v, t)) { BCLR(v, t); store(p->to, tmp[t].slot); - } else + } else if (BGET(b->in, t)) + /* only if the phi is live */ p->to = slot(p->to.val); } b->in = v; |