2 * Flow - walk the linearized flowgraph, simplifying it as we
5 * Copyright (C) 2004 Linus Torvalds
16 #include "expression.h"
17 #include "linearize.h"
21 unsigned long bb_generation
;
24 * Dammit, if we have a phi-node followed by a conditional
25 * branch on that phi-node, we should damn well be able to
26 * do something about the source. Maybe.
28 static int rewrite_branch(struct basic_block
*bb
,
29 struct basic_block
**ptr
,
30 struct basic_block
*old
,
31 struct basic_block
*new)
33 if (*ptr
!= old
|| new == old
)
36 /* We might find new if-conversions or non-dominating CSEs */
37 repeat_phase
|= REPEAT_CSE
;
39 replace_bb_in_list(&bb
->children
, old
, new, 1);
40 remove_bb_from_list(&old
->parents
, bb
, 1);
41 add_bb(&new->parents
, bb
);
46 * Return the known truth value of a pseudo, or -1 if
49 static int pseudo_truth_value(pseudo_t pseudo
)
51 switch (pseudo
->type
) {
53 return !!pseudo
->value
;
56 struct instruction
*insn
= pseudo
->def
;
58 /* A symbol address is always considered true.. */
59 if (insn
->opcode
== OP_SYMADDR
&& insn
->target
== pseudo
)
69 * Does a basic block depend on the pseudos that "src" defines?
71 static int bb_depends_on(struct basic_block
*target
, struct basic_block
*src
)
75 FOR_EACH_PTR(src
->defines
, pseudo
) {
76 if (pseudo_in_list(target
->needs
, pseudo
))
78 } END_FOR_EACH_PTR(pseudo
);
83 * When we reach here, we have:
84 * - a basic block that ends in a conditional branch and
85 * that has no side effects apart from the pseudos it
87 * - the phi-node that the conditional branch depends on
88 * - full pseudo liveness information
90 * We need to check if any of the _sources_ of the phi-node
91 * may be constant, and not actually need this block at all.
93 static int try_to_simplify_bb(struct basic_block
*bb
, struct instruction
*first
, struct instruction
*second
)
98 FOR_EACH_PTR(first
->phi_list
, phi
) {
99 struct instruction
*def
= phi
->def
;
100 struct basic_block
*source
, *target
;
102 struct instruction
*br
;
109 if (!pseudo
|| !source
)
111 br
= last_instruction(source
->insns
);
114 if (br
->opcode
!= OP_BR
)
116 true = pseudo_truth_value(pseudo
);
119 target
= true ? second
->bb_true
: second
->bb_false
;
120 if (bb_depends_on(target
, bb
))
122 changed
|= rewrite_branch(source
, &br
->bb_true
, bb
, target
);
123 changed
|= rewrite_branch(source
, &br
->bb_false
, bb
, target
);
124 } END_FOR_EACH_PTR(phi
);
128 static int bb_has_side_effects(struct basic_block
*bb
)
130 struct instruction
*insn
;
131 FOR_EACH_PTR(bb
->insns
, insn
) {
132 switch (insn
->opcode
) {
134 /* FIXME! This should take "const" etc into account */
142 /* FIXME! This should take "volatile" etc into account */
148 } END_FOR_EACH_PTR(insn
);
152 static int simplify_phi_branch(struct basic_block
*bb
, struct instruction
*br
)
154 pseudo_t cond
= br
->cond
;
155 struct instruction
*def
;
157 if (cond
->type
!= PSEUDO_REG
)
160 if (def
->bb
!= bb
|| def
->opcode
!= OP_PHI
)
162 if (bb_has_side_effects(bb
))
164 return try_to_simplify_bb(bb
, def
, br
);
167 static int simplify_branch_branch(struct basic_block
*bb
, struct instruction
*br
,
168 struct basic_block
**target_p
, int true)
170 struct basic_block
*target
= *target_p
, *final
;
171 struct instruction
*insn
;
176 insn
= last_instruction(target
->insns
);
177 if (!insn
|| insn
->opcode
!= OP_BR
|| insn
->cond
!= br
->cond
)
180 * Ahhah! We've found a branch to a branch on the same conditional!
181 * Now we just need to see if we can rewrite the branch..
184 final
= true ? insn
->bb_true
: insn
->bb_false
;
185 if (bb_has_side_effects(target
))
186 goto try_to_rewrite_target
;
187 if (bb_depends_on(final
, target
))
188 goto try_to_rewrite_target
;
189 return rewrite_branch(bb
, target_p
, target
, final
);
191 try_to_rewrite_target
:
193 * If we're the only parent, at least we can rewrite the
194 * now-known second branch.
196 if (bb_list_size(target
->parents
) != 1)
198 insert_branch(target
, insn
, final
);
199 kill_instruction(insn
);
203 static int simplify_one_branch(struct basic_block
*bb
, struct instruction
*br
)
205 if (simplify_phi_branch(bb
, br
))
207 return simplify_branch_branch(bb
, br
, &br
->bb_true
, 1) |
208 simplify_branch_branch(bb
, br
, &br
->bb_false
, 0);
211 static int simplify_branch_nodes(struct entrypoint
*ep
)
214 struct basic_block
*bb
;
216 FOR_EACH_PTR(ep
->bbs
, bb
) {
217 struct instruction
*br
= last_instruction(bb
->insns
);
219 if (!br
|| br
->opcode
!= OP_BR
|| !br
->bb_false
)
221 changed
|= simplify_one_branch(bb
, br
);
222 } END_FOR_EACH_PTR(bb
);
227 * This is called late - when we have intra-bb liveness information..
229 int simplify_flow(struct entrypoint
*ep
)
231 return simplify_branch_nodes(ep
);
234 static inline void concat_user_list(struct pseudo_user_list
*src
, struct pseudo_user_list
**dst
)
236 concat_ptr_list((struct ptr_list
*)src
, (struct ptr_list
**)dst
);
239 void convert_instruction_target(struct instruction
*insn
, pseudo_t src
)
242 struct pseudo_user
*pu
;
244 * Go through the "insn->users" list and replace them all..
246 target
= insn
->target
;
249 FOR_EACH_PTR(target
->users
, pu
) {
250 if (*pu
->userp
!= VOID
) {
251 assert(*pu
->userp
== target
);
254 } END_FOR_EACH_PTR(pu
);
255 concat_user_list(target
->users
, &src
->users
);
256 target
->users
= NULL
;
259 void convert_load_instruction(struct instruction
*insn
, pseudo_t src
)
261 convert_instruction_target(insn
, src
);
262 /* Turn the load into a no-op */
263 insn
->opcode
= OP_LNOP
;
267 static int overlapping_memop(struct instruction
*a
, struct instruction
*b
)
269 unsigned int a_start
= bytes_to_bits(a
->offset
);
270 unsigned int b_start
= bytes_to_bits(b
->offset
);
271 unsigned int a_size
= a
->size
;
272 unsigned int b_size
= b
->size
;
274 if (a_size
+ a_start
<= b_start
)
276 if (b_size
+ b_start
<= a_start
)
281 static inline int same_memop(struct instruction
*a
, struct instruction
*b
)
283 return a
->offset
== b
->offset
&& a
->size
== b
->size
;
287 * Return 1 if "dom" dominates the access to "pseudo"
290 * Return 0 if it doesn't, and -1 if you don't know.
292 int dominates(pseudo_t pseudo
, struct instruction
*insn
, struct instruction
*dom
, int local
)
294 int opcode
= dom
->opcode
;
296 if (opcode
== OP_CALL
|| opcode
== OP_ENTRY
)
297 return local
? 0 : -1;
298 if (opcode
!= OP_LOAD
&& opcode
!= OP_STORE
)
300 if (dom
->src
!= pseudo
) {
303 /* We don't think two explicitly different symbols ever alias */
304 if (dom
->src
->type
== PSEUDO_SYM
)
306 /* We could try to do some alias analysis here */
309 if (!same_memop(insn
, dom
)) {
310 if (dom
->opcode
== OP_LOAD
)
312 if (!overlapping_memop(insn
, dom
))
319 static int phisrc_in_bb(struct pseudo_list
*list
, struct basic_block
*bb
)
322 FOR_EACH_PTR(list
, p
) {
323 if (p
->def
->bb
== bb
)
325 } END_FOR_EACH_PTR(p
);
330 static int find_dominating_parents(pseudo_t pseudo
, struct instruction
*insn
,
331 struct basic_block
*bb
, unsigned long generation
, struct pseudo_list
**dominators
,
334 struct basic_block
*parent
;
339 FOR_EACH_PTR(bb
->parents
, parent
) {
340 struct instruction
*one
;
341 struct instruction
*br
;
344 FOR_EACH_PTR_REVERSE(parent
->insns
, one
) {
348 dominance
= dominates(pseudo
, insn
, one
, local
);
350 if (one
->opcode
== OP_LOAD
)
356 goto found_dominator
;
357 } END_FOR_EACH_PTR_REVERSE(one
);
359 if (parent
->generation
== generation
)
361 parent
->generation
= generation
;
363 if (!find_dominating_parents(pseudo
, insn
, parent
, generation
, dominators
, local
))
368 if (dominators
&& phisrc_in_bb(*dominators
, parent
))
370 br
= delete_last_instruction(&parent
->insns
);
371 phi
= alloc_phi(parent
, one
->target
, one
->size
);
372 phi
->ident
= phi
->ident
? : pseudo
->ident
;
373 add_instruction(&parent
->insns
, br
);
374 use_pseudo(insn
, phi
, add_pseudo(dominators
, phi
));
375 } END_FOR_EACH_PTR(parent
);
380 * We should probably sort the phi list just to make it easier to compare
381 * later for equality.
383 void rewrite_load_instruction(struct instruction
*insn
, struct pseudo_list
*dominators
)
388 * Check for somewhat common case of duplicate
391 new = first_pseudo(dominators
)->def
->src1
;
392 FOR_EACH_PTR(dominators
, phi
) {
393 if (new != phi
->def
->src1
)
395 new->ident
= new->ident
? : phi
->ident
;
396 } END_FOR_EACH_PTR(phi
);
399 * All the same pseudo - mark the phi-nodes unused
400 * and convert the load into a LNOP and replace the
403 FOR_EACH_PTR(dominators
, phi
) {
405 } END_FOR_EACH_PTR(phi
);
406 convert_load_instruction(insn
, new);
410 /* We leave symbol pseudos with a bogus usage list here */
411 if (insn
->src
->type
!= PSEUDO_SYM
)
412 kill_use(&insn
->src
);
413 insn
->opcode
= OP_PHI
;
414 insn
->phi_list
= dominators
;
417 static int find_dominating_stores(pseudo_t pseudo
, struct instruction
*insn
,
418 unsigned long generation
, int local
)
420 struct basic_block
*bb
= insn
->bb
;
421 struct instruction
*one
, *dom
= NULL
;
422 struct pseudo_list
*dominators
;
425 /* Unreachable load? Undo it */
427 insn
->opcode
= OP_LNOP
;
432 FOR_EACH_PTR(bb
->insns
, one
) {
436 dominance
= dominates(pseudo
, insn
, one
, local
);
438 /* Ignore partial load dominators */
439 if (one
->opcode
== OP_LOAD
)
449 } END_FOR_EACH_PTR(one
);
451 warning(pseudo
->sym
->pos
, "unable to find symbol read");
458 convert_load_instruction(insn
, dom
->target
);
462 /* OK, go find the parents */
463 bb
->generation
= generation
;
466 if (!find_dominating_parents(pseudo
, insn
, bb
, generation
, &dominators
, local
))
469 /* This happens with initial assignments to structures etc.. */
474 convert_load_instruction(insn
, value_pseudo(0));
479 * If we find just one dominating instruction, we
480 * can turn it into a direct thing. Otherwise we'll
481 * have to turn the load into a phi-node of the
484 rewrite_load_instruction(insn
, dominators
);
488 static void kill_store(struct instruction
*insn
)
492 insn
->opcode
= OP_SNOP
;
493 kill_use(&insn
->target
);
497 /* Kill a pseudo that is dead on exit from the bb */
498 static void kill_dead_stores(pseudo_t pseudo
, unsigned long generation
, struct basic_block
*bb
, int local
)
500 struct instruction
*insn
;
501 struct basic_block
*parent
;
503 if (bb
->generation
== generation
)
505 bb
->generation
= generation
;
506 FOR_EACH_PTR_REVERSE(bb
->insns
, insn
) {
507 int opcode
= insn
->opcode
;
509 if (opcode
!= OP_LOAD
&& opcode
!= OP_STORE
) {
512 if (opcode
== OP_CALL
)
516 if (insn
->src
== pseudo
) {
517 if (opcode
== OP_LOAD
)
524 if (insn
->src
->type
!= PSEUDO_SYM
)
526 } END_FOR_EACH_PTR_REVERSE(insn
);
528 FOR_EACH_PTR(bb
->parents
, parent
) {
529 struct basic_block
*child
;
530 FOR_EACH_PTR(parent
->children
, child
) {
531 if (child
&& child
!= bb
)
533 } END_FOR_EACH_PTR(child
);
534 kill_dead_stores(pseudo
, generation
, parent
, local
);
535 } END_FOR_EACH_PTR(parent
);
539 * This should see if the "insn" trivially dominates some previous store, and kill the
540 * store if unnecessary.
542 static void kill_dominated_stores(pseudo_t pseudo
, struct instruction
*insn
,
543 unsigned long generation
, struct basic_block
*bb
, int local
, int found
)
545 struct instruction
*one
;
546 struct basic_block
*parent
;
548 /* Unreachable store? Undo it */
553 if (bb
->generation
== generation
)
555 bb
->generation
= generation
;
556 FOR_EACH_PTR_REVERSE(bb
->insns
, one
) {
564 dominance
= dominates(pseudo
, insn
, one
, local
);
569 if (one
->opcode
== OP_LOAD
)
572 } END_FOR_EACH_PTR_REVERSE(one
);
575 warning(bb
->pos
, "Unable to find instruction");
579 FOR_EACH_PTR(bb
->parents
, parent
) {
580 struct basic_block
*child
;
581 FOR_EACH_PTR(parent
->children
, child
) {
582 if (child
&& child
!= bb
)
584 } END_FOR_EACH_PTR(child
);
585 kill_dominated_stores(pseudo
, insn
, generation
, parent
, local
, found
);
586 } END_FOR_EACH_PTR(parent
);
589 void check_access(struct instruction
*insn
)
591 pseudo_t pseudo
= insn
->src
;
593 if (insn
->bb
&& pseudo
->type
== PSEUDO_SYM
) {
594 int offset
= insn
->offset
, bit
= bytes_to_bits(offset
) + insn
->size
;
595 struct symbol
*sym
= pseudo
->sym
;
597 if (sym
->bit_size
> 0 && (offset
< 0 || bit
> sym
->bit_size
))
598 warning(insn
->pos
, "invalid access %s '%s' (%d %d)",
599 offset
< 0 ? "below" : "past the end of",
600 show_ident(sym
->ident
), offset
,
601 bits_to_bytes(sym
->bit_size
));
605 static void simplify_one_symbol(struct entrypoint
*ep
, struct symbol
*sym
)
607 pseudo_t pseudo
, src
;
608 struct pseudo_user
*pu
;
609 struct instruction
*def
;
611 int all
, stores
, complex;
613 /* Never used as a symbol? */
614 pseudo
= sym
->pseudo
;
618 /* We don't do coverage analysis of volatiles.. */
619 if (sym
->ctype
.modifiers
& MOD_VOLATILE
)
622 /* ..and symbols with external visibility need more care */
623 mod
= sym
->ctype
.modifiers
& (MOD_NONLOCAL
| MOD_STATIC
| MOD_ADDRESSABLE
);
625 goto external_visibility
;
630 FOR_EACH_PTR(pseudo
->users
, pu
) {
631 /* We know that the symbol-pseudo use is the "src" in the instruction */
632 struct instruction
*insn
= pu
->insn
;
634 switch (insn
->opcode
) {
644 mod
|= MOD_ADDRESSABLE
;
645 goto external_visibility
;
652 warning(sym
->pos
, "symbol '%s' pseudo used in unexpected way", show_ident(sym
->ident
));
654 complex |= insn
->offset
;
655 } END_FOR_EACH_PTR(pu
);
663 * Goodie, we have a single store (if even that) in the whole
664 * thing. Replace all loads with moves from the pseudo,
665 * replace the store with a def.
671 FOR_EACH_PTR(pseudo
->users
, pu
) {
672 struct instruction
*insn
= pu
->insn
;
673 if (insn
->opcode
== OP_LOAD
) {
675 convert_load_instruction(insn
, src
);
677 } END_FOR_EACH_PTR(pu
);
679 /* Turn the store into a no-op */
687 FOR_EACH_PTR_REVERSE(pseudo
->users
, pu
) {
688 struct instruction
*insn
= pu
->insn
;
689 if (insn
->opcode
== OP_LOAD
)
690 all
&= find_dominating_stores(pseudo
, insn
, ++bb_generation
, !mod
);
691 } END_FOR_EACH_PTR_REVERSE(pu
);
693 /* If we converted all the loads, remove the stores. They are dead */
695 FOR_EACH_PTR(pseudo
->users
, pu
) {
696 struct instruction
*insn
= pu
->insn
;
697 if (insn
->opcode
== OP_STORE
)
699 } END_FOR_EACH_PTR(pu
);
702 * If we couldn't take the shortcut, see if we can at least kill some
705 FOR_EACH_PTR(pseudo
->users
, pu
) {
706 struct instruction
*insn
= pu
->insn
;
707 if (insn
->opcode
== OP_STORE
)
708 kill_dominated_stores(pseudo
, insn
, ++bb_generation
, insn
->bb
, !mod
, 0);
709 } END_FOR_EACH_PTR(pu
);
711 if (!(mod
& (MOD_NONLOCAL
| MOD_STATIC
))) {
712 struct basic_block
*bb
;
713 FOR_EACH_PTR(ep
->bbs
, bb
) {
715 kill_dead_stores(pseudo
, ++bb_generation
, bb
, !mod
);
716 } END_FOR_EACH_PTR(bb
);
723 void simplify_symbol_usage(struct entrypoint
*ep
)
727 FOR_EACH_PTR(ep
->accesses
, pseudo
) {
728 simplify_one_symbol(ep
, pseudo
->sym
);
729 } END_FOR_EACH_PTR(pseudo
);
732 static void mark_bb_reachable(struct basic_block
*bb
, unsigned long generation
)
734 struct basic_block
*child
;
736 if (bb
->generation
== generation
)
738 bb
->generation
= generation
;
739 FOR_EACH_PTR(bb
->children
, child
) {
740 mark_bb_reachable(child
, generation
);
741 } END_FOR_EACH_PTR(child
);
744 static void kill_defs(struct instruction
*insn
)
746 pseudo_t target
= insn
->target
;
748 if (!has_use_list(target
))
750 if (target
->def
!= insn
)
753 convert_instruction_target(insn
, VOID
);
756 void kill_bb(struct basic_block
*bb
)
758 struct instruction
*insn
;
759 struct basic_block
*child
, *parent
;
761 FOR_EACH_PTR(bb
->insns
, insn
) {
762 kill_instruction_force(insn
);
765 * We kill unreachable instructions even if they
766 * otherwise aren't "killable" (e.g. volatile loads)
768 } END_FOR_EACH_PTR(insn
);
771 FOR_EACH_PTR(bb
->children
, child
) {
772 remove_bb_from_list(&child
->parents
, bb
, 0);
773 } END_FOR_EACH_PTR(child
);
776 FOR_EACH_PTR(bb
->parents
, parent
) {
777 remove_bb_from_list(&parent
->children
, bb
, 0);
778 } END_FOR_EACH_PTR(parent
);
782 void kill_unreachable_bbs(struct entrypoint
*ep
)
784 struct basic_block
*bb
;
785 unsigned long generation
= ++bb_generation
;
787 mark_bb_reachable(ep
->entry
->bb
, generation
);
788 FOR_EACH_PTR(ep
->bbs
, bb
) {
789 if (bb
->generation
== generation
)
791 /* Mark it as being dead */
794 DELETE_CURRENT_PTR(bb
);
795 } END_FOR_EACH_PTR(bb
);
796 PACK_PTR_LIST(&ep
->bbs
);
799 static int rewrite_parent_branch(struct basic_block
*bb
, struct basic_block
*old
, struct basic_block
*new)
802 struct instruction
*insn
= last_instruction(bb
->insns
);
807 /* Infinite loops: let's not "optimize" them.. */
811 switch (insn
->opcode
) {
813 changed
|= rewrite_branch(bb
, &insn
->bb_true
, old
, new);
814 changed
|= rewrite_branch(bb
, &insn
->bb_false
, old
, new);
818 struct multijmp
*jmp
;
819 FOR_EACH_PTR(insn
->multijmp_list
, jmp
) {
820 changed
|= rewrite_branch(bb
, &jmp
->target
, old
, new);
821 } END_FOR_EACH_PTR(jmp
);
830 static struct basic_block
* rewrite_branch_bb(struct basic_block
*bb
, struct instruction
*br
)
832 struct basic_block
*parent
;
833 struct basic_block
*target
= br
->bb_true
;
834 struct basic_block
*false = br
->bb_false
;
836 if (target
&& false) {
837 pseudo_t cond
= br
->cond
;
838 if (cond
->type
!= PSEUDO_VAL
)
840 target
= cond
->value
? target
: false;
844 * We can't do FOR_EACH_PTR() here, because the parent list
845 * may change when we rewrite the parent.
847 while ((parent
= first_basic_block(bb
->parents
)) != NULL
) {
848 if (!rewrite_parent_branch(parent
, bb
, target
))
854 static void vrfy_bb_in_list(struct basic_block
*bb
, struct basic_block_list
*list
)
857 struct basic_block
*tmp
;
858 int no_bb_in_list
= 0;
860 FOR_EACH_PTR(list
, tmp
) {
863 } END_FOR_EACH_PTR(tmp
);
864 assert(no_bb_in_list
);
868 static void vrfy_parents(struct basic_block
*bb
)
870 struct basic_block
*tmp
;
871 FOR_EACH_PTR(bb
->parents
, tmp
) {
872 vrfy_bb_in_list(bb
, tmp
->children
);
873 } END_FOR_EACH_PTR(tmp
);
876 static void vrfy_children(struct basic_block
*bb
)
878 struct basic_block
*tmp
;
879 struct instruction
*br
= last_instruction(bb
->insns
);
882 assert(!bb
->children
);
885 switch (br
->opcode
) {
886 struct multijmp
*jmp
;
888 vrfy_bb_in_list(br
->bb_true
, bb
->children
);
889 vrfy_bb_in_list(br
->bb_false
, bb
->children
);
892 case OP_COMPUTEDGOTO
:
893 FOR_EACH_PTR(br
->multijmp_list
, jmp
) {
894 vrfy_bb_in_list(jmp
->target
, bb
->children
);
895 } END_FOR_EACH_PTR(jmp
);
901 FOR_EACH_PTR(bb
->children
, tmp
) {
902 vrfy_bb_in_list(bb
, tmp
->parents
);
903 } END_FOR_EACH_PTR(tmp
);
906 static void vrfy_bb_flow(struct basic_block
*bb
)
912 void vrfy_flow(struct entrypoint
*ep
)
914 struct basic_block
*bb
;
915 struct basic_block
*entry
= ep
->entry
->bb
;
917 FOR_EACH_PTR(ep
->bbs
, bb
) {
921 } END_FOR_EACH_PTR(bb
);
925 void pack_basic_blocks(struct entrypoint
*ep
)
927 struct basic_block
*bb
;
929 /* See if we can merge a bb into another one.. */
930 FOR_EACH_PTR(ep
->bbs
, bb
) {
931 struct instruction
*first
, *insn
;
932 struct basic_block
*parent
, *child
, *last
;
934 if (!bb_reachable(bb
))
940 FOR_EACH_PTR(bb
->insns
, first
) {
943 switch (first
->opcode
) {
944 case OP_NOP
: case OP_LNOP
: case OP_SNOP
:
947 struct basic_block
*replace
;
948 replace
= rewrite_branch_bb(bb
, first
);
958 } END_FOR_EACH_PTR(first
);
962 * See if we only have one parent..
965 FOR_EACH_PTR(bb
->parents
, parent
) {
972 } END_FOR_EACH_PTR(parent
);
975 if (!parent
|| parent
== bb
)
979 * Goodie. See if the parent can merge..
981 FOR_EACH_PTR(parent
->children
, child
) {
984 } END_FOR_EACH_PTR(child
);
989 repeat_phase
|= REPEAT_CSE
;
991 parent
->children
= bb
->children
;
995 FOR_EACH_PTR(parent
->children
, child
) {
996 replace_bb_in_list(&child
->parents
, bb
, parent
, 0);
997 } END_FOR_EACH_PTR(child
);
999 kill_instruction(delete_last_instruction(&parent
->insns
));
1000 FOR_EACH_PTR(bb
->insns
, insn
) {
1002 assert(insn
->bb
== bb
);
1005 add_instruction(&parent
->insns
, insn
);
1006 } END_FOR_EACH_PTR(insn
);
1010 /* nothing to do */;
1011 } END_FOR_EACH_PTR(bb
);