Browse Source

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().
Michael Forney 3 years ago
parent
commit
2cba9f6871
1 changed files with 1 additions and 4 deletions
  1. 1 4
      cfg.c

+ 1 - 4
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;
 		}