-/**
- * A single unit of optimization. Lots of these form a copy-opt problem
- */
-typedef struct _unit_t {
- struct list_head units; /**< chain for all units */
- copy_opt_t *co; /**< the copy_opt this unit belongs to */
- int node_count; /**< size of the nodes array */
- ir_node **nodes; /**< [0] is the root-node, others are non interfering args of it. */
- int *costs; /**< costs[i] are incurred, if nodes[i] has a different color */
- int inevitable_costs; /**< sum of costs of all args interfering with root */
- int all_nodes_costs; /**< sum of all costs[i] */
- int min_nodes_costs; /**< a lower bound for the costs in costs[], determined by a max indep. set */
- int sort_key; /**< maximum costs. controls the order of ou's in the struct list_head units. */
+/* Helpers */
+#define ASSERT_OU_AVAIL(co) assert((co)->units.next && "Representation as optimization-units not build")
+#define ASSERT_GS_AVAIL(co) assert((co)->nodes && "Representation as graph not build")
+
+static inline unsigned get_irn_col(const ir_node *node)
+{
+ return arch_get_irn_register(node)->index;
+}
+
+static inline void set_irn_col(const arch_register_class_t *cls, ir_node *node,
+ unsigned color)
+{
+ const arch_register_t *reg = arch_register_for_index(cls, color);
+ arch_set_irn_register(node, reg);
+}
+
+#define list_entry_units(lh) list_entry(lh, unit_t, units)
+
+#define is_Reg_Phi(irn) (is_Phi(irn) && mode_is_data(get_irn_mode(irn)))
+
+#define get_Perm_src(irn) (get_irn_n(get_Proj_pred(irn), get_Proj_proj(irn)))
+#define is_Perm_Proj(irn) (is_Proj(irn) && be_is_Perm(get_Proj_pred(irn)))
+
+/******************************************************************************
+ ____ _ _ _ _ _ _____ _
+ / __ \ | | | | | | (_) | / ____| |
+ | | | |_ __ | |_| | | |_ __ _| |_ ___ | (___ | |_ ___ _ __ __ _ __ _ ___
+ | | | | '_ \| __| | | | '_ \| | __/ __| \___ \| __/ _ \| '__/ _` |/ _` |/ _ \
+ | |__| | |_) | |_| |__| | | | | | |_\__ \ ____) | || (_) | | | (_| | (_| | __/
+ \____/| .__/ \__|\____/|_| |_|_|\__|___/ |_____/ \__\___/|_| \__,_|\__, |\___|
+ | | __/ |
+ |_| |___/
+ ******************************************************************************/
+
+#define MIS_HEUR_TRIGGER 8
+
+typedef struct unit_t {
+ struct list_head units; /**< chain for all units */
+ copy_opt_t *co; /**< the copy opt this unit belongs to */
+ int node_count; /**< size of the nodes array */
+ ir_node **nodes; /**< [0] is the root-node, others are non interfering args of it. */
+ int *costs; /**< costs[i] are incurred, if nodes[i] has a different color */
+ int inevitable_costs; /**< sum of costs of all args interfering with root */
+ int all_nodes_costs; /**< sum of all costs[i] */
+ int min_nodes_costs; /**< a lower bound for the costs in costs[], determined by a max independent set */
+ int sort_key; /**< maximum costs. controls the order of ou's in the struct list_head units. */