@@ -298,15 +298,12 @@ void build_r_idom(void)
298
298
pred = bb -> then_ ;
299
299
}
300
300
301
- if (bb -> next && bb -> next != pred && bb -> next -> r_idom ) {
301
+ if (bb -> next && bb -> next != pred && bb -> next -> r_idom )
302
302
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 )
305
304
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 )
308
306
pred = reverse_intersect (bb -> then_ , pred );
309
- }
310
307
if (bb -> r_idom != pred ) {
311
308
bb -> r_idom = pred ;
312
309
changed = true;
@@ -320,6 +317,7 @@ bool rdom_connect(basic_block_t *pred, basic_block_t *succ)
320
317
{
321
318
if (succ -> rdom_prev )
322
319
return false;
320
+
323
321
int i ;
324
322
for (i = 0 ; i < MAX_BB_RDOM_SUCC ; i ++ ) {
325
323
if (pred -> rdom_next [i ] == succ )
@@ -649,11 +647,12 @@ void solve_phi_insertion(void)
649
647
if (var -> is_ternary_ret || var -> is_logical_ret )
650
648
continue ;
651
649
652
- for (int l = 0 ; l < work_list_idx ; l ++ )
650
+ for (int l = 0 ; l < work_list_idx ; l ++ ) {
653
651
if (work_list [l ] == df ) {
654
652
found = true;
655
653
break ;
656
654
}
655
+ }
657
656
if (!found )
658
657
work_list [work_list_idx ++ ] = df ;
659
658
}
@@ -1489,8 +1488,7 @@ void dce_sweep(void)
1489
1488
for (insn_t * insn = bb -> insn_list .head ; insn ; insn = insn -> next ) {
1490
1489
if (insn -> useful )
1491
1490
continue ;
1492
- /*
1493
- * If a branch instruction is useless, redirect to the
1491
+ /* If a branch instruction is useless, redirect to the
1494
1492
* reverse immediate dominator of this basic block and
1495
1493
* remove the branch instruction. Later, register allocation
1496
1494
* will insert a jump instruction.
@@ -1507,6 +1505,7 @@ void dce_sweep(void)
1507
1505
jump_bb = jump_bb -> r_idom ;
1508
1506
}
1509
1507
}
1508
+
1510
1509
/* remove useless instructions */
1511
1510
if (insn -> next )
1512
1511
insn -> next -> prev = insn -> prev ;
0 commit comments