1 /* Iterator routines for GIMPLE statements.
2 Copyright (C) 2007-2023 Free Software Foundation, Inc.
3 Contributed by Aldy Hernandez <aldy@quesejoda.com>
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
31 #include "gimple-iterator.h"
34 #include "value-prof.h"
37 /* Mark the statement STMT as modified, and update it. */
40 update_modified_stmt (gimple
*stmt
)
42 if (!ssa_operands_active (cfun
))
44 update_stmt_if_modified (stmt
);
48 /* Mark the statements in SEQ as modified, and update them. */
51 update_modified_stmts (gimple_seq seq
)
53 gimple_stmt_iterator gsi
;
55 if (!ssa_operands_active (cfun
))
57 for (gsi
= gsi_start (seq
); !gsi_end_p (gsi
); gsi_next (&gsi
))
58 update_stmt_if_modified (gsi_stmt (gsi
));
62 /* Set BB to be the basic block for all the statements in the list
63 starting at FIRST and LAST. */
66 update_bb_for_stmts (gimple_seq_node first
, gimple_seq_node last
,
71 for (n
= first
; n
; n
= n
->next
)
73 gimple_set_bb (n
, bb
);
79 /* Set the frequencies for the cgraph_edges for each of the calls
80 starting at FIRST for their new position within BB. */
83 update_call_edge_frequencies (gimple_seq_node first
, basic_block bb
)
85 struct cgraph_node
*cfun_node
= NULL
;
88 for (n
= first
; n
; n
= n
->next
)
89 if (is_gimple_call (n
))
91 struct cgraph_edge
*e
;
93 /* These function calls are expensive enough that we want
94 to avoid calling them if we never see any calls. */
95 if (cfun_node
== NULL
)
96 cfun_node
= cgraph_node::get (current_function_decl
);
98 e
= cfun_node
->get_edge (n
);
100 e
->count
= bb
->count
;
104 /* Insert the sequence delimited by nodes FIRST and LAST before
105 iterator I. M specifies how to update iterator I after insertion
106 (see enum gsi_iterator_update).
108 This routine assumes that there is a forward and backward path
109 between FIRST and LAST (i.e., they are linked in a doubly-linked
110 list). Additionally, if FIRST == LAST, this routine will properly
111 insert a single node. */
114 gsi_insert_seq_nodes_before (gimple_stmt_iterator
*i
,
115 gimple_seq_node first
,
116 gimple_seq_node last
,
117 enum gsi_iterator_update mode
)
120 gimple_seq_node cur
= i
->ptr
;
122 gcc_assert (!cur
|| cur
->prev
);
124 if ((bb
= gsi_bb (*i
)) != NULL
)
125 update_bb_for_stmts (first
, last
, bb
);
127 /* Link SEQ before CUR in the sequence. */
130 first
->prev
= cur
->prev
;
131 if (first
->prev
->next
)
132 first
->prev
->next
= first
;
134 gimple_seq_set_first (i
->seq
, first
);
140 gimple_seq_node itlast
= gimple_seq_last (*i
->seq
);
142 /* If CUR is NULL, we link at the end of the sequence (this case happens
143 when gsi_after_labels is called for a basic block that contains only
144 labels, so it returns an iterator after the end of the block, and
145 we need to insert before it; it might be cleaner to add a flag to the
146 iterator saying whether we are at the start or end of the list). */
150 first
->prev
= itlast
;
151 itlast
->next
= first
;
154 gimple_seq_set_first (i
->seq
, first
);
155 gimple_seq_set_last (i
->seq
, last
);
158 /* Update the iterator, if requested. */
162 case GSI_CONTINUE_LINKING
:
165 case GSI_LAST_NEW_STMT
:
176 /* Inserts the sequence of statements SEQ before the statement pointed
177 by iterator I. MODE indicates what to do with the iterator after
178 insertion (see enum gsi_iterator_update).
180 This function does not scan for new operands. It is provided for
181 the use of the gimplifier, which manipulates statements for which
182 def/use information has not yet been constructed. Most callers
183 should use gsi_insert_seq_before. */
186 gsi_insert_seq_before_without_update (gimple_stmt_iterator
*i
, gimple_seq seq
,
187 enum gsi_iterator_update mode
)
189 gimple_seq_node first
, last
;
194 /* Don't allow inserting a sequence into itself. */
195 gcc_assert (seq
!= *i
->seq
);
197 first
= gimple_seq_first (seq
);
198 last
= gimple_seq_last (seq
);
200 /* Empty sequences need no work. */
203 gcc_assert (first
== last
);
207 gsi_insert_seq_nodes_before (i
, first
, last
, mode
);
211 /* Inserts the sequence of statements SEQ before the statement pointed
212 by iterator I. MODE indicates what to do with the iterator after
213 insertion (see enum gsi_iterator_update). Scan the statements in SEQ
217 gsi_insert_seq_before (gimple_stmt_iterator
*i
, gimple_seq seq
,
218 enum gsi_iterator_update mode
)
220 update_modified_stmts (seq
);
221 gsi_insert_seq_before_without_update (i
, seq
, mode
);
225 /* Insert the sequence delimited by nodes FIRST and LAST after
226 iterator I. M specifies how to update iterator I after insertion
227 (see enum gsi_iterator_update).
229 This routine assumes that there is a forward and backward path
230 between FIRST and LAST (i.e., they are linked in a doubly-linked
231 list). Additionally, if FIRST == LAST, this routine will properly
232 insert a single node. */
235 gsi_insert_seq_nodes_after (gimple_stmt_iterator
*i
,
236 gimple_seq_node first
,
237 gimple_seq_node last
,
238 enum gsi_iterator_update m
)
241 gimple_seq_node cur
= i
->ptr
;
243 gcc_assert (!cur
|| cur
->prev
);
245 /* If the iterator is inside a basic block, we need to update the
246 basic block information for all the nodes between FIRST and LAST. */
247 if ((bb
= gsi_bb (*i
)) != NULL
)
248 update_bb_for_stmts (first
, last
, bb
);
250 /* Link SEQ after CUR. */
253 last
->next
= cur
->next
;
256 last
->next
->prev
= last
;
259 gimple_seq_set_last (i
->seq
, last
);
265 gcc_assert (!gimple_seq_last (*i
->seq
));
267 gimple_seq_set_first (i
->seq
, first
);
268 gimple_seq_set_last (i
->seq
, last
);
271 /* Update the iterator, if requested. */
277 case GSI_LAST_NEW_STMT
:
278 case GSI_CONTINUE_LINKING
:
290 /* Links sequence SEQ after the statement pointed-to by iterator I.
291 MODE is as in gsi_insert_after.
293 This function does not scan for new operands. It is provided for
294 the use of the gimplifier, which manipulates statements for which
295 def/use information has not yet been constructed. Most callers
296 should use gsi_insert_seq_after. */
299 gsi_insert_seq_after_without_update (gimple_stmt_iterator
*i
, gimple_seq seq
,
300 enum gsi_iterator_update mode
)
302 gimple_seq_node first
, last
;
307 /* Don't allow inserting a sequence into itself. */
308 gcc_assert (seq
!= *i
->seq
);
310 first
= gimple_seq_first (seq
);
311 last
= gimple_seq_last (seq
);
313 /* Empty sequences need no work. */
316 gcc_assert (first
== last
);
320 gsi_insert_seq_nodes_after (i
, first
, last
, mode
);
324 /* Links sequence SEQ after the statement pointed-to by iterator I.
325 MODE is as in gsi_insert_after. Scan the statements in SEQ
329 gsi_insert_seq_after (gimple_stmt_iterator
*i
, gimple_seq seq
,
330 enum gsi_iterator_update mode
)
332 update_modified_stmts (seq
);
333 gsi_insert_seq_after_without_update (i
, seq
, mode
);
337 /* Move all statements in the sequence after I to a new sequence.
338 Return this new sequence. */
341 gsi_split_seq_after (gimple_stmt_iterator i
)
343 gimple_seq_node cur
, next
;
344 gimple_seq
*pold_seq
, new_seq
;
348 /* How can we possibly split after the end, or before the beginning? */
349 gcc_assert (cur
&& cur
->next
);
354 gimple_seq_set_first (&new_seq
, next
);
355 gimple_seq_set_last (&new_seq
, gimple_seq_last (*pold_seq
));
356 gimple_seq_set_last (pold_seq
, cur
);
363 /* Set the statement to which GSI points to STMT. This only updates
364 the iterator and the gimple sequence, it doesn't do the bookkeeping
368 gsi_set_stmt (gimple_stmt_iterator
*gsi
, gimple
*stmt
)
370 gimple
*orig_stmt
= gsi_stmt (*gsi
);
373 stmt
->next
= next
= orig_stmt
->next
;
374 stmt
->prev
= prev
= orig_stmt
->prev
;
375 /* Note how we don't clear next/prev of orig_stmt. This is so that
376 copies of *GSI our callers might still hold (to orig_stmt)
377 can be advanced as if they too were replaced. */
381 gimple_seq_set_first (gsi
->seq
, stmt
);
385 gimple_seq_set_last (gsi
->seq
, stmt
);
391 /* Move all statements in the sequence before I to a new sequence.
392 Return this new sequence. I is set to the head of the new list. */
395 gsi_split_seq_before (gimple_stmt_iterator
*i
, gimple_seq
*pnew_seq
)
397 gimple_seq_node cur
, prev
;
402 /* How can we possibly split after the end? */
411 /* Set the limits on NEW_SEQ. */
412 gimple_seq_set_first (pnew_seq
, cur
);
413 gimple_seq_set_last (pnew_seq
, gimple_seq_last (old_seq
));
415 /* Cut OLD_SEQ before I. */
416 gimple_seq_set_last (&old_seq
, prev
);
422 /* Replace the statement pointed-to by GSI to STMT. If UPDATE_EH_INFO
423 is true, the exception handling information of the original
424 statement is moved to the new statement. Assignments must only be
425 replaced with assignments to the same LHS. Returns whether EH edge
426 cleanup is required. */
429 gsi_replace (gimple_stmt_iterator
*gsi
, gimple
*stmt
, bool update_eh_info
)
431 gimple
*orig_stmt
= gsi_stmt (*gsi
);
432 bool require_eh_edge_purge
= false;
434 if (stmt
== orig_stmt
)
437 gcc_assert (!gimple_has_lhs (orig_stmt
) || !gimple_has_lhs (stmt
)
438 || gimple_get_lhs (orig_stmt
) == gimple_get_lhs (stmt
));
440 gimple_set_location (stmt
, gimple_location (orig_stmt
));
441 gimple_set_bb (stmt
, gsi_bb (*gsi
));
443 /* Preserve EH region information from the original statement, if
444 requested by the caller. */
446 require_eh_edge_purge
= maybe_clean_or_replace_eh_stmt (orig_stmt
, stmt
);
448 gimple_duplicate_stmt_histograms (cfun
, stmt
, cfun
, orig_stmt
);
450 /* Free all the data flow information for ORIG_STMT. */
451 gimple_set_bb (orig_stmt
, NULL
);
452 gimple_remove_stmt_histograms (cfun
, orig_stmt
);
453 delink_stmt_imm_use (orig_stmt
);
455 gsi_set_stmt (gsi
, stmt
);
456 gimple_set_modified (stmt
, true);
457 update_modified_stmt (stmt
);
458 return require_eh_edge_purge
;
462 /* Replace the statement pointed-to by GSI with the sequence SEQ.
463 If UPDATE_EH_INFO is true, the exception handling information of
464 the original statement is moved to the last statement of the new
465 sequence. If the old statement is an assignment, then so must
466 be the last statement of the new sequence, and they must have the
470 gsi_replace_with_seq (gimple_stmt_iterator
*gsi
, gimple_seq seq
,
473 gimple_stmt_iterator seqi
;
475 if (gimple_seq_empty_p (seq
))
477 gsi_remove (gsi
, true);
480 seqi
= gsi_last (seq
);
481 last
= gsi_stmt (seqi
);
482 gsi_remove (&seqi
, false);
483 gsi_insert_seq_before (gsi
, seq
, GSI_SAME_STMT
);
484 gsi_replace (gsi
, last
, update_eh_info
);
488 /* Insert statement STMT before the statement pointed-to by iterator I.
489 M specifies how to update iterator I after insertion (see enum
490 gsi_iterator_update).
492 This function does not scan for new operands. It is provided for
493 the use of the gimplifier, which manipulates statements for which
494 def/use information has not yet been constructed. Most callers
495 should use gsi_insert_before. */
498 gsi_insert_before_without_update (gimple_stmt_iterator
*i
, gimple
*stmt
,
499 enum gsi_iterator_update m
)
501 gsi_insert_seq_nodes_before (i
, stmt
, stmt
, m
);
504 /* Insert statement STMT before the statement pointed-to by iterator I.
505 Update STMT's basic block and scan it for new operands. M
506 specifies how to update iterator I after insertion (see enum
507 gsi_iterator_update). */
510 gsi_insert_before (gimple_stmt_iterator
*i
, gimple
*stmt
,
511 enum gsi_iterator_update m
)
513 update_modified_stmt (stmt
);
514 gsi_insert_before_without_update (i
, stmt
, m
);
518 /* Insert statement STMT after the statement pointed-to by iterator I.
519 M specifies how to update iterator I after insertion (see enum
520 gsi_iterator_update).
522 This function does not scan for new operands. It is provided for
523 the use of the gimplifier, which manipulates statements for which
524 def/use information has not yet been constructed. Most callers
525 should use gsi_insert_after. */
528 gsi_insert_after_without_update (gimple_stmt_iterator
*i
, gimple
*stmt
,
529 enum gsi_iterator_update m
)
531 gsi_insert_seq_nodes_after (i
, stmt
, stmt
, m
);
535 /* Insert statement STMT after the statement pointed-to by iterator I.
536 Update STMT's basic block and scan it for new operands. M
537 specifies how to update iterator I after insertion (see enum
538 gsi_iterator_update). */
541 gsi_insert_after (gimple_stmt_iterator
*i
, gimple
*stmt
,
542 enum gsi_iterator_update m
)
544 update_modified_stmt (stmt
);
545 gsi_insert_after_without_update (i
, stmt
, m
);
549 /* Remove the current stmt from the sequence. The iterator is updated
550 to point to the next statement.
552 REMOVE_PERMANENTLY is true when the statement is going to be removed
553 from the IL and not reinserted elsewhere. In that case we remove the
554 statement pointed to by iterator I from the EH tables, and free its
555 operand caches. Otherwise we do not modify this information. Returns
556 true whether EH edge cleanup is required. */
559 gsi_remove (gimple_stmt_iterator
*i
, bool remove_permanently
)
561 gimple_seq_node cur
, next
, prev
;
562 gimple
*stmt
= gsi_stmt (*i
);
563 bool require_eh_edge_purge
= false;
565 /* ??? Do we want to do this for non-permanent operation? */
566 if (gimple_code (stmt
) != GIMPLE_PHI
)
567 insert_debug_temps_for_defs (i
);
569 gimple_set_bb (stmt
, NULL
);
571 if (remove_permanently
)
573 /* Free all the data flow information for STMT. */
574 delink_stmt_imm_use (stmt
);
575 gimple_set_modified (stmt
, true);
577 if (gimple_debug_nonbind_marker_p (stmt
))
578 /* We don't need this to be exact, but try to keep it at least
580 cfun
->debug_marker_count
--;
581 require_eh_edge_purge
= remove_stmt_from_eh_lp (stmt
);
582 gimple_remove_stmt_histograms (cfun
, stmt
);
585 /* Update the iterator and re-wire the links in I->SEQ. */
589 /* See gsi_set_stmt for why we don't reset prev/next of STMT. */
592 /* Cur is not last. */
595 /* Cur is last but not first. */
596 gimple_seq_set_last (i
->seq
, prev
);
599 /* Cur is not first. */
607 return require_eh_edge_purge
;
611 /* Finds iterator for STMT. */
614 gsi_for_stmt (gimple
*stmt
)
616 gimple_stmt_iterator i
;
617 basic_block bb
= gimple_bb (stmt
);
619 if (gimple_code (stmt
) == GIMPLE_PHI
)
620 i
= gsi_start_phis (bb
);
622 i
= gsi_start_bb (bb
);
628 /* Get an iterator for STMT, which is known to belong to SEQ. This is
629 equivalent to starting at the beginning of SEQ and searching forward
630 until STMT is found. */
633 gsi_for_stmt (gimple
*stmt
, gimple_seq
*seq
)
635 gimple_stmt_iterator i
= gsi_start (*seq
);
640 /* Finds iterator for PHI. */
643 gsi_for_phi (gphi
*phi
)
646 basic_block bb
= gimple_bb (phi
);
648 i
= gsi_start_phis (bb
);
654 /* Move the statement at FROM so it comes right after the statement at TO. */
657 gsi_move_after (gimple_stmt_iterator
*from
, gimple_stmt_iterator
*to
)
659 gimple
*stmt
= gsi_stmt (*from
);
660 gsi_remove (from
, false);
662 /* We must have GSI_NEW_STMT here, as gsi_move_after is sometimes used to
663 move statements to an empty block. */
664 gsi_insert_after (to
, stmt
, GSI_NEW_STMT
);
668 /* Move the statement at FROM so it comes right before the statement
672 gsi_move_before (gimple_stmt_iterator
*from
, gimple_stmt_iterator
*to
)
674 gimple
*stmt
= gsi_stmt (*from
);
675 gsi_remove (from
, false);
677 /* For consistency with gsi_move_after, it might be better to have
678 GSI_NEW_STMT here; however, that breaks several places that expect
679 that TO does not change. */
680 gsi_insert_before (to
, stmt
, GSI_SAME_STMT
);
684 /* Move the statement at FROM to the end of basic block BB. */
687 gsi_move_to_bb_end (gimple_stmt_iterator
*from
, basic_block bb
)
689 gimple_stmt_iterator last
= gsi_last_bb (bb
);
690 gcc_checking_assert (gsi_bb (last
) == bb
);
692 /* Have to check gsi_end_p because it could be an empty block. */
693 if (!gsi_end_p (last
) && is_ctrl_stmt (gsi_stmt (last
)))
694 gsi_move_before (from
, &last
);
696 gsi_move_after (from
, &last
);
700 /* Add STMT to the pending list of edge E. No actual insertion is
701 made until a call to gsi_commit_edge_inserts () is made. */
704 gsi_insert_on_edge (edge e
, gimple
*stmt
)
706 gimple_seq_add_stmt (&PENDING_STMT (e
), stmt
);
709 /* Add the sequence of statements SEQ to the pending list of edge E.
710 No actual insertion is made until a call to gsi_commit_edge_inserts
714 gsi_insert_seq_on_edge (edge e
, gimple_seq seq
)
716 gimple_seq_add_seq (&PENDING_STMT (e
), seq
);
719 /* Return a new iterator pointing to the first statement in sequence of
720 statements on edge E. Such statements need to be subsequently moved into a
721 basic block by calling gsi_commit_edge_inserts. */
724 gsi_start_edge (edge e
)
726 return gsi_start (PENDING_STMT (e
));
729 /* Insert the statement pointed-to by GSI into edge E. Every attempt
730 is made to place the statement in an existing basic block, but
731 sometimes that isn't possible. When it isn't possible, the edge is
732 split and the statement is added to the new block.
734 In all cases, the returned *GSI points to the correct location. The
735 return value is true if insertion should be done after the location,
736 or false if it should be done before the location. If a new basic block
737 has to be created, it is stored in *NEW_BB. */
740 gimple_find_edge_insert_loc (edge e
, gimple_stmt_iterator
*gsi
,
743 basic_block dest
, src
;
748 /* If the destination has one predecessor which has no PHI nodes,
749 insert there. Except for the exit block.
751 The requirement for no PHI nodes could be relaxed. Basically we
752 would have to examine the PHIs to prove that none of them used
753 the value set by the statement we want to insert on E. That
754 hardly seems worth the effort. */
756 if (single_pred_p (dest
)
757 && gimple_seq_empty_p (phi_nodes (dest
))
758 && dest
!= EXIT_BLOCK_PTR_FOR_FN (cfun
))
760 *gsi
= gsi_start_bb (dest
);
761 if (gsi_end_p (*gsi
))
764 /* Make sure we insert after any leading labels. */
765 tmp
= gsi_stmt (*gsi
);
766 while (gimple_code (tmp
) == GIMPLE_LABEL
)
769 if (gsi_end_p (*gsi
))
771 tmp
= gsi_stmt (*gsi
);
774 if (gsi_end_p (*gsi
))
776 *gsi
= gsi_last_bb (dest
);
783 /* If the source has one successor, the edge is not abnormal and
784 the last statement does not end a basic block, insert there.
785 Except for the entry block. */
787 if ((e
->flags
& EDGE_ABNORMAL
) == 0
788 && (single_succ_p (src
)
789 /* Do not count a fake edge as successor as added to infinite
790 loops by connect_infinite_loops_to_exit. */
791 || (EDGE_COUNT (src
->succs
) == 2
792 && (EDGE_SUCC (src
, 0)->flags
& EDGE_FAKE
793 || EDGE_SUCC (src
, 1)->flags
& EDGE_FAKE
)))
794 && src
!= ENTRY_BLOCK_PTR_FOR_FN (cfun
))
796 *gsi
= gsi_last_bb (src
);
797 if (gsi_end_p (*gsi
))
800 tmp
= gsi_stmt (*gsi
);
801 if (is_gimple_debug (tmp
))
803 gimple_stmt_iterator si
= *gsi
;
804 gsi_prev_nondebug (&si
);
807 /* If we don't have a BB-ending nondebug stmt, we want to
808 insert after the trailing debug stmts. Otherwise, we may
809 insert before the BB-ending nondebug stmt, or split the
811 if (!stmt_ends_bb_p (tmp
))
815 else if (!stmt_ends_bb_p (tmp
))
818 switch (gimple_code (tmp
))
828 /* Otherwise, create a new basic block, and split this edge. */
829 dest
= split_edge (e
);
832 e
= single_pred_edge (dest
);
837 /* Similar to gsi_insert_on_edge+gsi_commit_edge_inserts. If a new
838 block has to be created, it is returned. */
841 gsi_insert_on_edge_immediate (edge e
, gimple
*stmt
)
843 gimple_stmt_iterator gsi
;
844 basic_block new_bb
= NULL
;
847 gcc_assert (!PENDING_STMT (e
));
849 ins_after
= gimple_find_edge_insert_loc (e
, &gsi
, &new_bb
);
851 update_call_edge_frequencies (stmt
, gsi
.bb
);
854 gsi_insert_after (&gsi
, stmt
, GSI_NEW_STMT
);
856 gsi_insert_before (&gsi
, stmt
, GSI_NEW_STMT
);
861 /* Insert STMTS on edge E. If a new block has to be created, it
865 gsi_insert_seq_on_edge_immediate (edge e
, gimple_seq stmts
)
867 gimple_stmt_iterator gsi
;
868 basic_block new_bb
= NULL
;
871 gcc_assert (!PENDING_STMT (e
));
873 ins_after
= gimple_find_edge_insert_loc (e
, &gsi
, &new_bb
);
874 update_call_edge_frequencies (gimple_seq_first (stmts
), gsi
.bb
);
877 gsi_insert_seq_after (&gsi
, stmts
, GSI_NEW_STMT
);
879 gsi_insert_seq_before (&gsi
, stmts
, GSI_NEW_STMT
);
884 /* This routine will commit all pending edge insertions, creating any new
885 basic blocks which are necessary. */
888 gsi_commit_edge_inserts (void)
894 gsi_commit_one_edge_insert (single_succ_edge (ENTRY_BLOCK_PTR_FOR_FN (cfun
)),
897 FOR_EACH_BB_FN (bb
, cfun
)
898 FOR_EACH_EDGE (e
, ei
, bb
->succs
)
899 gsi_commit_one_edge_insert (e
, NULL
);
903 /* Commit insertions pending at edge E. If a new block is created, set NEW_BB
904 to this block, otherwise set it to NULL. */
907 gsi_commit_one_edge_insert (edge e
, basic_block
*new_bb
)
912 if (PENDING_STMT (e
))
914 gimple_stmt_iterator gsi
;
915 gimple_seq seq
= PENDING_STMT (e
);
918 PENDING_STMT (e
) = NULL
;
920 ins_after
= gimple_find_edge_insert_loc (e
, &gsi
, new_bb
);
921 update_call_edge_frequencies (gimple_seq_first (seq
), gsi
.bb
);
924 gsi_insert_seq_after (&gsi
, seq
, GSI_NEW_STMT
);
926 gsi_insert_seq_before (&gsi
, seq
, GSI_NEW_STMT
);
930 /* Returns iterator at the start of the list of phi nodes of BB. */
933 gsi_start_phis (basic_block bb
)
935 gimple_seq
*pseq
= phi_nodes_ptr (bb
);
937 /* Adapted from gsi_start. */
940 i
.ptr
= gimple_seq_first (*pseq
);
942 i
.bb
= i
.ptr
? gimple_bb (i
.ptr
) : NULL
;