@@ -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
}
@@ -1494,8 +1493,7 @@ void dce_sweep(void)
1494
1493
for (insn_t * insn = bb -> insn_list .head ; insn ; insn = insn -> next ) {
1495
1494
if (insn -> useful )
1496
1495
continue ;
1497
- /*
1498
- * If a branch instruction is useless, redirect to the
1496
+ /* If a branch instruction is useless, redirect to the
1499
1497
* reverse immediate dominator of this basic block and
1500
1498
* remove the branch instruction. Later, register allocation
1501
1499
* will insert a jump instruction.
@@ -1512,6 +1510,7 @@ void dce_sweep(void)
1512
1510
jump_bb = jump_bb -> r_idom ;
1513
1511
}
1514
1512
}
1513
+
1515
1514
/* remove useless instructions */
1516
1515
if (insn -> next )
1517
1516
insn -> next -> prev = insn -> prev ;
0 commit comments