qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 2cba9f6871fe92e06d5e6433f8e15d2712fa9d52
parent 3b75357e2bd14d6222bd9e3fb8b6894239ff2ae3
Author: Michael Forney <mforney@mforney.org>
Date:   Sat, 12 Feb 2022 02:27:48 -0800

cfg: remove unnecessary check for jump type

This condition should match any jump with two successors. This is
needed on riscv64, where there is no flags register, so Jjnz is
used all the way to emit().

Diffstat:
Mcfg.c | 5+----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/cfg.c b/cfg.c @@ -298,7 +298,6 @@ simpljmp(Fn *fn) Blk **uf; /* union-find */ Blk **p, *b, *ret; - int c; ret = blknew(); ret->id = fn->nblk++; @@ -322,9 +321,7 @@ simpljmp(Fn *fn) uffind(&b->s1, uf); if (b->s2) uffind(&b->s2, uf); - c = b->jmp.type - Jjf; - if (0 <= c && c <= NCmp) - if (b->s1 == b->s2) { + if (b->s1 && b->s1 == b->s2) { b->jmp.type = Jjmp; b->s2 = 0; }