handle dumb conditional jumps in isel

I also removed the code to handle jumps with a
constant argument since those should be eliminated
by the folding pass.
This commit is contained in:
Quentin Carbonneaux 2016-04-12 12:05:26 -04:00
parent 6b1b97c996
commit c416da5a70

6
isel.c
View file

@ -360,11 +360,9 @@ seljmp(Blk *b, Fn *fn)
assert(b->jmp.type == JJnz); assert(b->jmp.type == JJnz);
r = b->jmp.arg; r = b->jmp.arg;
b->jmp.arg = R; b->jmp.arg = R;
assert(!req(r, R)); assert(!req(r, R) && rtype(r) != RCon);
if (rtype(r) == RCon) { if (b->s1 == b->s2) {
b->jmp.type = JJmp; b->jmp.type = JJmp;
if (req(r, CON_Z))
b->s1 = b->s2;
b->s2 = 0; b->s2 = 0;
return; return;
} }