+/**
+ * Schedules a node after an instruction. (That is the place after all projs and phis
+ * that are scheduled after the instruction)
+ */
+static void sched_add_after_insn(ir_node *sched_after, ir_node *node) {
+ ir_node *next = sched_next(sched_after);
+ while(!sched_is_end(next)) {
+ if(!is_Proj(next) && !is_Phi(next))
+ break;
+ next = sched_next(next);
+ }
+
+ if(sched_is_end(next)) {
+ next = sched_last(get_nodes_block(sched_after));
+ sched_add_after(next, node);
+ } else {
+ sched_add_before(next, node);
+ }
+}
+