-/**
- * Data representing the problem of copy minimization.
- */
-typedef struct _copy_opt_t {
- ir_graph *irg; /**< the irg to process */
- const arch_isa_if_t *isa;
- const arch_register_class_t *cls; /**< the registerclass to optimize */
- struct list_head units; /**< all units to optimize in right oreder */
- pset *roots; /**< used only temporary for detecting multiple appends */
- struct obstack ob;
-} copy_opt_t;
+/* Helpers */
+#define get_arch_env(co) ((co)->chordal_env->main_env->arch_env)
+#define get_irg(co) ((co)->chordal_env->irg)
+#define get_irn_col(co, irn) \
+ arch_register_get_index(arch_get_irn_register(get_arch_env(co), irn))
+#define set_irn_col(co, irn, col) \
+ arch_set_irn_register(get_arch_env(co), irn, arch_register_for_index(co->chordal_env->cls, col))
+
+
+#define list_entry_units(lh) list_entry(lh, unit_t, units)
+
+#define get_Copy_src(irn) (get_irn_n(get_Proj_pred(irn), get_Proj_proj(irn)))
+#define is_Perm(arch_env, irn) (arch_irn_classify(arch_env, irn) == arch_irn_class_perm)
+#define is_Reg_Phi(irn) (is_Phi(irn) && mode_is_data(get_irn_mode(irn)))
+#define is_Perm_Proj(arch_env, irn) (is_Proj(irn) && is_Perm(arch_env, get_Proj_pred(irn)))
+#define is_2addr_code(arch_env, irn, req) (arch_get_register_req(arch_env, req, irn, -1)->type == arch_register_req_type_should_be_same)