Skip to content

Commit d6462cc

Browse files
committed
Improve code readability
1 parent fe7835b commit d6462cc

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/ssa.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,12 @@ void build_r_idom(void)
298298
pred = bb->then_;
299299
}
300300

301-
if (bb->next && bb->next != pred && bb->next->r_idom) {
301+
if (bb->next && bb->next != pred && bb->next->r_idom)
302302
pred = reverse_intersect(bb->next, pred);
303-
}
304-
if (bb->else_ && bb->else_ != pred && bb->else_->r_idom) {
303+
if (bb->else_ && bb->else_ != pred && bb->else_->r_idom)
305304
pred = reverse_intersect(bb->else_, pred);
306-
}
307-
if (bb->then_ && bb->then_ != pred && bb->then_->r_idom) {
305+
if (bb->then_ && bb->then_ != pred && bb->then_->r_idom)
308306
pred = reverse_intersect(bb->then_, pred);
309-
}
310307
if (bb->r_idom != pred) {
311308
bb->r_idom = pred;
312309
changed = true;
@@ -320,6 +317,7 @@ bool rdom_connect(basic_block_t *pred, basic_block_t *succ)
320317
{
321318
if (succ->rdom_prev)
322319
return false;
320+
323321
int i;
324322
for (i = 0; i < MAX_BB_RDOM_SUCC; i++) {
325323
if (pred->rdom_next[i] == succ)
@@ -649,11 +647,12 @@ void solve_phi_insertion(void)
649647
if (var->is_ternary_ret || var->is_logical_ret)
650648
continue;
651649

652-
for (int l = 0; l < work_list_idx; l++)
650+
for (int l = 0; l < work_list_idx; l++) {
653651
if (work_list[l] == df) {
654652
found = true;
655653
break;
656654
}
655+
}
657656
if (!found)
658657
work_list[work_list_idx++] = df;
659658
}
@@ -1494,8 +1493,7 @@ void dce_sweep(void)
14941493
for (insn_t *insn = bb->insn_list.head; insn; insn = insn->next) {
14951494
if (insn->useful)
14961495
continue;
1497-
/*
1498-
* If a branch instruction is useless, redirect to the
1496+
/* If a branch instruction is useless, redirect to the
14991497
* reverse immediate dominator of this basic block and
15001498
* remove the branch instruction. Later, register allocation
15011499
* will insert a jump instruction.
@@ -1512,6 +1510,7 @@ void dce_sweep(void)
15121510
jump_bb = jump_bb->r_idom;
15131511
}
15141512
}
1513+
15151514
/* remove useless instructions */
15161515
if (insn->next)
15171516
insn->next->prev = insn->prev;

0 commit comments

Comments
 (0)