- CFG-aware instruction chain manipulation
delete_insn, delete_insn_chain
- Edge splitting and committing to edges
- insert_insn_on_edge, commit_edge_insertions
+ insert_insn_on_edge, prepend_insn_to_edge, commit_edge_insertions
- CFG updating after insn simplification
purge_dead_edges, purge_all_dead_edges
- CFG fixing after coarse manipulation
/* Queue instructions for insertion on an edge between two basic blocks.
The new instructions and basic blocks (if any) will not appear in the
- CFG until commit_edge_insertions is called. */
+ CFG until commit_edge_insertions is called. If there are already
+ queued instructions on the edge, PATTERN is appended to them. */
void
insert_insn_on_edge (rtx pattern, edge e)
end_sequence ();
}
+/* Like insert_insn_on_edge, but if there are already queued instructions
+ on the edge, PATTERN is prepended to them. */
+
+void
+prepend_insn_to_edge (rtx pattern, edge e)
+{
+ /* We cannot insert instructions on an abnormal critical edge.
+ It will be easier to find the culprit if we die now. */
+ gcc_assert (!((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e)));
+
+ start_sequence ();
+
+ emit_insn (pattern);
+ emit_insn (e->insns.r);
+
+ e->insns.r = get_insns ();
+ end_sequence ();
+}
+
/* Update the CFG for the instructions queued on edge E. */
void
extern void emit_barrier_after_bb (basic_block bb);
extern basic_block force_nonfallthru_and_redirect (edge, basic_block, rtx);
extern void insert_insn_on_edge (rtx, edge);
+extern void prepend_insn_to_edge (rtx, edge);
extern void commit_one_edge_insertion (edge e);
extern void commit_edge_insertions (void);
extern void print_rtl_with_bb (FILE *, const rtx_insn *, dump_flags_t);