commit 4be29d40305917d3c4bdb9e9c795ea68e415c748
parent 804194767298594ae32663e5ff08b2375e1f5fb3
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Sun, 21 Feb 2016 21:22:05 -0500
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:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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;