+#include <stdbool.h>
+
+#include "irgraph.h"
+#include "irnode.h"
+#include "beirg.h"
+#include "beinfo.h"
+#include "beutil.h"
+
+static sched_info_t *get_irn_sched_info(const ir_node *node)
+{
+ return &be_get_info(skip_Proj_const(node))->sched_info;
+}
+
+/**
+ * Check, if the node is scheduled.
+ * @param irn The node.
+ * @return 1, if the node is scheduled, 0 if not.
+ */
+static inline bool sched_is_scheduled(const ir_node *irn)
+{
+ return get_irn_sched_info(irn)->next != NULL;
+}
+
+/**
+ * Returns the time step of a node. Each node in a block has a timestep
+ * unique to that block. A node schedule before another node has a lower
+ * timestep than this node.
+ * @param irn The node.
+ * @return The time step in the schedule.
+ */
+static inline sched_timestep_t sched_get_time_step(const ir_node *irn)
+{
+ assert(sched_is_scheduled(irn));
+ return get_irn_sched_info(irn)->time_step;
+}
+
+static inline bool sched_is_end(const ir_node *node)
+{
+ return is_Block(node);
+}
+
+static inline bool sched_is_begin(const ir_node *node)
+{
+ return is_Block(node);
+}
+
+/**
+ * Check, if an ir_node has a scheduling successor.
+ * @param irn The ir node.
+ * @return 1, if the node has a scheduling successor, 0 if not.
+ */
+static inline bool sched_has_next(const ir_node *irn)
+{
+ const sched_info_t *info = get_irn_sched_info(irn);
+ const ir_node *block = is_Block(irn) ? irn : get_nodes_block(irn);
+ return info->next != block;
+}
+
+/**
+ * Check, if an ir_node has a scheduling predecessor.
+ * @param irn The ir node.
+ * @return 1, if the node has a scheduling predecessor, 0 if not.
+ */
+static inline bool sched_has_prev(const ir_node *irn)
+{
+ const sched_info_t *info = get_irn_sched_info(irn);
+ const ir_node *block = is_Block(irn) ? irn : get_nodes_block(irn);
+ return info->prev != block;
+}
+
+/**
+ * Get the scheduling successor of a node.
+ * @param irn The node.
+ * @return The next ir node in the schedule or the block, if the node has no next node.
+ */
+static inline ir_node *sched_next(const ir_node *irn)
+{
+ const sched_info_t *info = get_irn_sched_info(irn);
+ return info->next;
+}
+
+/**
+ * Get the scheduling predecessor of a node.
+ * @param irn The node.
+ * @return The next ir node in the schedule or the block, if the node has no predecessor.
+ * predecessor.
+ */
+static inline ir_node *sched_prev(const ir_node *irn)
+{
+ const sched_info_t *info = get_irn_sched_info(irn);
+ return info->prev;
+}